Building & Previewing
The great-docs build command is the main way you interact with Great Docs on a day-to-day basis. It reads your great-docs.yml configuration, discovers your packageβs API, generates Quarto source files, and renders everything into a static HTML site. This page explains what happens during a build, how to preview your site locally, and how to troubleshoot common issues.
The Build Pipeline
When you run great-docs build, the following steps execute in order:
The
great-docs/output directory is created (or refreshed) with all required assets: stylesheets, JavaScript files for dark mode toggling, sidebar filtering, the GitHub stars widget, and other interactive features.Your
great-docs.ymlis read. A_quarto.ymlfile is generated (or updated) in the output directory with the Quarto project configuration, including navbar links, sidebar structure, and theme settings.A landing page (
index.qmd) is generated from your projectβsREADME.md. If you have a logo configured, a hero section with the logo, package name, tagline, and badges is added automatically.If a user guide directory exists (by default
user_guide/), all.qmdfiles are copied into the output directory with numeric prefixes stripped from filenames. The sidebar is organized byguide-sectionfrontmatter metadata.If Click CLI documentation is enabled, Great Docs discovers your CLI commands and generates a reference page for each one.
Custom sections defined in
great-docs.yml(examples, tutorials, blog posts, etc.) are processed and copied to the output directory.If the changelog is enabled and a GitHub repository URL exists in
pyproject.toml, GitHub Releases are fetched and achangelog.qmdfile is generated.The Agent Skills file (
skill.md) is generated or copied. If you have a curatedSKILL.mdinskills/<package-name>/, it is used directly. Otherwise, a skill file is auto-generated from your package metadata.llms.txtandllms-full.txtfiles are generated. These provide AI-friendly summaries of your package documentation.Source link metadata (
_source_links.json) is generated, mapping each documented symbol to its file and line numbers on GitHub.Quarto renders all the source files into HTML. A post-render script runs to apply final transformations: injecting source links, processing cross-references (GDLS), cleaning up Sphinx/RST artifacts, and generating companion Markdown (
.md) files for each page.
After all steps complete, the finished site is in great-docs/_site/.
Preview Mode
To view your site locally with live reload:
Terminal
great-docs previewThis starts a local development server and opens your default browser. When you edit source files (user guide pages, docstrings, configuration), the site rebuilds automatically and the browser refreshes to show your changes.
Preview mode is ideal during the writing process because it lets you see how content will look in the final rendered site without committing or deploying anything.
Build Options
The great-docs build command accepts several options that control its behavior.
Watch Mode
Watch mode keeps the build process running and automatically rebuilds when files change. This is similar to preview mode but without starting a local server:
Terminal
great-docs build --watchThis is useful when you want to rebuild continuously but view the output in a different way (for example, opening the HTML files directly or using a separate static file server).
Clean Build
If you suspect stale files in the output directory are causing issues, you can force a completely fresh build. Delete the great-docs/ directory and rebuild:
Terminal
rm -rf great-docs/ && great-docs buildSince the great-docs/ directory is ephemeral and fully generated from great-docs.yml plus your source files, deleting it is always safe.
Build Output Structure
After a successful build, the output directory has this layout:
great-docs/
great-docs/
βββ _quarto.yml # Generated Quarto config
βββ index.qmd # Landing page
βββ great-docs.scss # Theme stylesheet
βββ *.js # Interactive features (dark mode, sidebar, etc.)
βββ llms.txt # LLM-friendly summary
βββ llms-full.txt # Full API docs for LLMs
βββ skill.md # Agent Skills file
βββ _source_links.json # GitHub source link metadata
βββ reference/ # API reference pages
β βββ index.qmd
β βββ MyClass.qmd
β βββ ...
βββ user-guide/ # User guide pages (from user_guide/)
βββ recipes/ # Recipe pages (from recipes/)
βββ scripts/
β βββ post-render.py # HTML post-processing script
βββ _site/ # Final rendered HTML
βββ index.html
βββ ...The _site/ subdirectory contains the final HTML output. This is the directory you deploy to your hosting service (GitHub Pages, Netlify, Vercel, etc.).
Everything outside of _site/ is intermediate Quarto source. You generally do not need to inspect these files, but they can be useful for debugging rendering issues.
Using the Python API
In addition to the CLI, you can drive the build programmatically:
Python
from great_docs import GreatDocs
docs = GreatDocs()
docs.install() # Initialize the output directory
docs.build() # Run the full build pipeline
docs.preview() # Start the preview serverThe GreatDocs class accepts a project_path argument if your working directory is not the project root:
Python
docs = GreatDocs(project_path="/path/to/my-project")
docs.install()
docs.build()Troubleshooting
Quarto Errors
If the build fails during the Quarto rendering step, the error output will include Quartoβs own messages. Common causes include:
- A
.qmdfile with invalid YAML frontmatter. Check that all frontmatter blocks are enclosed between---markers and that the YAML is well-formed. - A reference to a file that does not exist. If you renamed or deleted a user guide page, make sure the
guide-sectionfrontmatter in other files does not depend on it. - A Quarto version incompatibility. Great Docs is tested with Quarto 1.4 and later. Run
quarto --versionto check your installed version.
Missing API Reference Pages
If some symbols are missing from the rendered API reference, run great-docs scan to see what Great Docs discovers. Items that appear in the scan output but not in the reference may be excluded by the exclude list in great-docs.yml or may not be listed in the reference config sections.
Dynamic Introspection Failures
If Great Docs reports an error during dynamic introspection, it will automatically retry with static analysis. If you see this retry message frequently, you can set dynamic: false in great-docs.yml to skip the dynamic pass entirely. See Configuration for details.
Stale Output
If your site looks correct in some places but outdated in others, the most reliable fix is a clean rebuild: delete the great-docs/ directory and run great-docs build again. The output directory is fully regenerated each time, so there is no risk in deleting it.
Next Steps
- Deployment covers publishing your built site to GitHub Pages
- Configuration covers all
great-docs.ymloptions - Link Checker explains how to validate links across your site