Code block
A code block with an optional file name and a copy button. Common indentation is removed. Write the code as text content, escaping < as <.
<hc-code filename="index.html">
<link rel="stylesheet" href="https://unpkg.com/@hackclub/theme@2/dist/hackclub.css" />
<script type="module" src="https://unpkg.com/@hackclub/theme@2/dist/hackclub.js"></script>
</hc-code>API
Attributes
| Name | Type | Description |
|---|---|---|
filename | string | Header label |
language | string | Informational; no highlighting is applied |
nocopy | boolean | Hide the copy button |
CSS parts
| Name | Description |
|---|---|
pre | |
copy | Copy button |