`.column-margin` content is shown in the body column, not the right margin
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 56/100
调研方向
Start by reading the comments in crates/quarto-core/src/template.rs about when q2 adds fullcontent, then trace how the template emits <body>, <main>, and .column-margin for the supplied index.qmd reproduction. Compare the generated markup with the Quarto 1 examples in the issue. Done when rendering the reproduction places the margin note beside the body text and emits the expected page and margin classes.
由索引模型根据 Issue 内容生成。
描述
This issue was written by Claude while adding q2 support to
Great Docs. The output shown comes from running each repro.
Bug description
A ::: {.column-margin} div is shown in the body column, in the flow of the text, instead of in
the right margin. The theme's CSS places .column-margin with grid-column. That only takes effect
when its parent is on the page grid, and q2 writes <main> without the page-columns page-full
classes that put it there. q2 also marks the page fullcontent, which shrinks the right margin.
According to the comments in crates/quarto-core/src/template.rs, q2 adds fullcontent when
nothing uses the right margin, and it checks only for a TOC and margin categories, not
.column-margin content.
Quarto 1 writes <main class="content page-columns page-full"> on such a page, and
no-row-height column-container on the margin div, so the body text continues beside it. It also
adds page-columns page-full to each section that holds column content.
Great Docs puts its homepage's metadata sidebar (links, authors, license) in a .column-margin div.
Under q2 it sits under the page's hero, where the body text should begin. Great Docs now adds Quarto 1's
classes in a post-render script, but only for that sidebar.
Steps to reproduce
mkdir margin && cd margin
printf 'project:\n type: website\nwebsite:\n title: Demo\n' > _quarto.yml
printf -- '---\ntitle: Margin\n---\n\nBody text.\n\n::: {.column-margin}\nMargin note.\n:::\n\nMore text.\n' > index.qmd
q2 render
grep -oE '<body[^>]*>|<main[^>]*>|<div[^>]*column-margin[^>]*>' _site/index.html
Actual behavior
With q2 0.47.0, with q2 built from main at 2355f87a2, and with the nightly
0.48.0-nightly.20261125:
<body class="fullcontent quarto-light">
<main class="content" id="quarto-document-content" tabindex="-1">
<div class="column-margin">
"Margin note." is shown between the two paragraphs, at the width of the body text.
Expected behavior
As in Quarto 1.9.37, the note is in the right margin, beside the body text:
<body class="quarto-light">
<main class="content page-columns page-full" id="quarto-document-content">
<div class="no-row-height column-margin column-container">
- 主要语言
- Rust
- 星标
- 316
- 派生
- 23
- 平均合并
- 11 小时 49 分钟
- 30 天内合并 PR
- 245
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
quarto-dev/q2 的其他 Issue
-
Heading anchor links have no icon: AnchorJS is initialised with an empty `icon`可能已有人在做 @cscheid 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
quarto-dev/q2#1419 ·
维护者通常 1 天内回复
-
bug testing windows
难度 1/5 1-3 小时 新手友好度 78/100
quarto-dev/q2#1346 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
quarto-dev/q2#1095 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 67/100
quarto-dev/q2#1418 ·
维护者通常 1 天内回复
-
bug readers-writers windows
难度 4/5 3-5 天 新手友好度 48/100
quarto-dev/q2#1416 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 82/100
BurntSushi/jiff#755 ·
维护者通常 1 天内回复
-
After the kernel is given up on, a new import leaves "Importing…" and its Cancel on the status line未关闭bug help wanted priority: low
难度 2/5 1-3 小时 新手友好度 78/100
sawhorse3d/sawhorse#163 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
MartinPTielemans/ilo#4607 ·