A page that fails to parse is left out of a website render, links to it break, and `post-render` doesn't run
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Área
- build-system, cli
Línea de trabajo
Start with the render path that prints 'profile-pass skipped' and the Q-13-1/Q-13-4 sidebar and link checks, then trace how a failed parse marks a page as missing from the project index. Repro is in the issue: a website with a bad.qmd that fails to parse, then check whether post-render runs and whether _site/index.html keeps href="bad.qmd". Done means the failed page is reported as an error, the follow-on warnings name the parse failure instead of a spelling mistake, and the exit status and post-render behavior are consistent.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
This issue was written by Claude while adding q2 support to Great Docs. The output shown comes from running each repro.
Bug description
When one page of a website fails to parse, q2 renders the other pages and leaves that page out of
the site entirely. The parse error itself is clear and has a location. What follows is not:
- The error is labeled a warning. It prints as
warning: profile-pass skipped <file>: Error: [Q-2-7] …, but the summary counts it as an error. - The follow-on warnings blame the wrong file. Every sidebar entry and link to the dropped page
gets a Q-13-1 or Q-13-4 warning saying it "is not in the project index" and to "check the
spelling". The real cause is that the target failed to parse. - Links to the dropped page stay
.qmd. The rendered HTML keepshref="bad.qmd", in the body
and in every page's sidebar, so they're broken links in the published site. post-renderdoesn't run, andq2 renderexits 1. The_sitedirectory is left with the
pages that rendered, but no post-processing. That's neither the full site nor a clean failure.- A single-file render fails because of other pages.
q2 render good.qmdreports
bad.qmd's error and exits 1, even thoughgood.qmdrendered.
q2's parser is stricter than Pandoc's, so many pages that Quarto 1 renders fail to parse under q2.
That makes this path common for existing sites. Great Docs' own docs have about 90 such pages under
q2. Great Docs' post-render scripts build shared sidebars, clean the search index and write page
tags, so skipping them breaks the whole site rather than one page. Great Docs also renders single
pages (great-docs freeze, example checks, an editor preview) and can't tell success from failure
from the exit status.
Related: #232 (parse errors prevent recovery) and #233 ("Sibling page failed to parse").
Steps to reproduce
mkdir parse-drop && cd parse-drop
cat > _quarto.yml <<'EOF'
project:
type: website
post-render: post.py
website:
sidebar:
contents:
- index.qmd
- good.qmd
- bad.qmd
EOF
printf 'from pathlib import Path\nPath("post-render-ran.txt").write_text("yes\\n")\n' > post.py
printf -- '---\ntitle: Home\n---\n\nSee [the good page](good.qmd) and [the bad page](bad.qmd).\n' > index.qmd
printf -- '---\ntitle: Good\n---\n\nFine.\n' > good.qmd
printf -- '---\ntitle: Bad\n---\n\nEdit `pyproject.toml`'"'"'s settings.\n' > bad.qmd
q2 render; echo "exit=$?"
ls _site post-render-ran.txt
grep -o 'href="[^"]*bad[^"]*"' _site/index.html _site/good.html
q2 render good.qmd; echo "exit=$?"
bad.qmd fails because of the apostrophe after the code span. That error is expected; this issue is
about what happens to the rest of the render.
Actual behavior
Rendering project: /private/tmp/parse-drop (type: website)
warning: profile-pass skipped /private/tmp/parse-drop/bad.qmd: Error: [Q-2-7] Unclosed Single Quote
╭─[ /private/tmp/parse-drop/bad.qmd:5:34 ]
│
5 │ Edit `pyproject.toml`'s settings.
│ ┬ ┬
│ ╰────────────── This is the opening quote. If you need an apostrophe, escape it with a backslash.
│ │
│ ╰── I reached the end of the block before finding a closing "'" for the quote.
───╯
Warning: [Q-13-1] Sidebar references missing document
╭─[ /private/tmp/parse-drop/_quarto.yml:9:9 ]
│
9 │ - bad.qmd
│ ───┬───
│ ╰───── `bad.qmd` is not in the project index.
───╯
ℹ Check the spelling, or confirm the target file is included in the render set.
Affected files: /private/tmp/parse-drop/good.qmd, /private/tmp/parse-drop/index.qmd
Warning: [Q-13-4] Body link references missing document
╭─[ /private/tmp/parse-drop/index.qmd:5:50 ]
│
5 │ See [the good page](good.qmd) and [the bad page](bad.qmd).
│ ───┬───
│ ╰───── `bad.qmd` is not in the project index.
───╯
ℹ Check the spelling, or confirm the target file is included in the render set.
Rendered 2 of 3 files to /private/tmp/parse-drop/_site — 1 error, 3 warnings
exit=1
_sitehasgood.htmlandindex.html, and nobad.html.post-render-ran.txtdoesn't exist.index.htmlandgood.htmllink tobad.qmd.q2 render good.qmdprints the samebad.qmderror and Q-13-1 warning, rendersgood.html,
reports "Rendered 1 of 3 files … 1 error, 1 warning" and exits 1.
With the apostrophe escaped (`pyproject.toml`\'s), all three pages render, post-render runs
and the exit status is 0. Quarto 1.9.37 renders the original project, including bad.html, runs
post-render and exits 0.
Expected behavior
- Print a page that failed to parse as an error, and say the page was not rendered.
- Have the Q-13-1 and Q-13-4 warnings say the target failed to render, or leave them out when
their target failed, instead of suggesting a spelling mistake. - Make the outcome of a failed page consistent. Either the render fails without leaving a partial
site, or it finishes the site,post-renderincluded, and exits non-zero. An option to choose
(something like--keep-going) would suit tools like Great Docs, which want the full site plus a
list of failed pages. - For
q2 render <files>, base the exit status on the named files, and report other pages' parse
errors as warnings at most.
- Lenguaje dominante
- Rust
- Estrellas
- 302
- Forks
- 22
- Merge medio
- 5 h 2 min
- PR fusionados (30 d)
- 213
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de quarto-dev/q2
-
`dir: rtl` isn't written to `<html>` in HTML outputPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quarto-dev/q2#1219 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
quarto-dev/q2#1188 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
quarto-dev/q2#1179 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
quarto-dev/q2#1133 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
quarto-dev/q2#1103 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de quarto-dev/q2
Issues similares
-
priority: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
storytold/photocraft#15350 ·
Los mantenedores suelen responder en 1 día
-
area:davinci
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ubugeeei-prod/vize#13167 ·
Los mantenedores suelen responder en 1 día
-
area:ui enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
transit-audio/transit#738 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 91/100
hocinehacherouf/liberarr#78 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día