1 2# h2md - Header To Markdown 3 4h2md is a simple tool for generating markdown api docs from headers. 5 6It avoids any dependencies and has a very simple line-oriented parser. 7Whitespace at the start and end of lines is ignored. 8 9Lines starting with `//@` are either a directive to h2md or the start of 10a chunk of markdown. 11 12Markdown chunks are continued on every following line starting 13with `//`. They are ended by a blank line, or a line of source code. 14 15A line of source code after a markdown chunk is expected to be a function 16or method declaration, which will be terminated (on the same line or 17a later line) by a `{` or `;`. It will be presented as a code block. 18 19Lines starting with `//{` begin a code block, and all following lines 20will be code until a line starting with `//}` is observed. 21 22To start a new document, use a doc directive, like 23`//@doc(docs/my-markdown.md)` 24 25From the start of a doc directive until the next doc directive, any 26generated markdown will be sent to the file specified in the directive. 27 28