Tags
Note
Tags, or Air Tag, are explained in the concepts document about tags.
In the spirit of helping our users, every Air Tag has copious documentation—enough that sometimes it breaks the documentation build process. Therefore, Air Tag that directly correspond to their HTML equivalents can be found in smaller, easier-to-compile pages.
What remains on this page are core Air Tag that either have great utility (Raw and Children come to mind), or are base classes for other tags.
Tag
Tag(*children)
Bases: Transparent
Source code in src/air/tags/models/special.py
31 32 33 34 35 |
|
Raw
Raw(text_child='', /, **kwargs)
Bases: UnSafeTag
, Transparent
Renders raw HTML content without escaping.
Raises:
Type | Description |
---|---|
TypeError
|
If non-string content is provided |
Example: Raw('Bold text') # Produces 'Bold text' # Use with other tags Div( P("Safe content"), Raw('
'), P("More safe content") )
Source code in src/air/tags/models/special.py
71 72 73 74 75 76 |
|
Children
Children(*children)
Bases: Transparent
Source code in src/air/tags/models/special.py
31 32 33 34 35 |
|
SafeStr
Bases: str
A string subclass that doesn't trigger html.escape() when called by Tag.render()
Example
sample = SafeStr('Hello, world')