codly / docs

Make it yours

Applies to code displayed in the documentation.

GitHub

API reference

Imports

Import the Codly package as a namespace:

typst
#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.

Typst source
#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.

OUTPUTPre-rendered default
Rendered output of the Typst example

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.