Skip to content

Add bold/italic emphasis and code-fence language support for XML doc, Doxygen (C++/VHDL) - #63

Merged
Malcolmnixon merged 3 commits into
mainfrom
feature/doc-emphasis-and-fence-language
Nov 5, 2026
Merged

Malcolmnixon merged 3 commits into
mainfrom
feature/doc-emphasis-and-fence-language

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

Converts emphasis (/, \b/\em/\e/\a/\c/\p) in C# XML docs, C++ Doxygen and VHDL comments to Markdown, and tags fenced code blocks with a language (lang/language attribute, csharp/cpp/vhdl defaults).

… Doxygen (C++/VHDL)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 5, 2026 06:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Three moderate issues remain: nested same-family tags are mismatched, nested mixed emphasis can lose styling, and the Clang test guard does not match parser discovery behavior.

3 open issues
What changed in this PR

This pull request adds Markdown emphasis conversion and language-aware fenced code blocks across .NET XML documentation, C++/Doxygen, and VHDL documentation processing. It also updates emitters, tests, requirements, design documentation, verification records, and user guides.

Changes:

  • Converts emphasis syntax to Markdown bold, italic, and inline-code spans.
  • Adds sanitized language hints and defaults for fenced code blocks.
  • Extends parser models and C++ emitters to propagate example languages.
  • Adds tests and updates related project documentation.

This pull request requires changes.

File Summary
test/​ApiMark.Vhdl.Tests/​VhdlAstParserTests.cs Tests VHDL emphasis conversion and language-tagged fences.
test/​ApiMark.DotNet.Tests/​XmlDocReaderTests.cs Tests XML emphasis rendering and code-language handling.
test/​ApiMark.Cpp.Tests/​ClangAstParserTests.cs Tests C++ emphasis, code hints, and clang-path discovery.
src/​ApiMark.Vhdl/​VhdlAst/​VhdlAstParser.cs Converts VHDL emphasis and adds language hints to fences.
src/​ApiMark.DotNet/​XmlDocReader.cs Renders XML emphasis and language-aware fenced code blocks.
src/​ApiMark.Cpp/​CppEmitterSingleFile.cs Emits C++ examples using their parsed language.
src/​ApiMark.Cpp/​CppEmitterGradualDisclosure.cs Propagates example languages through gradual-disclosure output.
src/​ApiMark.Cpp/​CppEmitter.cs Provides C++ example-language access.
src/​ApiMark.Cpp/​CppAst/​CppAstModel.cs Adds ExampleLanguage to C++ documentation models.
src/​ApiMark.Cpp/​CppAst/​ClangAstParser.cs Converts C++ emphasis and extracts sanitized code languages.
docs/​verification/​api-mark-vhdl/​vhdl-ast-parser.md Records VHDL emphasis and fence-language verification scenarios.
docs/​verification/​api-mark-dot-net/​xml-doc-reader.md Records XML emphasis and code-language verification scenarios.
docs/​verification/​api-mark-cpp/​clang-ast-parser.md Records C++ emphasis and code-language verification scenarios.
docs/​user_guide/​vhdl.md Documents VHDL emphasis syntax and code-fence languages.
docs/​user_guide/​dotnet.md Documents XML emphasis elements and code-language attributes.
docs/​user_guide/​cpp.md Documents Doxygen emphasis commands and language hints.
docs/​reqstream/​api-mark-vhdl/​vhdl-ast-parser.yaml Adds VHDL requirements for emphasis and code languages.
docs/​reqstream/​api-mark-dot-net/​xml-doc-reader.yaml Adds .NET requirements for emphasis and code languages.
docs/​reqstream/​api-mark-cpp/​clang-ast-parser.yaml Adds C++ requirements for emphasis and code languages.
docs/​design/​api-mark-vhdl/​vhdl-ast-parser.md Describes VHDL emphasis and fence conversion design.
docs/​design/​api-mark-dot-net/​xml-doc-reader.md Describes XML emphasis and code-language rendering design.
docs/​design/​api-mark-cpp/​clang-ast-parser.md Describes C++ comment rendering and code-language extraction.

Review effort: Lite

Comment thread src/ApiMark.DotNet/XmlDocReader.cs Resolved
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 5, 2026 07:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Active correctness, API-compatibility, rendering, test-alignment, and documentation issues remain unresolved, including a critical public constructor/deconstruction break and multiple nesting-handling defects.

4 open issues
1 previously missed issue

In code that hasn't changed since last review

Low severity Document that unterminated emphasis markers are removed

docs/​design/​api-mark-cpp/​clang-ast-parser.md:134

This design description says unclosed HTML emphasis tags are “closed at the end,” but the implementation removes their opening markers in CloseUnterminatedTags, so the content is emitted without emphasis (as the new unclosed bold assertion expects). Please describe the actual behavior to avoid documenting a closing marker that is never emitted.

Review effort: Lite

Comment thread src/ApiMark.Cpp/CppAst/CppAstModel.cs Resolved
…hape

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings November 5, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A moderate active finding remains because the parser mishandles multi-backtick code spans and can incorrectly convert commands inside them.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Preserve commands inside multi-backtick code spans

src/​ApiMark.Vhdl/​VhdlAst/​VhdlAstParser.cs:20

CodeSpanRegex only recognizes spans delimited by exactly one backtick. Markdown also permits multi-backtick delimiters, so text such as @b kept is split into empty one-backtick segments and the @b inside the code span is converted to emphasis. That violates the documented guarantee that commands inside backtick spans remain untouched; the span parser needs to preserve variable-length backtick delimiters.

4 resolved since last review

Review effort: Lite

@Malcolmnixon
Malcolmnixon merged commit ed87716 into main Nov 5, 2026
16 checks passed
@Malcolmnixon
Malcolmnixon deleted the feature/doc-emphasis-and-fence-language branch November 5, 2026 08:39
Malcolmnixon added a commit that referenced this pull request Nov 21, 2026
* Sync shared agents, skills, and standards from Agents main

Copies Agents #60 (docdown wording), #62 (orchestrator Pull Requests,
planning Feasibility and Delivery), and #64 (SysML2 one package per
file). AGENTS.md gains the Project Scripts section and drops the
scripts from the protected list.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Sync reference template: yamlfix comments, script headers, tool pins

- .yamlfix.toml: comments_require_starting_space = false and the
  template notes for it and the no-limit line_length (Agents #61, #59)
- .yamllint.yaml: no-limit line-length comment (Agents #59)
- build.ps1, lint.ps1, fix.ps1: CUSTOMIZATION headers replace the
  MODIFICATION POLICY text; steps unchanged (Agents #63)
- LintMark 0.1.0-beta.3, TextLint 0.1.0-beta.5, yamllint 1.38.0
  (Agents #58, #59)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Apply fix.ps1: unwrap folded YAML plain scalars

Mechanical yamlfix output under the no-limit line_length policy. Parsed
YAML is identical before and after for all 54 files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Calm the README hero and make it the H1

- Tagline: plain statement 'Markdown API reference / from .NET, C++
  and VHDL.' (36px, solid colors, no gradient text)
- Body and footnote state facts (output layout, doc coverage, CLI or
  MSBuild; .NET 10 and 11 on Windows, Linux, macOS)
- The PDF card is labelled as made downstream by Pandoc
- README: the hero is the H1 with the badges under it (Agents #66)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Record the legacy SysML2 package layout as a standards exception

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* CI: install a pinned modern clang (LLVM 21)

The Windows runner image now ships Visual Studio 18.12, whose C++ standard library headers reject the runner's preinstalled clang (STL1000), so the C++ parser tests failed. Install LLVM 21 with KyleMayes/install-llvm-action in the build and integration-test jobs on every OS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* README: keep the hero H1 alt text to the name and tagline

The hero image is the H1, so its alt text is the page title for screen readers; the details are in the README text below.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* CI: install the pinned clang on Windows only, outside the checkout

On macOS the action's DYLD_LIBRARY_PATH made dotnet crash; Linux and macOS already have a working system clang.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Test: show every clang error when the fixture headers fail to parse

Assert.Empty truncated the message to the start of a Visual Studio header path, hiding the actual diagnostic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* CI: pin clang 22.1.8 on Windows

The runner's Visual Studio 18.12 standard library (MSVC 14.52) requires clang 22 or newer (STL1000). The action's asset list stops at 21.x for Windows x64, so download the LLVM 22.1.8 release archive directly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* CI: point ApiMark at the pinned clang with APIMARK_CLANG_PATH

LLVM 22.1.8 installed, but discovery still resolved the runner's older clang, which the MSVC 14.52 standard library rejects.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* CI: locate the pinned clang.exe inside the extracted archive

The LLVM release archive extracts under a versioned top-level folder, so LLVM_PATH\bin\clang.exe did not exist.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* CI: use the LLVM Windows installer for the pinned clang

On Windows install-llvm-action extracts with 7-Zip, which unpacks the .exe installer directly but only decompresses the .tar.xz to a .tar.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Malcolm Nixon <Malcolm.Nixon@hiarc.inc>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants