- class mdfy.elements.list.MdList(items: list[str | MdList], depth: int = 0, indent: int = 4, numbered: bool = False)[source]¶
Bases:
MdElementRepresents a Markdown list.
- items¶
List of items, where each item can be a string or another MdList.
Examples
>>> from mdfy.elements import MdList >>> >>> list = MdList(["item 1", "item 2"]) >>> print(list) - item 1 - item 2 >>> >>> list = MdList(["item 1", "item 2"], numbered=True) >>> print(list) 1. item 1 1. item 2 >>> >>> list = MdList([ ... "item 1", ... [ ... "item 2.1", ... "item 2.2" ... ] ... ]) >>> print(list) - item 1 - item 2.1 - item 2.2