Skip to content

Documentation layout ​

This page is for maintainers laying out a package's docs. Every package that adopts the kit gets the same documentation skeleton, so a reader who knows one EpiAware package's docs can find their way around another's.

The top-level groups ​

GroupHoldsFolder under docs/srcNamed in docs_config.jl by
HomeThe READMEindex.md (generated)
TutorialsAn overview page, then sub-groupstutorials/TUTORIALS
How-to guidesTask pages and the FAQhow-to/HOW_TO_GUIDES
ExplanationConcept pagesexplanation/EXPLANATION
ReferenceAPI reference, extensions, bibliographyreference/REFERENCE
BenchmarksPerformance over time, AD comparison, package pagesbenchmarks/BENCHMARK_PAGES
DevelopmentOverview, contributing and release process (seeded), then a package pagedeveloper/DEVELOPMENT_EXTEND_PAGE, DEVELOPMENT_OWNED_PAGES
Release notesThe published GitHub releasesrelease-notes.md (generated)

You name your pages in docs/docs_config.jl. update regenerates the managed docs/pages.jl from it, with fixed labels, order and folders. Name each page relative to its group's folder, so "FAQ" => "faq.md" in HOW_TO_GUIDES is docs/src/how-to/faq.md. Empty groups are left out.

Extra groups and generated pages

PACKAGE_SECTIONS adds whole groups for anything outside the skeleton, after Benchmarks and before Development.

Reference opens with the generated Public API and Internal API pages, then one Extensions entry per declared extension. These stay at lib/public.md, lib/internals.md and extensions/, so their addresses do not change. Benchmarks opens with the kit's own pages, then the package's.

Tutorials ​

Each sub-folder of docs/src/tutorials/ is a sidebar sub-group, with getting-started/ first. The overview page tutorials/index.md is seeded as the quickstart.

julia
const TUTORIALS_SUBDIR = "tutorials"

const TUTORIALS = [
    "Getting started" => [
        "A first model" => "getting-started/first-model.md",
    ],
    "Transmission" => [
        "Renewal then delay" => "transmission/renewal-then-delay.md",
    ],
]

const HEAVY_TUTORIALS = ["transmission/renewal-then-delay.jl"]

Every path is relative to the tutorials folder, in TUTORIALS and in the source lists such as HEAVY_TUTORIALS.

Literate sources

A tutorial page can be written by hand or generated from a Literate source beside it. The build finds Literate sources recursively and renders each page next to its source. The lists that name sources by relative path are LIGHT_TUTORIALS, HEAVY_TUTORIALS, FORCE_STUB_TUTORIALS, TUTORIAL_ENVIRONMENTS, and the .md form in TUTORIAL_STUBS. The build warns about a source no list registers. The managed .gitignore names each registered tutorial's rendered page, so hand-written pages in the same folders stay tracked.

Moving an existing package ​

update never moves your pages. A package on the earlier layout (tutorials in getting-started/tutorials/, PACKAGE_TUTORIALS or GETTING_STARTED_FAQ in its config) keeps building, and update warns with what to move. Do the moves, then update links to the old paths, such as docs URLs in the README and the keys of INDEX_REWRITES. The warning stops once nothing is left.

What the warning lists
  • Files to move, such as getting-started/index.md to tutorials/index.md, and each tutorial into a sub-folder named after its sub-group.

  • The TUTORIALS and HOW_TO_GUIDES to write in place of PACKAGE_TUTORIALS and GETTING_STARTED_FAQ.

  • Tutorial sources to re-key by their new relative paths.

  • Any PACKAGE_SECTIONS whose pages all sit in a standard group's folder, with the constant to move them to.

Until then the regenerated pages.jl uses the new groups and names the pages at their current paths.

Checking a package's docs ​

test_docs_layout checks the skeleton, that every page in the navigation exists, and that every Literate source is registered and in the navigation. It is opt-in, so call it from your own tests.

julia
test_docs_layout(pkgdir(MyPackage))

test_docs_pages_in_sync checks that docs/pages.jl matches what update would write from docs/docs_config.jl. The managed quality testset runs it. If it fails, run EpiAwarePackageTools.update(".") and commit the new docs/pages.jl.

Why and how to switch it off

Without this check, a page added to the config between syncs is missing from the sidebar until the next sync. Switch it off with docs_pages_in_sync = false in qa_config.jl. A package-owned docs/pages.jl, without the managed header, is skipped.