promote: rule 7 makes Colab-friendly links relative, and a notebook opened outside the site cannot follow them

Abierto
#45 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
1-2 días
Aptitud para principiantes
44/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
jupyter, python
Área
build-system

Línea de trabajo

Start by reading rule 7 in tools/promote, especially the QE_URL_RE pattern and its comment, then trace the product build step that publishes pooled notebooks. Check how the two links in lectures/linear_algebra.md and lectures/linear_models.md are handled. Done means pooled files remain tracked and self-contained, while published notebooks contain working full links for their product site.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

question

Promote's rule 7 (tools/promote, the QE_URL_RE pattern, which its comment calls "the Colab-compatibility pattern") finds a link written as a published QuantEcon address, https://<site>.quantecon.org/_static/..., pools the file when the canonical series holds it, and rewrites the link to the pool path. It applied for the first time with intermediate's promotion (QuantEcon/lectures#44), to two links:

  • lectures/linear_algebra.md, line 842: [these notes](https://python.quantecon.org/_static/lecture_specific/linear_algebra/course_notes.pdf) became [these notes](_static/linear_algebra/course_notes.pdf).
  • lectures/linear_models.md, line 1046: the same, for iteration_notes.pdf.

The pooled PDFs are byte-identical to the published ones, and the relative links resolve on a site built from the pool. But the series write such links in full so that they work wherever the lecture is read: intermediate's _config.yml offers Colab launch buttons, and in a notebook opened in Colab, or downloaded, a relative _static/ link reaches nothing.

These two are the only such links in the estate at the current pins. Nothing breaks today, since the series still publish from their own repositories; it matters once a product's notebooks are built from the pool.

One way to settle it, at the build stage: keep rule 7, so the pool stays self-contained and the files are tracked, and have each product build write these links back in full, on the product's own site, into the notebooks it publishes. Leaving the links absolute in the pool instead would not hold after cutover: the pooled file lives at _static/<slug>/, so the old _static/lecture_specific/ address would no longer exist on a site built from the pool.

Lenguaje dominante
Python
Estrellas
1
Forks
0
Merge medio
1 d 3 h
PR fusionados (30 d)
17

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de QuantEcon/lectures

Todos los issues de QuantEcon/lectures

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.