htmforge.elements
htmforge.elements
HTML5 factory functions for htmforge elements.
a(*children, **attrs)
abbr(*children, **attrs)
address(*children, **attrs)
area(**attrs)
article(*children, **attrs)
aside(*children, **attrs)
audio(*children, **attrs)
blockquote(*children, **attrs)
body(*children, **attrs)
br(**attrs)
button(*children, **attrs)
canvas(*children, **attrs)
caption(*children, **attrs)
code(*children, **attrs)
col(**attrs)
colgroup(*children, **attrs)
details(*children, **attrs)
dialog(*children, **attrs)
div(*children, **attrs)
em(*children, **attrs)
fieldset(*children, **attrs)
figcaption(*children, **attrs)
figure(*children, **attrs)
footer(*children, **attrs)
form(*children, **attrs)
h1(*children, **attrs)
h2(*children, **attrs)
h3(*children, **attrs)
h4(*children, **attrs)
h5(*children, **attrs)
h6(*children, **attrs)
head(*children, **attrs)
header(*children, **attrs)
hr(**attrs)
html(*children, **attrs)
iframe(*children, **attrs)
img(**attrs)
input(**attrs)
kbd(*children, **attrs)
label(*children, **attrs)
legend(*children, **attrs)
li(*children, **attrs)
link(**attrs)
main(*children, **attrs)
map_(*children, **attrs)
mark(*children, **attrs)
meta(**attrs)
meter(*children, **attrs)
nav(*children, **attrs)
noscript(*children, **attrs)
ol(*children, **attrs)
option(*children, **attrs)
p(*children, **attrs)
picture(*children, **attrs)
pre(*children, **attrs)
progress(*children, **attrs)
raw(text)
Gibt einen String als rohes, nicht-escaptes HTML-Markup zurück.
Verwende diese Funktion, um Inhalte von <script> oder <style>-
Tags einzubetten, die von markupsafe nicht erneut escaped werden sollen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Der rohe Textinhalt (CSS, JavaScript …). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Ein |
Markup
|
class: |
Example
from htmforge.elements import script, raw script(raw("console.log(1)")).to_html() ''
Source code in htmforge\elements\__init__.py
script(*children, **attrs)
Skript-Block oder externes Skript.
Verwende :func:raw für Inline-JavaScript, damit der Inhalt
nicht escaped wird.
section(*children, **attrs)
select(*children, **attrs)
small(*children, **attrs)
source(**attrs)
span(*children, **attrs)
strong(*children, **attrs)
style(*children, **attrs)
Inline-CSS-Block.
Verwende :func:raw für CSS-Inhalt, damit er nicht escaped wird.