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

オープン
#1,371 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
56/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
css, html, rust
領域
frontend, web-dev

調査の方向性

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分
マージ済み PR(30日)
245

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/q2 のほかの issue

quarto-dev/q2 の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。