Repository navigation
feat(docplan): headings in markup bodies open sections - #1477
devin-ai-integration[bot] wants to merge 3 commits into
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…model-surfaces-refresh Co-Authored-By: jason.han <hanhuijun@gmail.com>
…e-bodies Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/manual/authoring.md # docs/project/api-json-differential-baseline.json # docs/project/api-json-differential.md # docs/reference/diagnostics.md # mkdocs.yml
|
The two red race shards on 3c23d07 were develop's: |
…e-bodies Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/api-json-differential-baseline.json # docs/project/api-json-differential.md
…e-bodies Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/manual/authoring.md # docs/project/api-json-differential-baseline.json # docs/project/api-json-differential.md
|
Closing: this branch's feature head |
What and why
A
rep language "markdown"/"asciidoc"body in aDocumentorSectioncan now carry a whole document outline: Markdown ATX and setext headings (#…######) and AsciiDoc section titles (==…) openContentSectionnodes nested by level, in place among the sibling parts, with the following blocks as their children. Before this, headings were refused and an author needed apart : Section { :>> title = …; }per heading (the gap left by #1453 and #1454 for issue #1309).Section, its subsections). A heading that skips a level or rises above the first heading's level is the newdocument-plan-markup-heading-levelplanning error (named rather than folded intounsupported-markup-construct, since the construct is supported and the message names the heading, its level and the levels allowed). A heading in apart : Paragraphbody staysmarkup-body-not-paragraph.part : Sectionafter it is a sibling of the body's top-level sections, in declaration order; a body in a section nests below it.[[id]]/[#id]on the title names the section — kept as written when it is a basic name ([[MassBudget]]→MassBudget), slugged otherwise ([[mass-budget]]→mass_budget). Markdown{#id}is not CommonMark and is not added; Asciidoctor's automatic ids are switched off withsectids!. Without an id the name is a slug of the title: lower-cased, every run of characters that are not letters or digits one underscore, trimmed,_ahead of a leading digit. Names are unique within the document: a name already taken by a content part or an earlier heading gets the first free_2,_3… suffix in body order; an explicit id spelt like an earlier heading's name does not take that name over, and a repeated id keeps naming its first heading.[](sysml:<name>),sysml:ref[<name>]and<<name>>in the same document, andsysml:<DocumentDef>::<name>/sysml:<documentUsage>::<name>from another one. Model resolution runs first; only a target no element answers to falls back to the headings, so no existing reference changes meaning. The fallback matches the allocated name or an explicit id exactly as written (<<mass-budget>>orsysml:ref['mass-budget']finds[[mass-budget]]), never a normalised form of an arbitrary expression; a document usage typed by more than one document isambiguous-ref-target, as for a part. The anchor is the section's path (overview-mass_budget), cross-document anchors included.ContentSectionpipeline, so numbering, tables of contents and title pages (-doc-number-sections,-doc-toc,-doc-title-page) number them exactly as part-born ones in Markdown, HTML and PDF.Converter change:
scripts/asciidoc/asciidoctor-json.jsserialises sections (level,id, titleruns,blocks); the Go decoder flattens that tree into body order. Recorded fixturesmarkup/testdata/asciidoc_sections.{adoc,json}andasciidoc_anchors.{adoc,json}andasciidoc_aliases.{adoc,json}were recorded with the pinned Asciidoctor.js; theInstalledtest replays every recording against the installed converter.Docs:
docs/manual/authoring.md(headings open sections, levels, derived names and collisions, referencing, interleaving, the AsciiDoc anchor rule), worked exampledocs/manual/examples/whole-document.{sysml,md}, and the self-model's Documents and views section now ends in one body whose headings are subsections. The vendoredDocumentQueries.sysmlis untouched; if itsSectiondoc comment is to mention this, a sentence such as "A section is also opened by a heading in a Markdown or AsciiDoc textual representation owned by a Document or Section" would do.Stacked on #1454 until it merged; now based on
developwithorigin/developmerged in (merge commits, no rebase). #1476 (inline model values,sysml:value) touched the same markup files and has merged too: both changes were additive (hereBlockHeading,markup_sections.go,Run.refName/refNameDoc, one newErrorKind), and the merge conflicted only indocs/manual/authoring.md, the mkdocs navigation, the generateddocs/reference/diagnostics.md(regenerated withmake diagnostics-catalogue) and the API-JSON baseline, re-recorded over the merged tree together with the pilot-differential baseline andmake docs-counts. The provenance records move by digests, line numbers and the one new manual example; no verdict flips.Every change above is already in
develop: #1502 merged this branch's head2672d357cinto its own branch and landed asce7c0b1c6, so after mergingorigin/develop(ab1a9cf9a) this branch's tree is identical todevelopand the pull request's diff is empty.Specification basis
KerML 1.0 §8.3.2.3.6 (TextualRepresentation): the body is the element represented in another language; its interpretation is the tool's. No
docs/project/spec-compliance.mdrow moves.How it was verified
internal/ir/docplan/markup: ATX/setext heading levels and spans, styled titles flattened, links/references/formulas in a heading refused; AsciiDoc sections, levels and explicit ids via the recorded fixture and the installed converter.internal/ir/docplan: nesting, level errors (skip, rise above base, across two bodies), slug and collision naming, same- and cross-document references, interleaving with parts, paragraph-body refusal, AsciiDoc outline with[[id]]/[#id]and<<id>>, explicit ids kept as written or slugged and referenced by either spelling, an ambiguous document usage ahead of a heading name.internal/doc/docir: evaluated sections, anchors on referenced ones, cross-document anchors viaEvaluateLinked.internal/doc/docrender: Markdown golden and numbered HTML golden (title page, TOC,1,1.1,1.2.1,3.1);internal/doc/docpdf: numbered PDF text with WeasyPrint and pandoc;cmd/sysml: all forms with the numbering flags, the level error at the CLI, and the manual example end to end.go build ./...,go vet ./...,gofmt -l .empty,make lint, race tests over the touched trees and./tests/...,make wasm-check(budget unchanged),make docs-check,make diagnostics-check,python3 scripts/changelog.py check, corpus gates with the download scripts.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/1ea3fb53a1634aa89395950ee61fd478
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/1ea3fb53a1634aa89395950ee61fd478?variant=devin
Requested by: @HuiJun