Skip to content

Scaffold defaults nest tutorials under Getting started and don't pair AD-backends with Benchmarks #354

Done

Description

@seabbs-bot

Context

EpiAware/ComposableTuringIDModels.jl#216 asked for two nav changes:
worked-example pages living under a top-level Tutorials section rather than
nested inside Getting started, and the AD-backends tutorial sitting as a
second page in a Benchmarks dropdown rather than as a standalone page.
The reviewer's own framing: "this is really a packagetools issue."

We made both changes in that repo's package-owned docs/pages.jl in the
PR closing #216, which is safe because pages.jl is written once by
scaffold and never re-applied by update.
But the shape we moved away from is the kit's own default, so every package
that accepts the scaffold default reproduces it, and every package that
later runs ad = true gets the same standalone-AD-benchmarks nav even if
it also has benchmarks = true.

This is not hypothetical: CensoredDistributions.jl's current
docs/pages.jl has the same shape, three levels deep — "Getting
started" > "Tutorials" > "Composing and fitting" >
"Automatic differentiation backends", and a sibling "Case studies and
applications" group nested at the same depth.

What the kit currently defaults to

  1. templates/docs/pages.jl nests all tutorial-shaped content inside one
    "Getting started" group:

    "Getting started" => [
        "Overview" => "getting-started/index.md"{{AD_TUTORIALS_NAV}}
    ],
  2. _ad_tutorials_nav (src/scaffold.jl) renders the ad = true
    substitution as a "Tutorials" list nested inside that "Getting
    started" group:

    "Tutorials" => [
        "Automatic differentiation backends" =>
            "getting-started/tutorials/ad-backends.md"
    ]
  3. Independently, the benchmarks = true substitution
    (bench_nav in _apply, src/scaffold.jl) adds a separate,
    flat, top-level entry:

    "Benchmarks" => "benchmarks.md"

    With both ad = true and benchmarks = true (a common combination),
    a package ends up with the AD-backends benchmark buried under
    Getting started > Tutorials, and a disconnected top-level Benchmarks
    page that doesn't mention it.

What we'd like the default to become

  • A pages.jl template that gives a scaffolded package a top-level
    Tutorials section (not nested inside Getting started), or keeps
    Getting started as the single overview/installation page it already
    is for a package with no tutorials of its own and stops nesting future
    tutorial content under it. Either shape is fine as long as it's
    applied consistently; ComposableTuringIDModels.jl already flattens
    Getting started into standalone "Installation" / "Overview" top-level
    pages and adds a sibling top-level "Tutorials" section, if that's a
    useful reference.

  • When ad = true and benchmarks = true together, default the
    AD-backends page into the Benchmarks dropdown as a second page instead
    of a separate Tutorials entry, e.g.:

    "Benchmarks" => [
        "Overview" => "benchmarks.md",
        "Automatic differentiation" =>
            "getting-started/tutorials/ad-backends.md"
    ]

    _default_tutorials_subdir already reads TUTORIALS_SUBDIR from the
    package's own docs_config.jl at update time, so the AD-backends
    page's physical path does not need to change for this — only the nav
    fragment that groups it.

One implementation note

_strip_benchmark_nav (src/docs_build.jl) removes a ... => "benchmarks.md" leaf when BENCHMARK_PAGE = false, but unlike
_strip_extensions_nav it does not drop a group left with only one
child. If the Benchmarks entry becomes a two-page dropdown by default,
a package with ad = true, benchmarks = false would end up with a
"Benchmarks" dropdown containing only "Automatic differentiation" and no
overview page — not wrong, just worth deciding on deliberately rather
than by omission.

Scope

This is nav-template and default-substitution work in
templates/docs/pages.jl and the _ad_tutorials_nav / bench_nav
helpers in src/scaffold.jl (and, if the Benchmarks dropdown default
changes, the _strip_benchmark_nav note above) — no changes needed to
ComposableTuringIDModels.jl's docs, since its pages.jl /
docs_config.jl are package-owned and already carry the shape we're
asking for as a default here.

This was opened by a bot. Please ping @seabbs for any questions.

Activity

  1. seabbs-bot commented on Aug 3, 2026

    @seabbs-bot
    CollaboratorAuthor

    Linked from EpiAware/ComposableTuringIDModels.jl#229, which does the package-owned nav restructuring in that repo directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions