Module

PuduLangDocgen.Markdown.Directives

View source

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

fn colon(text: Str) -> Option[Directive]

A :::name key="value" flag::: line; closed tells whether it ends on the same line.

Parameters

text
Str

Returns

Option[Directive]

View source

value

fn value(found: &Directive, key: Str) -> Str

The value of an attribute, or the empty text.

Parameters

found
&Directive
key
Str

Returns

Str

View source

attributes

fn attributes(text: Str) -> Array[(Str, Str)]

key="value" pairs and bare flags, in written order.

Parameters

text
Str

Returns

Array[(Str, Str)]

View source

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

text
Str

Returns

Option[(Str, Str)]

View source

video

fn video(text: Str) -> Option[Str]

The address of a [!Video address] line.

Parameters

text
Str

Returns

Option[Str]

View source

tab

fn tab(text: Str) -> Option[TabHeading]

A tab heading # [Title](#tab/id/condition).

Parameters

text
Str

Returns

Option[TabHeading]

View source

footnote

fn footnote(text: Str) -> Option[(Str, Str)]

The label and first line of a footnote definition [^label]: text.

Parameters

text
Str

Returns

Option[(Str, Str)]

View source

include

fn include(text: Str) -> Option[(Str, Str)]

The title and path of a whole-line [!INCLUDE[title](path)].

Parameters

text
Str

Returns

Option[(Str, Str)]

View source

excerpt

fn excerpt(text: Str) -> Option[Excerpt]

A whole-line [!code-language[name](path "title")] excerpt.

Parameters

text
Str

Returns

Option[Excerpt]

View source

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]
start
Int
name
Str

Returns

Int

View source

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])]

View source