#import "@preview/codly:1.3.0": * #import "@preview/codly-languages:0.1.10": codly-languages #import "theme.typ": * #let codly-init-rule = codly-init.with() #let codly-config = codly( languages: codly-languages, fill: code-block-fill, radius: code-block-radius, stroke: none, zebra-fill: none, number-format: none, display-icon: false, display-name: true, default-color: color-body, lang-stroke: (_) => none, lang-fill: (_) => code-block-fill, lang-radius: 0pt, ) /// 与 codly 配合的语法高亮色(须在 codly-init 之后注册) #let code-token-highlight-init(doc) = { show raw.where(block: true): it => { show "keyword": set text(fill: code-token-keyword) show "comment": set text(fill: code-token-comment) show "string": set text(fill: code-token-string) show "number": set text(fill: code-token-number) show "builtin": set text(fill: code-token-function) show "function": set text(fill: code-token-function) show "decor": set text(fill: code-token-function) show "operator": set text(fill: code-token-operator) show "punctuation": set text(fill: code-token-operator) set text(fill: color-body) it } doc }