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 coordinate5/// y1: Starting Y coordinate6/// x2: Target X coordinate7/// y2: Target Y coordinate8///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 documentation2spc doc src/ --out docs/ --format markdown34# Generate modern standalone HTML portal5spc doc src/ --out site/ --format html