Module
PuduLangDocgen.Markdown.Directives
Authoring extension syntax recognized per line
Types
| Name | Description |
|---|---|
Directive |
A triple-colon container line with named attributes |
TabHeading |
A heading that opens one tab of a tab group |
Excerpt |
A code excerpt line naming language, file, and caption |
Functions
| Name | Description |
|---|---|
colon |
A `:::name key="value" flag:::` line; `closed` tells whether it ends on the same line. |
value |
The value of an attribute, or the empty text. |
attributes |
`key="value"` pairs and bare flags, in written order. |
alert |
The alert kind of a quote's first line `[!NOTE]`, uppercased, with any text after it. |
video |
The address of a `[!Video address]` line. |
tab |
A tab heading `# [Title](#tab/id/condition)`. |
footnote |
The label and first line of a footnote definition `[^label]: text`. |
include |
The title and path of a whole-line `[!INCLUDE[title](path)]`. |
excerpt |
A whole-line `[!code-language[name](path "title")]` excerpt. |
extent |
The index of the `:::name-end:::` line closing a container opened at an index, or -1. Containers of the same name nest. |
columns |
The columns of a row body: each `:::column span="n":::` up to its `:::column-end:::`. Lines outside any column are ignored. |
colon
A :::name key="value" flag::: line; closed tells whether it ends on the same line.
Parameters
textStr
Returns
Option[Directive]
value
The value of an attribute, or the empty text.
Parameters
found&DirectivekeyStr
Returns
Str
attributes
fn attributes(text: Str) -> Array[(Str, Str)]
key="value" pairs and bare flags, in written order.
Parameters
textStr
Returns
Array[(Str, Str)]
alert
fn alert(text: Str) -> Option[(Str, Str)]
The alert kind of a quote's first line [!NOTE], uppercased, with any text after it.
Parameters
textStr
Returns
Option[(Str, Str)]
video
fn video(text: Str) -> Option[Str]
The address of a [!Video address] line.
Parameters
textStr
Returns
Option[Str]
tab
fn tab(text: Str) -> Option[TabHeading]
A tab heading # [Title](#tab/id/condition).
Parameters
textStr
Returns
Option[TabHeading]
footnote
fn footnote(text: Str) -> Option[(Str, Str)]
The label and first line of a footnote definition [^label]: text.
Parameters
textStr
Returns
Option[(Str, Str)]
include
fn include(text: Str) -> Option[(Str, Str)]
The title and path of a whole-line [!INCLUDE[title](path)].
Parameters
textStr
Returns
Option[(Str, Str)]
excerpt
A whole-line [!code-language[name](path "title")] excerpt.
Parameters
textStr
Returns
Option[Excerpt]
extent
fn extent(lines: &Array[FrontMatter.Line], start: Int, name: Str) -> Int
The index of the :::name-end::: line closing a container opened at an index, or -1.
Containers of the same name nest.
Parameters
lines&Array[FrontMatter.Line]startIntnameStr
Returns
Int
columns
fn columns(lines: &Array[FrontMatter.Line]) -> Array[(Int, Array[FrontMatter.Line])]
The columns of a row body: each :::column span="n"::: up to its :::column-end:::.
Lines outside any column are ignored.
Parameters
lines&Array[FrontMatter.Line]
Returns
Array[(Int, Array[FrontMatter.Line])]