Repository navigation
docs(modelling): make abstract-syntax.md executable (Phase E1) - #913
Merged
Merged
Conversation
Convert the 30 non-notation ```julia fences to executed blocks: 27 @example + 7 @repl sharing one `abs` module, complete models with the off-topic clauses under `# hide`. The 11 `:( … )` grammar patterns stay inert, covered by one opening note. Fixes three latent bugs the inert fences hid: ∫(e)² (Julia ParseError), ω² read as a free symbol, u(t)^2 on a 2-vector control. Error cases use the try/catch + showerror idiom. Voice: her/the user → you/your. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
docs/src/modelling/abstract-syntax.md— the most visited page of the site — described thewhole
@defgrammar but nothing on it was verified by the build: 0@example, 41 inert```julia fences (the campaign count of 37 missed 4 fences indented inside
!!! warningadmonitions), 4 `@repl`. Every fragment could be wrong and CI would stay green. The blocker
was mechanical: the `...` idiom inherited from `docs/attic/` left every `@def` incomplete,
and `@def` validates at build time.
This is Phase E1 of the documentation campaign.
Changes (documentation only — no API change)
@example+ 7@repl, all sharing one@setup absmodule (using OptimalControl+ two stubs,data(t)andc(t)).@def, the off-topic clauses carry# hide, block endsnothing # hide— the reader sees only the taught clause.@repl+try # hide/catch e # hide/showerror(IOContext(stdout, :color => false), e) # hide/end # hide— renders a cleanREPL[1]box, nostacktrace, no path leak.
:( … )grammar patterns stay inert, covered by one opening!!! note— they areExprtemplates with$-placeholders, not runnable code.∫(x(t) - data(t))² → minParseError: identifier cannot begin with character '²'∫((x(t) - data(t))^2) → min-ω²*q(t),ω² → min(ω is 1-D)@defkeepsω²as a free undefined symbol; breaks at solve-ω^2*q(t),ω^2 → minu ∈ R², control+c(t) * u(t)^2MethodError: no method matching ^(::Vector{Float64}, ::Int64)u ∈ R, controlacross the Bolza section (matches the Lagrange section above)her/the user→you/your(4 sites); fixed a copy-paste "state" → "control"in the control-aliases sentence.
Verification
Full docs build (
julia --project=. docs/make.jl) run twice, exit 0, nofailed to run,every
@defon the page executed. The only warnings are the pre-existingwarnonlyexternal-link ones (Phase D backlog). Add the
run documentationlabel to build the site inCI.
Follow-ups (recorded in
.reports/campaign/)x(0) == v(bounddepending on the variable) reports a leaked-gensym
UndefVarErrorinstead of a clearmessage;
@def … end truetrace mode prints the parsed model twice.VitePress code features (
[!code ++/--/highlight], focus, code groups) — static fencesonly, since they do not work inside executed
@exampleblocks.🤖 Generated with Claude Code