expand

Write the text from the lexer to the OutputRange, and expand any macro in it..

expand takes a ddoc.Lexer, and will, until it's empty, write it's expanded version to output.

  1. void expand(Lexer input, string[string] macros, O output, bool removeUnknown)
  2. string expand(Lexer input, string[string] macros, bool removeUnknown)
    string
    expand
    (,
    string[string] macros
    ,
    bool removeUnknown = true
    )

Parameters

input Lexer

A reference to the lexer to use. When expandMacros successfully returns, it will be empty.

macros string[string]

A list of DDOC macros to use for expansion. This override the previous definitions, hardwired in DDOC. Which means if an user provides a macro such as macros["B"] = "<h1>$0</h1>";, it will be used, otherwise the default macros["B"] = "<b>$0</b>"; will be used. To undefine hardwired macros, just set them to an empty string: macros["B"] = "";.

removeUnknown bool

Set to true to make unknown macros disappear from the output or false to make them output unprocessed.

Meta