Given the current indent of the renderer we check to see how much space is left on the current line.
What is the width of the literal text stored in
node and all of it's child nodes. Used to determine alignment for rendering nodes such as centered.
Literal printing of a of
parts. Behaviour depends on when
.wrap is active at the moment, which is set in
Print out all the current segments present in the margin buffer.
Each time a segment gets printed it's count is reduced. When a segment has a count of zero it won't be printed and instead spaces equal to it's width are printed. For persistent printing a count of -1 should be used.
Adds a new segment to the margin buffer, but will only print out for the given number of
count calls to
count calls it will instead print out spaces equal to the width of
Adds a new segment to the margin buffer. This segment is persistent and thus will print on every margin print.
Adds new segmant to the margin buffer.
count determines how many time
initial is printed. After that, the width of
rest is printed instead.
A string macro for markdown text that implements standard string interpolation. Returns a parsed markdown AST with the values of the interpolation expressions embedded in the AST.
value = "interpolated"
cm"Some *$(value)* text."
The default syntax rules used for parsing are:
which matches closely with the default syntax supported in
DollarMathRule is not enabled since it conflicts with the interpolation syntax. Use double backticks and
math language literal blocks for maths that is provided by the
Parser can be invoked when using
cm"" by providing a suffix to the macro call, for example:
more = "more"
cm"Some **$(uppercase(more))** text."none
where the suffixed
none will invoke a basic
Parser with no additional syntax rules
enabled!. To use your own custom parser, for example to only enable the
TypographyRule, you can suffix the call with a named function from the current module's global scope that returns the
Parser object with the required rules enabled:
custom() = enable!(Parser(), TypographyRule())
It can then be used as
str = "custom"
cm"A '$(titlecase(str))' parser..."custom