api

main.ch

Declarations in main.ch

1 declarationsmd

Declarations

Public only
md#
Publicnamespace
namespace md
Runtime `md` package. Parses markdown at runtime, without the compiler. The parsing logic itself is shared with the `md_cbi` compiler plugin through the `md_parser` package: the same lexer (`getNextToken2`) and parser (`parseMdRoot`) are driven here with runtime implementations of the compiler `Parser`, `SourceProvider` and `BatchAllocator` interfaces provided by the shared `compiler_runtime` package.
MdError#
Publicenum
enum MdError { FileReadFailed }
Arena#
Publicstruct
struct Arena { var allocator : ASTAllocator }
The arena wraps a compiler_runtime ASTAllocator and implements the compiler
make#
PublicfunctionConstructor
func make() : Arena
delete#
Publicfunction
func delete(self : &Arena) : void
lex#
Publicfunction
func lex(text : string_view) : vector<Token>
parse#
Publicfunction
func parse(tokens : *vector<Token>, arena : *Arena) : *MdRoot
to_html#
Publicfunction
func to_html(text : string_view, highlighter : func(string_view, string_view) : string, link_rewriter : func(string_view) : string) : string
file_to_html#
Publicfunction
func file_to_html(path : *char, highlighter : func(string_view, string_view) : string, link_rewriter : func(string_view) : string) : Result<string, MdError>