6.46. kink/doc/model/BLOCK_TYPE¶
6.46.1. type block_type¶
`block_type` is an enum type of `paragraph`, `code` and `heading`, which represents the type of a block.
6.46.1.1. Block_type.name¶
`name` returns a `str` value of "paragraph", "code", or "heading".
6.46.1.2. Block_type.valid_text?(Text)¶
`valid_text?` returns whether `Text` is accepted as the `text` property of a block with the block type.
If the block type is `paragraph` or `heading`, `Text` is accepted when it matches the regex pattern:
[^\u0000-\u0020\u007f]( *[^\u0000-\u0020\u007f])*
If the block type is `code`, `Text` is accepted when it matches the regex pattern:
( *[^\u0000-\u0020\u007f]+( +[^\u0000-\u0020\u007f]+)*\n)(\n?( *[^\u0000-\u0020\u007f]+( +[^\u0000-\u0020\u007f]+)*\n))*
See “Kinkdoc: API Documentation system” → “Data model” → “JSON Schema” in the manual for the schema.
Precondition
`Text` must be a `str`.
6.46.1.3. X == Y¶
`X` and `Y` are equal when they are the same `block_type` value.
Precondition
`Y` must be a `block_type`.
6.46.2. BLOCK_TYPE.paragraph¶
`paragraph` function returns `paragraph` enum value.
6.46.3. BLOCK_TYPE.code¶
`code` function returns `code` enum value.
6.46.4. BLOCK_TYPE.heading¶
`heading` function returns `heading` enum value.
6.46.5. BLOCK_TYPE.is?(Val)¶
`is?` returns whether `Val` is a `block_type`.