Skip to content

refactor: move code includes, front matter edits and page naming out of GreatDocs - #488

Merged
has2k1 merged 5 commits into
mainfrom
refactor/content-helpers
Oct 31, 2026
Merged

has2k1 merged 5 commits into
mainfrom
refactor/content-helpers

Conversation

@has2k1

@has2k1 has2k1 commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

This PR moves code-include expansion, front matter option edits and the rules that name published pages and their fallback titles out of GreatDocs into a content package that the page copiers share.

The naming rules existed as several inline copies that had drifted apart. Section and blog pages without a title kept underscores (my_file.qmd showed as "My_File") where the rest of the site showed "My File", and the User Guide navbar link pointed at a missing page when the guide's first page sat in a numbered subdirectory or the guide was listed explicitly. Two other bugs went with the move: a malformed lines= in a code include stopped the guide copy without naming the file, and setting a page option on a page whose front matter value contains --- corrupted the page.

…t of `GreatDocs`

Code include expansion, front matter option updates, reserved directory checks and
published naming now live in modules outside `GreatDocs`. Page copiers call these
operations, and later copying modules can reuse them without depending on the class.

Fallback titles and published paths without numeric prefixes now each follow one
shared rule wherever the existing copies agreed. The copies that disagree change
in the commits that follow.

Builds are unchanged: the Quarto project diff against main matches in all 40 cases.
A page without a title in its front matter is titled after its file name. Section
and blog pages kept underscores in that title, so `my_file.qmd` showed as "My_File"
in a section's sidebar and index cards, while the tags index, custom pages and the
user guide showed "My File". Every fallback title now follows the rule the tags
index, custom pages and the user guide already used: dashes and underscores become
spaces. A section page's title also drops only the final suffix, not every `.qmd`
or `.md` in its name.

Blog fallback titles are used only to count posts, so only section pages show a
changed title. The Quarto project diff against main matches in all 40 cases, and
in all 329 cases of the full catalogue: no Gauntlet page relies on the fallback.
Without an `index.qmd`, the User Guide navbar link targets the guide's first page.
The link stripped the numeric prefix from that page's file name only. Guide pages
are published with prefixes stripped from every path component in auto-discovery
mode and with names unchanged in an explicit guide. A first page at
`01-basics/02-setup.qmd` was linked as `user-guide/01-basics/setup.qmd` but written
to `user-guide/basics/setup.qmd`, and the explicit guide's `01-intro.qmd` was linked
as `user-guide/intro.qmd`. Both links led to missing pages. The link now uses the
published guide path.

The Quarto project diff against main matches in all 40 cases, and in all 329 cases
of the full catalogue: no first guide page has a path where the two rules disagree.
A `lines=` value that is neither a line number nor two numbers joined by `-`, such
as `lines="a-b"`, raised an error that stopped copying the user guide, section or
blog part-way. The build then reported only that the step failed, without naming
the page or the include. The include is now replaced by an HTML comment that quotes
the value and names the included file, and copying continues. Missing files already
produce an HTML comment in this format.

The Quarto project diff against main matches in all 40 cases.
…option

When setting an option such as `bread-crumbs`, `toc` or `body-classes` in a user guide,
blog index or blended homepage, the build split the page at the first two occurrences
of `---` anywhere. A front matter value containing `---`, such as `title: A---B`, ended
the block early and corrupted the page. The block now ends at the first line that
starts with `---`, matching the build's front matter reader. The page's other lines
keep their text.

Other places that edit front matter by splitting on `---` are unchanged.

The Quarto project diff against main matches in all 40 cases. Across the pages in
`docs/` and the rendered Gauntlet sites, the old and new edits differ only on one
rendered page whose front matter quotes `# ---`.
@has2k1
has2k1 added this pull request to stack #491 October 31, 2026 03:01
@github-actions

Copy link
Copy Markdown

📚 Preview this PR's docs locally

Fetch the just-built site and open it in your browser:

# this exact build
great-docs preview --run 41162487593

# or always the latest build for this PR
great-docs preview --pr 488
Auth & tips
  • Requires great-docs: pip install great-docs (or run via pipx/uvx).
  • Auth: run gh auth login then add --use-gh, or set GITHUB_TOKEN (needs Actions: read).
  • Jump to a page: add --path reference/index.html.
  • Latest vs exact: --pr <n> grabs the newest build; --run <id> pins this one.
  • Re-download: --refresh ignores the local cache.

@has2k1
has2k1 merged commit aaec2e0 into main Oct 31, 2026
9 checks passed
@has2k1
has2k1 deleted the refactor/content-helpers branch October 31, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant