📖 [Docs]: Markdown object model specified as a section tree - #33
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Drop the front matter title so the H1 is the only document title, tighten the requirement anchors to the form markdownlint recognises, and capitalise Markdown in prose. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
markdownlint's default MD025 pattern counts a front matter title as a top-level heading, so a capability document could not carry both. Configure front_matter_title as empty and restore the title the mkdocs navigation reads. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
No Significant Changes DetectedThis PR does not contain changes to files that would trigger a new release:
Build, test, and publish stages will be skipped for this PR. If you believe this is incorrect, please verify that your changes are in the correct locations. |
Super-linter summary
All files and directories linted successfully For more information, see the GitHub Actions workflow run Powered by Super-linter |
The Markdown module now has a written, normative contract for the object model a Markdown document parses into — and that model is organised the way a document actually reads: a document holds a tree of sections, and a section owns its heading, its own content, and the sections nested inside it, recursively. Nothing in the module behaves differently yet. This is documentation of the intended state, published before the code exists so that anyone who will depend on the model can read it, disagree with it, and shape it while that is still free.
New: The Markdown object model is documented as a capability
docs/markdown-object-model/holds the capability in three documents side by side —index.mdintroduces it and shows the shape at a glance,spec.mdstates why the model exists and what it must do, anddesign.mdexplains how it is built. The spec is normative and testable: thirteen functional requirements and three non-functional ones, each individually addressable, acceptance criteria written as scenarios, and CommonMark conformance measured against the specification's own published example set rather than against hand-picked samples.New: Sections are the unit the model is built around
The spec settles the questions that decide what working with a parsed document feels like. A section owns the content that follows its heading up to the next heading of the same or a lower level. A section with no subsections is the same type as one that has them, holding an empty collection — there is no separate leaf type to branch on. The document is the same kind of container as a section, minus a heading and plus the metadata part, so content before the first heading belongs to the document and the same code walks both. A heading inside a block quote or a list item sections that container and leaves the document's outline alone. A skipped heading level nests without inventing a section that is not in the document, and every heading re-renders at its original level.
New: What the model will not do is stated as plainly as what it will
Byte-exact round-tripping is a non-goal — the model preserves the stylistic choices a reader would notice and normalises the rest. Rendering to formats other than Markdown is a non-goal, because the model is plain data that any general-purpose serializer can already take somewhere else. Replacing the composition DSL is a non-goal:
Set-Markdown*stays the way Markdown is written from nothing, and the object model is how existing Markdown is read and changed. The existing DSL keeps working unchanged, as a requirement rather than a promise.Technical details
docs/markdown-object-model/spec.mdanddocs/markdown-object-model/index.md).design.mdis added alongside them because the Documentation Model pairs a spec with a design in the same capability folder. The Model, Parser and renderer, Tests, and Documentation tasks in that plan remain open..github/linters/.markdown-lint.ymlgains anMD025entry withfront_matter_title: "". markdownlint's default pattern counts a front mattertitleas a top-level heading, so a document could not carry both the title mkdocs navigation reads and theH1GitHub renders. The setting is tightly coupled to these documents — the capability folder cannot exist without it — so it lands here rather than separately. The identical gap in the inherited baseline is tracked as Allow a body heading alongside the front matter title in the markdown linter config Template-PSModule#38..github/linters/required it: the requirement anchors were tightened from{ #fr1 }to{#fr1}, which is the form MD051 recognises and Python-Markdown'sattr_liststill accepts, andmarkdownwas capitalised in prose to match theMarkdownterminology term in.textlintrcand the existing README. The Specification template these documents follow still shows the spaced form, tracked as Use unspaced requirement anchors in the specification template MSXOrg/docs#141, so these files are ahead of the standard rather than departing from it. Verified locally withmarkdownlint-cli2andtextlintrun against those exact config files; both are clean.docs/folder is not published to GitHub Pages today: the site is assembled from generated function help,src/en-USabout topics,README.md, and the icon, andStructure-Site/src/main.ps1copies nothing else. These pages are therefore read in the repository, and the{#fr1}anchors stay inert until mkdocs renders them. Tracked as Publish hand-authored documentation from a repository's docs folder Process-PSModule#437.NoReleaselabel entirely, even though.github/release.ymlalready excludesNoReleasefrom generated release notes — so that exclusion could never fire, and every documentation and maintenance pull request has been landing under "Other Changes". A sweep of the organization found 58 repositories referencingNoReleaseinrelease.ymland this one as the only one without the label. The label now exists and is applied here alongsidedocumentation, which makes both correct. The change also touches no important file pattern (^src/,^README\.md$), so no release is produced either way.docs/**(Markdown).github/linters/.markdown-lint.yml,.github/linters/.textlintrc.github/linters/**Relevant issues (or links)