A page that fails to parse is left out of a website render, links to it break, and `post-render` doesn't run
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- build-system, cli
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Rust
- Star
- 302
- Fork
- 22
- Merge trung bình
- 5 giờ 2 phút
- Pull request đã merge (30 ngày)
- 213
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quarto-dev/q2
-
`dir: rtl` isn't written to `<html>` in HTML outputCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/q2#1219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
quarto-dev/q2#1188 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
quarto-dev/q2#1179 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
quarto-dev/q2#1133 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
quarto-dev/q2#1103 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của quarto-dev/q2
Issue tương tự
-
bug image layout P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày