3.34. kink/doc/model/BLOCK

Provides blocks in sections of docs.

A block is either a paragraph block or a preformatted code block.

3.34.1. BLOCK.new_paragraph(Text)

Returns a paragraph block.

Precondition:

• Text must be a nonempty str without LF characters.

• The first and the last rune of Text must be greater than or equal to 0x21.

3.34.2. BLOCK.new_code(Text)

Returns a code block.

Precondition: Text must be a nonempty str terminated by LF.

3.34.3. BLOCK.block?(Val)

Returns whether Val is a block.

3.34.4. Type block

Blocks in a section of a doc page.

Block.text

Returns the text of the block.

Block.paragraph?

Returns whether the Block is a paragraph block.

Block.code?

Returns whether the Block is a code block.

Block.op_eq(Another_block) and Block.op_ne(Another_block)

Two blocks are equal when they are of the same variant (paragraph or code), and have the same text.