Documentation Generator (`spc doc`)

spc doc parses docstrings prefixed with three slashes (///) directly above function, class, and module declarations and renders documentation.

geometry.sp
1/// Calculates the Euclidean distance between two points.
2///
3/// Parameters:
4/// x1: Starting X coordinate
5/// y1: Starting Y coordinate
6/// x2: Target X coordinate
7/// y2: Target Y coordinate
8///
9/// Returns: The double-precision distance between points.
10fn distance(double x1, double y1, double x2, double y2) -> double {
11 let dx = x2 - x1;
12 let dy = y2 - y1;
13 return math.sqrt(dx * dx + dy * dy);
14}

CLI Usage

bash
1# Generate Markdown documentation
2spc doc src/ --out docs/ --format markdown
3
4# Generate modern standalone HTML portal
5spc doc src/ --out site/ --format html