Skip to content

@def/@init docstrings use ```@example fences, which Documenter never executes when transcluded into a consumer's @docs block #341

Description

@ocots

What

Several docstrings in src/utils.jl and src/onepass.jl (including @def's and @init's) illustrate usage with ```@example fenced code blocks. Documenter only executes @example blocks that are written directly in the .md source file being built — one arriving inside a docstring transcluded via a @docs block is rendered as static text but never run, and DocumenterVitepress warns "un-expanded @example block encountered" whenever this happens.

Surfaced while diagnosing OptimalControl's docs/make.jl warnonly backlog (control-toolbox/OptimalControl.jl, Phase D of the documentation campaign): @def's docstring is transcluded into OptimalControl's generated api/modelling.md, producing exactly this warning. The same would happen in CTParser's own docs build wherever these docstrings are pulled via @docs, and in any other consumer.

Where

Suggested fix

Change the fence label from @example to plain julia in docstrings (keep @example/@repl for blocks written directly in .md source files, where Documenter does execute them).

🤖 Generated with Claude Code

Activity

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

Metadata

Metadata

Assignees

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