Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2e81a4f
Show direct base classes and interfaces in type signatures
Malcolmnixon Jun 8, 2026
4ed528c
Update README badges to match project template
Malcolmnixon Jun 8, 2026
b2b7073
Remove architecture qualifiers from Platform Support table
Malcolmnixon Jun 8, 2026
f446d41
Make Features section iconic with emoji icons
Malcolmnixon Jun 8, 2026
0aaabda
Cache CppGenerator clang runs in IClassFixture to speed up tests
Malcolmnixon Jun 8, 2026
c54b265
Add intra-doc links and External Types section for C# and C++
Malcolmnixon Jun 8, 2026
e0a52ee
Fix GenericParameter types being incorrectly linked in intra-doc reso…
Malcolmnixon Jun 8, 2026
90d17f4
Fix PR review issues: qualifier preservation, CompareTo tie-breaker, …
Malcolmnixon Jun 8, 2026
e4733f4
Add --search-paths and glob/exclude pattern support to cpp subcommand
Malcolmnixon Jun 8, 2026
03fd978
fix: normalize all generated markdown pages to start with H1 headings
Malcolmnixon Jun 8, 2026
44eabe6
fix: add missing inheritance signature tests for reqstream coverage
Malcolmnixon Jun 8, 2026
bdcaa8e
fix: only check stripped base name for std:: prefix in CppTypeLinkRes…
Jun 8, 2026
6b3e70b
refactor: replace --search-paths/--include-patterns/--exclude-pattern…
Jun 9, 2026
231fbe6
fix: update requirements traceability and design docs after header se…
Jun 9, 2026
bd1b695
fix: replace antipattern/unconfigured with cspell-clean terms and upd…
Jun 9, 2026
58f31c2
refactor: replace synthesized default globs and fix header pattern ma…
Jun 9, 2026
e5ae30f
fix: address PR review r4454762697 (6 comments)
Jun 9, 2026
325e284
feat: render delegate types with source-level delegate syntax
Jun 9, 2026
c2f535c
Strip arity suffix from generic type names in page files, headings, a…
Jun 9, 2026
63cb05e
Fix PR review r4454901364: namespace-prefix checks, FlattenArity, del…
Jun 9, 2026
88a4d99
feat: add C++ using type alias support
Jun 9, 2026
0e08fe5
feat: add APIMARK_CLANG_PATH env var; doc deleted functions and type …
Jun 9, 2026
b2e23f4
fix: PR review r4455192693 — delegate fallback, nsPath dots, test names
Jun 9, 2026
d33cf79
fix: linkify return types in WriteFreeFunctionContent and WriteFuncti…
Jun 9, 2026
ab38133
feat: render @note as blockquote; show default parameter values in si…
Jun 9, 2026
8bc9a1b
Add bool/int/float default parameter tests and fix bool literal parsing
Jun 9, 2026
71f6ff5
Fix type alias linkification and simplification
Jun 9, 2026
1781e53
Add nested class and class-scoped type alias support
Jun 9, 2026
096c108
Fix nullable array type rendering and reqstream test name mismatch
Jun 9, 2026
cd5bd24
Update output structure table with nested type and class-scoped alias…
Jun 9, 2026
198b0e4
Fix documentation issues flagged in PR #15 review
Jun 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,17 @@ words:
- fileassert
- frontmatter
- GHDL
- hrefs
- isysroot
- isystem
- libc
- libclang
- libclangsharp
- libext
- linkified
- Linkification
- Linkify
- linkify
- misattributed
- msbuild
- MSBuild
Expand Down
43 changes: 30 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# ApiMark

[![Build](https://github.com/DemaConsulting/ApiMark/actions/workflows/build_on_push.yaml/badge.svg)](https://github.com/DemaConsulting/ApiMark/actions/workflows/build_on_push.yaml)

<!-- IMPORTANT: All links in this file must be absolute URLs.
This file is distributed in packages and relative links will not resolve. -->

[![GitHub forks](https://img.shields.io/github/forks/demaconsulting/ApiMark?style=plastic)](https://github.com/demaconsulting/ApiMark/network/members)
[![GitHub stars](https://img.shields.io/github/stars/demaconsulting/ApiMark?style=plastic)](https://github.com/demaconsulting/ApiMark/stargazers)
[![GitHub contributors](https://img.shields.io/github/contributors/demaconsulting/ApiMark?style=plastic)](https://github.com/demaconsulting/ApiMark/graphs/contributors)
[![License](https://img.shields.io/github/license/demaconsulting/ApiMark?style=plastic)](https://github.com/demaconsulting/ApiMark/blob/main/LICENSE)
[![Build](https://img.shields.io/github/actions/workflow/status/demaconsulting/ApiMark/build_on_push.yaml)](https://github.com/demaconsulting/ApiMark/actions/workflows/build_on_push.yaml)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=demaconsulting_ApiMark&metric=alert_status)](https://sonarcloud.io/dashboard?id=demaconsulting_ApiMark)
[![Security](https://sonarcloud.io/api/project_badges/measure?project=demaconsulting_ApiMark&metric=security_rating)](https://sonarcloud.io/dashboard?id=demaconsulting_ApiMark)
[![NuGet](https://img.shields.io/nuget/v/DemaConsulting.ApiMark.MSBuild?style=plastic)](https://www.nuget.org/packages/DemaConsulting.ApiMark.MSBuild)

## Overview

ApiMark generates compact, AI-friendly API reference documentation in Markdown
Expand All @@ -15,21 +22,23 @@ type page — consuming only as much context as the task requires.

## Features

- Generates compact Markdown API reference from source code and doc comments
- Gradual disclosure output: root index → namespace summary → type page → member detail
- C#/.NET support via Mono.Cecil and XML documentation comments
- C++ support via `clang -ast-dump=json` and Doxygen-style doc comments
- MSBuild task integration for `.csproj` and `.vcxproj`-based builds
- `dotnet tool` CLI (`apimark`) covering all supported languages
- Designed for AI consumption — minimal noise, explicit navigation links between levels
- 📄 **Compact Markdown Output** - AI-friendly API reference from source code
- 🔍 **Gradual Disclosure** - Index → namespace → type → member detail
- 🔷 **C#/.NET Support** - Mono.Cecil + XML documentation comments
- ➕ **C++ Support** - `clang -ast-dump=json` + Doxygen-style comments
- 🔧 **MSBuild Integration** - Auto-documents `.csproj` and `.vcxproj` builds
- 🖥️ **CLI Tool** - `apimark` dotnet tool covering all languages
- 🤖 **AI-Optimized** - Minimal noise, explicit navigation links
- 🌐 **Multi-Platform** - Windows, Linux, and macOS on .NET 8, 9, and 10
- ✅ **Self-Validation** - Built-in qualification tests for regulated environments

## Platform Support

| Platform | .NET | C++ |
| --- | --- | --- |
| Windows x64 | ✅ | ✅ |
| Linux x64 | ✅ | ✅ |
| macOS (Apple Silicon) | ✅ | ✅ |
| Windows | ✅ | ✅ |
| Linux | ✅ | ✅ |
| macOS | ✅ | ✅ |

## Prerequisites

Expand Down Expand Up @@ -97,8 +106,16 @@ ApiMark generates documentation automatically after every build.
# Generate API documentation from a .NET assembly
apimark dotnet --assembly MyProject.dll --xml-doc MyProject.xml --output docs/api

# Generate API documentation from C++ public headers
# Generate API documentation from C++ public headers (document all headers under include/)
apimark cpp --includes include/ --output docs/api

# Document only specific headers using --api-headers patterns (gitignore-style, ordered)
apimark cpp \
--includes include/ \
--api-headers "include/**" \
--api-headers "!include/detail/**" \
--api-headers "include/detail/public_api.h" \
--output docs/api
```

Run `apimark --help` for all options. Run `apimark dotnet --help` or `apimark cpp --help` for language-specific options.
Expand Down
25 changes: 14 additions & 11 deletions docs/design/api-mark-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ ApiMarkCore.
compiler flags, then parses the JSON output into structured C++ AST records.
- *Contract*: `clang -Xclang -ast-dump=json -fparse-all-comments -fsyntax-only
-x c++ -std={standard} -I {roots} -isystem {sysroots} -D {defines} {headers}`.
The clang executable is located automatically (PATH, xcrun on macOS, vswhere on
Windows) or from `CppGeneratorOptions.ClangPath`.
The clang executable is located using this priority order:
(1) `CppGeneratorOptions.ClangPath` when set;
(2) the `APIMARK_CLANG_PATH` environment variable when set;
(3) `clang` on PATH; (4) `xcrun clang` on macOS; (5) vswhere / default LLVM path on Windows.
- *Constraints*: clang must be installed and accessible; a clear
`InvalidOperationException` is thrown when clang cannot be found.

Expand Down Expand Up @@ -79,14 +81,16 @@ N/A — not a safety-classified software item.
## Data Flow

1. The caller (ApiMarkTool) constructs `CppGeneratorOptions` with
PublicIncludeRoots, IncludePatterns, ExcludePatterns, SystemIncludePaths,
AdditionalIncludePaths, Defines, CppStandard, AdditionalCompilerArguments,
PublicIncludeRoots, ApiHeaderPatterns, SystemIncludePaths,
Defines, CppStandard, AdditionalCompilerArguments,
Visibility, IncludeDeprecated, and LibraryName, then passes an
IMarkdownWriterFactory to Generate.
2. CppGenerator enumerates all header files under each PublicIncludeRoot,
applying IncludePatterns and ExcludePatterns, to produce the candidate file
set. Each matched header is parsed as an independent translation unit so that
headers are self-contained.
2. CppGenerator enumerates all header files under each PublicIncludeRoot.
When ApiHeaderPatterns is non-empty, patterns are applied with gitignore-style
last-match-wins semantics to produce the candidate file set; when empty, all
recognized header files under every root are included automatically. Each
matched header is parsed as an independent translation unit so that headers
are self-contained.
3. CppGenerator calls `ClangAstParser.Parse` with all candidate headers and the
configured options. `ClangAstParser` invokes `clang -ast-dump=json` and parses
the resulting JSON into `CppCompilationResult` containing `CppNamespaceDecl`
Expand All @@ -96,9 +100,8 @@ N/A — not a safety-classified software item.
physically located in the public headers, already filtered by ownership.
5. CppGenerator applies the IsOwnedDeclaration filter to each declaration:
only declarations whose source file normalizes to a path under a
PublicIncludeRoot, matches IncludePatterns, and does not match
ExcludePatterns are documented. System and third-party declarations are
used for type resolution only.
PublicIncludeRoot that was selected by ApiHeaderPatterns are documented.
System and third-party declarations are used for type resolution only.
6. For each owned declaration, CppGenerator derives the canonical #include path
as the source file path relative to its matching PublicIncludeRoot, expressed
with forward slashes.
Expand Down
Loading
Loading