api
SuCoS api generates documentation pages from C# source code. It analyzes your projects and creates Markdown files that SuCoS can then render into a complete API reference.
Usage
SuCoS api --project <path> [options]
Options
| Option | Short | Description |
|---|---|---|
--project <path> |
-p |
Required. Path(s) to the source C# project(s) or solution. Multiple paths can be separated by semicolons. |
--output <path> |
-o |
Relative output path for the generated Markdown files. |
--output-policy |
Fail if output directory already exists. | |
--filter <regex> |
Filter which assemblies or namespaces to include. | |
--include-private |
Include private/internal members in the documentation. | |
--external-link |
-e |
External repository link for source code linking (e.g., github.com/user/repo). |
--source <path> |
-s |
Site source directory (default: ./) |
--verbose |
-v |
Verbose logging |
Examples
# Generate API docs for a single project
SuCoS api --project ./src/MyProject/MyProject.csproj --output content/api
# Generate from multiple projects and link to GitHub
SuCoS api -p "./src/Core;./src/Extensions" -o content/api -e github.com/username/repo
How it works
- Analysis: SuCoS uses Roslyn to parse the C# source code and extract types, methods, properties, and XML documentation comments.
- Generation: It creates a directory structure of Markdown files mirroring your project's namespaces.
- Metadata: Each generated file contains front matter with type information, which the theme can use to render rich API pages.
The generated Markdown files are intended to be processed by SuCoS just like any other content.