コンテンツにスキップ

codly コードブロック装飾

codly – Typst Universe
Codly is a beautiful code presentation template with many features like smart indentation, line numbering, highlighting, etc.
codly – Typst Universe favicon https://typst.app/universe/package/codly
codly – Typst Universe

以下のようにインポートと初期化を行うことでコードブロックのスタイルが変化します。

#import "@preview/codly:1.3.0": *
#import "@preview/codly-languages:0.1.1": *
#show: codly-init.with()

Rust の例

func13

一部分のハイライト

#codly(highlights: (
(line: 4, start: 2, end: none, fill: red),
(line: 5, start: 13, end: 19, fill: green, tag: "(a)"),
(line: 5, start: 26, fill: blue, tag: "(b)"),
))

func14