Architecture Overview
Architecture Overview
QuartoDocBuilder is designed to be modular and extensible. This document explains the internal architecture.
Core Components
1. Configuration System (config.jl)
The configuration system provides type-safe structs for all settings:
QuartoConfig- Main configuration structSectionConfig- Navbar section configurationReferenceGroup- Reference page groupingThemeConfig- Theme and appearance settingsFooterConfig- Footer customization
2. Content Selectors (selectors.jl)
Inspired by R’s pkgdown, selectors allow flexible organization of reference pages:
# Match functions by name patterns
starts_with("process_") # All functions starting with "process_"
ends_with("_util") # All functions ending with "_util"
matches(r"^get") # Regex matching
contains("helper") # Contains substring3. Docstring Processing (quarto_format.jl)
Converts Julia docstrings to Quarto-compatible markdown. The renderer is structure-agnostic — it dispatches on each Markdown node’s type — so it:
- re-fences code blocks as
julia, - demotes docstring headers by two levels,
- maps admonitions to the matching Quarto callout type,
- falls back to
Markdown.plainfor anything else.
See Docstring Processing for the full mapping.
4. Site Building (build.jl)
The main build orchestrator:
- Generates
_quarto.ymlconfiguration (including aresources: objects.inventry) - Creates section directories and index files
- Generates the reference index and a page for each documented binding
- Creates navigation structure (navbar, sidebars)
- Emits
docs/objects.invso other packages can cross-link back - Post-processes the generated pages to autolink cross-references (when
autolink = true) - Validates internal links (failing the build when
strict = true)
5. Inventories and Auto-linking (inventory.jl, autolink.jl)
Reads and writes Sphinx objects.inv inventories and turns backticked names into links — both within the package and, via registered inventories, to other packages. See Cross-package Links.
6. Articles System (articles.jl)
Discovers and organizes content files:
- Auto-discovers
.qmdfiles in section directories - Extracts titles and metadata from YAML frontmatter
- Sorts by
orderfield or alphabetically
Data Flow
┌─────────────────┐
│ QuartoConfig │
└────────┬────────┘
│
┌────────────────┼────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ _quarto.yml │ │ reference/ │ │ sections/ │
│ (navbar, │ │ (function │ │ (tutorials, │
│ sidebars) │ │ docs) │ │ guides) │
└───────────────┘ └───────────────┘ └───────────────┘
│ │ │
└────────────────┼────────────────┘
│
▼
┌─────────────────┐
│ Quarto render │
└────────┬────────┘
│
▼
┌─────────────────┐
│ HTML Site │
└─────────────────┘
Extension Points
Custom Selectors
You can create custom selector functions:
# Create a selector that matches documented functions only
my_selector = sym -> begin
obj = getfield(MyModule, sym)
return obj isa Function && hasmethod(obj, Tuple{})
endCustom Theme
Extend the theme with custom CSS/SCSS:
theme = ThemeConfig(
bootswatch = "flatly",
custom_css = """
.my-custom-class {
color: red;
}
"""
)Dependencies
QuartoDocBuilder keeps its dependency footprint small:
Markdown,REPL,TOML(Julia standard library) - docstring parsing and configurationDownloads(standard library) - fetching remoteobjects.invinventoriesCodecZlib- zlib (de)compression for theobjects.invformat
The CodecZlib and Downloads dependencies were added in 0.4.0 to support Sphinx inventories for cross-package linking.