24. Documentation generator

The RST module exposes collection of helper routines to automatically generate Daslang reStructuredText documentation.

All functions and symbols are in “rst” module, use require to get access to it.

require daslib/rst
DocGroup

DocGroup fields are

name

string

func

array< ast::Function ?>

hidden

bool

Group of functions with shared category.

24.1. Document writers

document(name: string const; mod: rtti::Module? const; fname: string const; substname: string const; groups: array<rst::DocGroup> const)

argument

argument type

name

string const

mod

rtti::Module ? const

fname

string const

substname

string const

groups

array< rst::DocGroup > const

Document single module given list of DocGropus. This will generate RST file with documentation for the module. Functions which do not match any DocGroup will be placed in the Uncategorized group.

24.2. Group operations

group_by_regex(name: string const; mod: rtti::Module? const; reg: Regex)

group_by_regex returns rst::DocGroup

argument

argument type

name

string const

mod

rtti::Module ? const

reg

regex::Regex

Creates a group of functions with shared category. Functions will be added to the group if they match the regular expression.

hide_group(group: DocGroup)

hide_group returns rst::DocGroup

argument

argument type

group

rst::DocGroup

Marks the group as hidden.