list
List
Bases: MdObj
Markdown list.
Source code in mkreports/md/list.py
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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
__init__(items=(), marker='-')
Initialize the list as a markdown object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
items |
Union[str, Iterable[Union[MdObj, str]]]
|
List of items in the list. |
()
|
marker |
Literal['-', '*', '+', '1']
|
Marker to use for the list. |
'-'
|
Source code in mkreports/md/list.py
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 |
|
append(item)
Append an item. This returns a new list, does not append to the old.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
Union[Text, MdObj]
|
The item to append to the list. |
required |
Returns:
Name | Type | Description |
---|---|---|
List |
'List'
|
A list object with the new item appended. |
Source code in mkreports/md/list.py
63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
extend(items)
Extend the list by additional items.
The old list will not be updated. A new one will be created.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
items |
Sequence[Union[Text, MdObj]]
|
The items with which to extend the list. |
required |
Returns:
Name | Type | Description |
---|---|---|
List |
'List'
|
A new list object |
Source code in mkreports/md/list.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
num_items()
Number of items in the list.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
Number of items in the list. |
Source code in mkreports/md/list.py
98 99 100 101 102 103 104 105 106 |
|