builder
A Markdown document builder with line and span writing modes.
MarkdownBuilder
dataclass
A Markdown document builder with line and span writing modes.
Source code in src/pymarkdown_builder/builder.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
document: str = field(default='')
class-attribute
instance-attribute
Content of the builder.
__str__()
Returns the content of the builder.
Source code in src/pymarkdown_builder/builder.py
63 64 65 |
|
line_break()
Appends a line break to the document.
Returns:
Type | Description |
---|---|
Self
|
The builder instance. |
Source code in src/pymarkdown_builder/builder.py
53 54 55 56 57 58 59 60 61 |
|
write_lines(*lines)
Joins the lines with double line breaks and appends to the document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*lines |
str
|
Unpacked iterable of lines to be appended. |
()
|
Returns:
Type | Description |
---|---|
Self
|
The builder instance. |
Source code in src/pymarkdown_builder/builder.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
write_spans(*spans)
Joins the spans and appends to the document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
*spans |
str
|
Unpacked iterable of spans to be appended. |
()
|
Returns:
Type | Description |
---|---|
Self
|
The builder instance. |
Source code in src/pymarkdown_builder/builder.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|