Konfiguration
Datei mit Kopf, Kopieren und Herunterladen
Daten
Configs, API examples and logs in mono, without syntax colours except comments (text/tertiary). Header with file name, copy and download. Pass the text via code (escaped, comments marked) or the default slot (light DOM, used as is). Methods copy(), download(); events tc-copy / tc-error.
Datei mit Kopf, Kopieren und Herunterladen
Kommentarzeilen sind gedämpft, kurze Befehle ohne Kopf
<tc-code-block> direkt im Markup; copy() und die Events tc-copy / tc-error.
| Option | Standard | Werte | Beschreibung |
|---|---|---|---|
code | '' | – | Code text (escaped). |
filename | '' | – | Header title and download file name, e.g. "wg-notebook.conf". |
language | '' | – | Language hint, shown when no file name is set. |
copy | True | – | Show the copy button. |
download | False | – | Show a download button that saves the text as filename. |
download_url | '' | – | Download from this URL instead of the shown text. |
wrap | False | – | Wrap long lines instead of scrolling horizontally. |
max_height | '' | – | CSS max height of the body, e.g. "320px" (scrolls). |
Zusätzliche Attribute (z. B. class, aria-*, data-*) und HTMX-Kurzformen (get, post, get_url, post_url, target, swap, trigger, confirm) werden an das Element „root“ durchgereicht.