codly / docs

Make it yours

Applies to code displayed in the documentation.

GitHub

codly.skip

Describes an explicit collapsed gap in a code block; pass it in codly.new’s skips field.

Signature

typst code
codly.skip(position, length: 1)

position is the required positional argument; length is optional and can be supplied positionally or by name.

Fields

Field Type Default / required Meaning
position int Required, positional One-based source line before which the omission row is inserted.
length int 1, positional Number of omitted lines added to subsequent displayed line numbers.

Behavior

The constructor accepts codly.skip(position, length) or named fields. A dictionary casts using position and optional length; an array of one or two values casts positionally. The skips field sorts entries by position.

Explicit skips represent lines already omitted from the supplied source. They add a gap row and increase subsequent displayed numbers; they do not remove source lines. Use range or ranges with smart-skip to omit lines that are still present.

Example: Basic Usage

Typst source
#import "@preview/codly:2.0.0" as codly

#codly.new(
  ```text
  first
  second
  third
  fourth
  ```,
  skips: (codly.skip(2, 4),),
)
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