Skip to content

Documentation

brass doc file.brass [-o dir] writes one Markdown page per module of a program, and brass doc --std one per standard module: every pub item with its signature in a brass code block, and the because lines above it as its description (methods are listed under their type; private fields are counted, not shown). The pages carry Starlight frontmatter.

A module can have a Markdown file next to it: net.md (or net.mdx) beside net.brass. Its text before the first ## heading goes at the top of the module’s page; a section ## connect or ## Socket.read_line is added under that item’s signature and description. A section naming no public item is an error, so a renamed function cannot leave its docs behind. This keeps code free of comments (only short because lines) while longer explanations and examples live in Markdown.

brass test file.md checks every ```brass block in a Markdown file, compiled next to that file so it can import the modules there. A plain block must compile; ```brass run must also run, and if a ```text block follows, print exactly that; ```brass fails must be rejected (with the ```text block, if any, as the expected error); ```brass fragment is a partial snippet and is skipped. make test checks DESIGN.md, the standard modules’ docs and the guides this way.

make site turns DESIGN.md (one page per section), README.md and the standard library reference into a Starlight site in site/ and builds it (site/dist), with a Brass syntax grammar for code blocks, search, and llms.txt / llms-full.txt for AI agents. Everything stays Markdown, so the repository and the site say the same thing.