このページはまだ翻訳されていません。原文の内容が表示されています。
elem
要素関数要素関数要素関数はset
ルールやshow
ルールでカスタマイズできます。
set
ルールやshow
ルールでカスタマイズできます。An HTML element that can contain Typst content.
Typst's HTML export automatically generates the appropriate tags for most
elements. However, sometimes, it is desirable to retain more control. For
example, when using Typst to generate your blog, you could use this function
to wrap each article in an <article>
tag.
Typst is aware of what is valid HTML. A tag and its attributes must form
syntactically valid HTML. Some tags, like meta
do not accept content.
Hence, you must not provide a body for them. We may add more checks in the
future, so be sure that you are generating valid HTML when using this
function.
Normally, Typst will generate html
, head
, and body
tags for you. If
you instead create them with this function, Typst will omit its own tags.
#html.elem("div", attrs: (style: "background: aqua"))[
A div with _Typst content_ inside!
]
引数引数引数は関数への入力値です。関数名の後に括弧で囲んで指定します。
tag
The element's tag.
attrs
設定可能引数設定可能引数設定可能引数は、set
ルールを用いて設定でき、それ以降で使用するデフォルト値を変更できます。
set
ルールを用いて設定でき、それ以降で使用するデフォルト値を変更できます。The element's HTML attributes.
デフォルト値: (:)