Reference¶
-
class
pymarkup.
MarkupBuilder
(element: str = 'html', text: _io.StringIO = <factory>, attrs: Dict = <factory>)[source]¶ Build basic XML-style markup from context managers.
Instances of this class are individual tags with their own attributes. They can be used in context managers multiple times.
-
text
¶ The cumulative text generated by this instance. It is automatically passed down to children, and is created by default, so it is not necessary to pass it in most of the time.
Type: File-like object
-
__add__
(other)[source]¶ Add
other
to current text.If
other
is a MarkupBuilder just run MarkupBuilder.self_closing() on it, otherwise addstr(other)
toself.text
.Parameters: other (Union[str,MarkupBuilder]) – The other object to add.
-
__getattr__
(item)[source]¶ Return a child of this MarkupBuilder with
item
as the MarkupBuilder.element
-
__weakref__
¶ list of weak references to the object (if defined)
-