← Docs home

🎆 Sharpdown

A polyglot commenting language for generated markdown from code comments


Language File Types
CSharp .cs
Sql .sql
JavaScript .js, .mjs, .ts, .tsx
PowerShell .ps1, .psm1

ConvertTo-RedactedPath

function ConvertTo-RedactedPath

Swap the user's home directory for ~ so log lines never spill private paths.

Parameters

Returns


Convert-SharpDownContent

function Convert-SharpDownContent

Stream a source file's marker comments and declaration lines as Markdown.

Parameters

Key Description
Marker The line prefix that signals a doc comment.
Fence The code fence label applied to declarations.
DeclPattern The regex that marks a line as a declaration.

Read and trim each source line so the tests ignore indentation.


Returns


Resolve-SharpDownTarget

function Resolve-SharpDownTarget

Compute the mirrored Markdown output path for a source file under -Recurse.

Parameters

Returns


Write-SharpDownFile

function Write-SharpDownFile

Convert a single source file and write the result. Skips with a warning when the source has no SharpDown content. Creates the output directory on demand.

Parameters

Returns


Invoke-SharpDownFile

function Invoke-SharpDownFile

Validate the File-mode contract and convert one source.

Parameters

Throws

Invoke-SharpDownTree

function Invoke-SharpDownTree

Validate the Directory-mode contract and walk a source tree.

Parameters

Throws

ConvertTo-SharpDown

function ConvertTo-SharpDown

Public entry point. Convert a single source or a tree of sources to Markdown.

Two parameter sets:

Parameters

Returns