API reference
- Components render code blocks and their parts.
- Types describe configuration values and their accepted shorthand forms.
- Themes and helpers apply reusable styles and inspect block metadata.
- ⚙️ Queries and show rules explains how to inspect and customize elements.
- ⚙️ Internals follows a code block from source to layout and references.
Imports
Import the Codly package as a namespace:
#import "@preview/codly:2.0.0" as codly
Components and styling
Codly uses Elembic custom elements and types; the exported codly.e gives you the same Elembic version without a separate import. codly.new creates a code block, and component helpers such as codly.number-set_ apply scoped defaults with #show: rather than native #set syntax. See the Elembic documentation for details.
#import "@preview/codly:2.0.0" as codly
#show: codly.number-set_(numbering: "1.")
#show raw.where(block: true): codly.new
```py
print(42)
print(43)
```
Edit & run on your device
The highlighted source and output update after you stop typing. Copy code includes your edits.
Each component page documents its constructor and its *-set_ and *-show_ helpers. Configuration types do not render directly — Codly instantiates them internally — and most accept dictionaries or arrays in place of an explicit constructor call; each type page lists its accepted forms.
Coordinates and defaults
Callout pointers and explicit skip positions have their own conventions, documented on their type pages. Check a field’s definition before using displayed numbers as configuration coordinates.
auto and none have field-specific meanings. A default value does not always describe the final appearance: themes, scoped styling rules, and surrounding Typst text or raw settings can affect rendering.
paint means a color, gradient, or tiling; array<T> an array of T values.