`.column-margin` content is shown in the body column, not the right margin

Đang mở
#1,371 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
56/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
css, html, rust
Lĩnh vực
frontend, web-dev

Hướng nghiên cứu

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.

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

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">
Ngôn ngữ chính
Rust
Star
316
Fork
23
Merge trung bình
11 giờ 49 phút
Pull request đã merge (30 ngày)
245

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của quarto-dev/q2

Tất cả issue của quarto-dev/q2

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.