Skip to content

desic doc

Generate documentation from Desi source files.

Quick Start

# Generate docs for a file
desic doc mymodule.desi

# Include private declarations
desic doc --all mymodule.desi

Output

The command prints markdown to stdout. Redirect to save:

desic doc lib/sync/mutex.desi > docs/mutex.md

What's Documented

Declaration Info Shown
Module Module-level docstring
Functions Signature, params, return type
Classes Fields, methods, constants, inheritance
Structs Fields
Enums Variants with payloads

Each item includes: - Line number in source - Docstring (if triple-quoted """...""") - Visibility (*(private)* with --all) - Generics (<T: Bound>)

Module Docstrings

Place a triple-quoted string at the very beginning of your file:

"""
This module provides math utilities.
Multi-line descriptions are supported.
"""

pub def add(a: int, b: int) -> int:
    return a + b

Example

pub class Stack<T>:
    """A simple generic stack."""
    pub mut items: list<T>

    pub def push(self, item: T) -> none:
        """Add item to top."""
        pass

Output:

### `Stack<T>`
*Line 1*

A simple generic stack.

**Fields:**
- `items: list<T>` *(mut)*

**Methods:**
- `push(self, item: T) -> none` - Add item to top.

Flags

Flag Description
--all, -a Include private declarations