Skip to content

Build versioned & unversioned docs at the same path depth level - #325

Merged
rich-iannone merged 11 commits into
posit-dev:mainfrom
has2k1:same-level-builddir
Aug 19, 2026
Merged

Build versioned & unversioned docs at the same path depth level#325
rich-iannone merged 11 commits into
posit-dev:mainfrom
has2k1:same-level-builddir

Conversation

@has2k1

@has2k1 has2k1 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

This PR moves versioned builds to a same-level directory layout so that every version's Quarto project sits exactly one level below the project root, and hardens the surrounding tooling against deleting or duplicating user-owned directories.

fixes #319

has2k1 added 11 commits August 18, 2026 19:12
Historical versions rewrote their Quarto configuration without the generated-file header. Readers could no longer tell that Great Docs owned the file, and cleanup could not safely identify build output.

Write the same header for every version and recognise build directories only when their Quarto configuration contains the Great Docs marker.
Versioned builds previously nested Quarto projects under an extra build directory. Relative paths that leave the staged documentation tree therefore resolved differently from non-versioned builds.

Render the latest version in great-docs/ and historical versions in sibling directories. Copy historical trees before pruning the latest tree, and report unrecognised sibling directories instead of deleting them.

A single-version build creates no sibling directory.

Fixes posit-dev#319
Historical version projects moved next to great-docs/, but cache collection still searched the old nested layout. Quarto therefore re-executed code for every historical version on every build.

Collect caches from the latest build directory and each marked historical sibling before merging them into the project cache.

Refs posit-dev#319
Historical versions now render beside great-docs/ in directories named from the documentation directory and version tag. Replace the ignore rule for the retired nested build root with a pattern that covers the new sibling directories.

Refs posit-dev#319
MCP commands still searched the retired nested directory and exposed a build log that Great Docs never created. They therefore missed previews, cleanup targets, status details, and historical output.

Find current and historical build directories in their new locations. Clean only marked historical directories, and explain that Great Docs prints build logs but does not save them.

Refs posit-dev#319
Quarto resolves an include outside the documentation tree from the staged page location. If a version project is nested at a different depth, the same include path resolves to a different file or no file.

Assert that every version stages the page at a depth where the include resolves to the original project file.

Refs posit-dev#319
Describe where Great Docs stores the latest version, historical versions, assembled site, and API cache. Explain why every Quarto project remains at the same depth and why custom includes should not depend on staged page locations.

Document the generated ignore entries and the safeguards that distinguish build output from user-owned directories.

Refs posit-dev#319
Historical freeze caches replaced whole sections, so one version could erase cached pages from another. The generated ignore rule matched nested project directories, and lint scanned staged page copies. Cleanup also removed previous version output before reporting a collision with an unmarked directory, while build-directory searches handled symlinks inconsistently.

Merge cache files individually and give the latest version precedence. Anchor the historical ignore rule to the project root, exclude top-level build copies from linting, reject symlinked build directories consistently, and validate collisions before cleanup. Document that only versions selected for the current build are recreated.

Refs posit-dev#319
Great Docs generated great-docs/ without a leading slash, so Git ignored directories with that name anywhere in the project. Substring checks could also mistake a negated nested path for the main build rule.

Write /great-docs/, compare complete lines, and migrate the old rule after the next approved update. Preserve similar patterns and leave the file unchanged when the user declines.

Refs kata 0545
Page completion returned every .qmd file in the project, including staged copies in current and historical build directories. Agents therefore saw duplicate, disposable pages and could select paths that the next build would overwrite.

Use the same top-level build-path classification for linting and page completion. Keep nested project directories with similar names in the source listing.

Refs kata nxaj
Require the complete generated header before treating a same-level
`great-docs-<tag>/` directory as build output. This keeps linting and page
completion active for similarly named user directories. It also prevents
uninstall and version cleanup from deleting those directories.

Reject symlinked historical build targets before preprocessing. This prevents
version builds from writing through a link.
@has2k1 has2k1 changed the title Same level builddir Build versioned & unversioned docs at the same path depth level Aug 19, 2026
@rich-iannone
rich-iannone self-requested a review August 19, 2026 20:53

@rich-iannone rich-iannone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@rich-iannone
rich-iannone merged commit 0b87cf7 into posit-dev:main Aug 19, 2026
8 checks passed
@has2k1
has2k1 deleted the same-level-builddir branch August 19, 2026 22:31
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.

directory (.github) missing for docs builds

2 participants