Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AllenDowney/ThinkPython
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3
Choose a base ref
...
head repository: midudev/ThinkPython
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 19 commits
  • 84 files changed
  • 2 contributors

Commits on May 19, 2026

  1. Translate Think Python to Spanish

    Translate the book notebooks and blank exercise notebooks to Spanish while preserving code cells, licensing, and original attribution.
    
    Add README instructions for building and running the notebooks, and credit the Spanish translation to midudev (Miguel Ángel Durán).
    
    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    midudev and Copilot committed May 19, 2026
    Configuration menu
    Copy the full SHA
    3c407c3 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1 from midudev/midudev/traducir-al-espanol

    Traducir Think Python al español
    midudev authored May 19, 2026
    Configuration menu
    Copy the full SHA
    7775cde View commit details
    Browse the repository at this point in the history
  3. chore: ignorar carpeta de build de Jupyter Book

    Añade `jb/_build/` al .gitignore para evitar versionar los artefactos
    generados (HTML, PDF, doctrees, jupyter_execute, etc.) por `jb build`.
    midudev committed May 19, 2026
    Configuration menu
    Copy the full SHA
    7a5cb8c View commit details
    Browse the repository at this point in the history
  4. build(jb): configurar Jupyter Book con baseurl y extensión PDF

    - Apunta el repositorio al fork de midudev (rama v3) y añade
      `baseurl: https://libropython.es` para los enlaces canónicos.
    - Actualiza el footer con enlace a midu.dev en la atribución.
    - Migra la configuración de MathJax a `mathjax3_config`/`tex` para
      compatibilidad con MathJax 3.
    - Registra la extensión local `full_book_pdf`, que sustituye el menú
      de descarga por página por un botón único que enlaza al PDF del
      libro completo (`think-python-es.pdf`).
    midudev committed May 19, 2026
    Configuration menu
    Copy the full SHA
    044847b View commit details
    Browse the repository at this point in the history
  5. build(jb): reescribir script con symlinks, validación y PDF

    - Usa `set -euo pipefail` y se posiciona en su propio directorio para
      poder ejecutarse desde cualquier ruta.
    - Sustituye el `cp` de notebooks desde `ThinkPythonSolutions` por
      symlinks a `../chapters/chap*.ipynb`, evitando duplicar archivos y
      manteniendo una única fuente de verdad.
    - Valida que `jupyter-book` y `playwright` estén disponibles antes de
      construir, con mensajes claros de instalación.
    - Genera además del HTML el PDF del libro completo (`pdfhtml`) y lo
      copia a `_build/html/think-python-es.pdf` para servirlo junto al
      sitio.
    - Elimina el paso de `ghp-import`, ya que la publicación se gestionará
      desde el output de `_build/html`.
    midudev committed May 19, 2026
    Configuration menu
    Copy the full SHA
    ad0886f View commit details
    Browse the repository at this point in the history
  6. feat(jb): añadir índice, página en blanco y capítulos del libro

    - `jb/index.md`: portada del Jupyter Book con presentación, enlaces a
      las versiones impresa/electrónica y créditos de traducción.
    - `jb/blank.md`: página separadora usada por la maquetación.
    - `jb/chap00.ipynb`..`jb/chap19.ipynb`: symlinks a los notebooks
      traducidos en `../chapters/`, que son los que Jupyter Book consume
      para generar el HTML y el PDF.
    midudev committed May 19, 2026
    Configuration menu
    Copy the full SHA
    3634adf View commit details
    Browse the repository at this point in the history
  7. docs: reescribir README con instalación, build y enlaces actualizados

    - Añade sección de requisitos (Python 3, pip, Jupyter, Jupyter Book,
      Playwright) y comandos de instalación tanto para entorno completo
      como para solo build.
    - Documenta el flujo de construcción con `./build.sh` y la ubicación
      de los artefactos generados (HTML y PDF).
    - Describe la estructura del proyecto (`chapters/`, `jb/`,
      `jb/build.sh`, `jb/_build/html/`).
    - Incluye enlace al sitio publicado (libropython.es) y a la licencia
      Creative Commons BY-NC-SA 4.0.
    midudev committed May 19, 2026
    Configuration menu
    Copy the full SHA
    026384b View commit details
    Browse the repository at this point in the history

Commits on May 20, 2026

  1. feat: update README, add deployment instructions, and configure Wrangler

    - Updated README to include links to the public book page and the GitHub repository.
    - Added deployment instructions for Cloudflare Workers, detailing the build and deployment process.
    - Introduced `wrangler.toml` for managing static assets deployment.
    - Enhanced the build script to copy static site files to the `dist/` directory.
    - Updated the full book PDF extension to point site-level links to the public site.
    midudev committed May 20, 2026
    Configuration menu
    Copy the full SHA
    e2dcbcc View commit details
    Browse the repository at this point in the history
  2. chore: update .gitignore to include Wrangler cache file

    - Added `jb/.wrangler/cache/wrangler-account.json` to .gitignore to prevent versioning of Wrangler's cache files.
    midudev committed May 20, 2026
    Configuration menu
    Copy the full SHA
    6a76e3c View commit details
    Browse the repository at this point in the history
  3. Balance logo title wrapping

    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    midudev and Copilot authored May 20, 2026
    Configuration menu
    Copy the full SHA
    1e186ce View commit details
    Browse the repository at this point in the history
  4. fix(jb): ocultar celdas iniciales en el HTML (#3)

    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    midudev and Copilot authored May 20, 2026
    Configuration menu
    Copy the full SHA
    5a7359f View commit details
    Browse the repository at this point in the history
  5. Configure Wrangler observability (#4)

    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    midudev and Copilot authored May 20, 2026
    Configuration menu
    Copy the full SHA
    316cd75 View commit details
    Browse the repository at this point in the history
  6. Update Spanish book cover (#5)

    Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
    midudev and Copilot authored May 20, 2026
    Configuration menu
    Copy the full SHA
    7d85bae View commit details
    Browse the repository at this point in the history
  7. chore: ignorar imagen fuente de portada en extra_html

    Añade `jb/extra_html/cover-source.jpg` al .gitignore: es la imagen
    original sin optimizar usada para derivar la portada y la OG image,
    y no necesita versionarse junto al resto de assets ya optimizados.
    midudev committed May 20, 2026
    Configuration menu
    Copy the full SHA
    5edec74 View commit details
    Browse the repository at this point in the history
  8. feat(jb): añadir favicons, OG image y manifest en extra_html

    Incluye los assets estáticos servidos en la raíz del sitio publicado:
    
    - `favicon.ico`, `favicon.svg`, `favicon-16.png`, `favicon-32.png`,
      `favicon-32x32.png`: iconos de pestaña para distintos navegadores.
    - `apple-touch-icon.png` e `icon-512.png`: iconos para iOS y PWA.
    - `og-image.jpg`: imagen 1200x630 usada en metaetiquetas Open Graph
      y Twitter Card al compartir el libro en redes.
    - `site.webmanifest`: manifiesto web con nombre, iconos y colores.
    
    Estos archivos se copian tal cual al sitio gracias a `html_extra_path`
    en el config de Jupyter Book.
    midudev committed May 20, 2026
    Configuration menu
    Copy the full SHA
    c02129d View commit details
    Browse the repository at this point in the history
  9. feat(jb): añadir extensión SEO con Open Graph, Twitter Card y JSON-LD

    - Nueva extensión Sphinx `_extensions/seo.py` que inyecta en cada
      página un contexto `seo` con título, descripción, URL canónica,
      imagen, autor, traductor y locale. La home recibe un título sin
      sufijo y se mapea a la raíz del dominio.
    - Nuevo template `_templates/layout.html` que extiende el layout del
      tema y, usando ese contexto, añade en `<head>`:
      - `<title>` y `<meta name="description">`.
      - Etiquetas Open Graph (`og:title`, `og:description`, `og:image`,
        `og:url`, dimensiones e idioma) y Twitter Card
        (`summary_large_image`).
      - Enlaces a favicons (`.ico`, `.svg`, PNG), `apple-touch-icon` y
        `site.webmanifest`.
      - JSON-LD de tipo `Book` con autor, traductor, idioma, licencia y
        `isAccessibleForFree`, mejorando la indexación en buscadores.
    midudev committed May 20, 2026
    Configuration menu
    Copy the full SHA
    dce414c View commit details
    Browse the repository at this point in the history
  10. feat(jb): renombrar a "Think Python en español" y activar SEO/favicon

    - Cambia el título del libro a "Think Python en español" en
      `_config.yml` e `index.md` (eliminando el sufijo "edición en
      español") para un branding más claro y mejor SEO.
    - Añade en `_config.yml`:
      - `html.favicon: extra_html/favicon.ico`.
      - Registro de la extensión local `seo` (`_extensions/seo.py`).
      - `language: es`, `html_title`, `html_short_title` y
        `html_extra_path: [extra_html]` para que Sphinx use el idioma
        correcto y publique los assets estáticos.
    - Añade frontmatter (`title`, `description`) a `index.md` para que
      la home aparezca con metadatos optimizados en buscadores.
    midudev committed May 20, 2026
    Configuration menu
    Copy the full SHA
    da59313 View commit details
    Browse the repository at this point in the history
  11. fix(jb): sanear titles en metaetiquetas SEO para evitar HTML colado

    El `title` que Sphinx pasa al contexto de cada capítulo incluye HTML
    (p. ej. `<span class="section-number">6. </span>Valores de retorno`).
    Al inyectarlo dentro de `<meta property="og:title" content="...">`,
    las comillas internas del `class="…"` rompían el atributo y el resto
    del título quedaba como texto suelto visible en la cabecera del sitio
    desplegado.
    
    Cambios:
    
    - `_extensions/seo.py`: nueva utilidad `_strip_html` que elimina las
      etiquetas y decodifica entidades antes de construir `page_title`,
      para que los hijos del contexto no contengan markup.
    - `_templates/layout.html`:
      - Aplica `|striptags|e` a `seo.page_title` y `seo.description` en
        `<title>` y en todas las meta de Open Graph y Twitter Card como
        defensa frente a regresiones.
      - Escapa el resto de valores con `|e`.
      - Reescribe el bloque JSON-LD usando `|tojson`, que es la forma
        correcta de serializar strings dentro de `application/ld+json`
        (evita romper el JSON con comillas o caracteres especiales).
    midudev committed May 20, 2026
    Configuration menu
    Copy the full SHA
    c851c6d View commit details
    Browse the repository at this point in the history
  12. fix(jb): ocultar también la celda de imports cuando va en su propia c…

    …elda
    
    `prep_notebooks.py` añadía `remove-cell` solo cuando una misma celda
    incluía a la vez `def download(url):` y `import thinkpython`. En
    chap04 esos dos bloques están repartidos en dos celdas consecutivas,
    por lo que ninguna de las dos cumplía la condición AND y el HTML
    desplegado mostraba el código de descarga y de configuración de
    autoreload al principio del capítulo.
    
    Ahora se detectan dos patrones independientes:
    
    - Celdas con `def download(url):` (setup de descarga).
    - Celdas con `import thinkpython` y `%autoreload` (setup de
      autoreload).
    
    Cualquier celda que coincida con alguno de los dos recibe los tags
    `remove-cell` y `keep`, así que se ocultan tanto cuando van juntas
    (resto de capítulos) como cuando van separadas (chap04). Verificado
    reconstruyendo el HTML: ya no aparecen los bloques en chap04 y el
    resto de capítulos siguen igual.
    midudev committed May 20, 2026
    Configuration menu
    Copy the full SHA
    a4ab297 View commit details
    Browse the repository at this point in the history
Loading