grelin_templates/feasibility/data/code.typ
MORRO b8eed931ac Add Markdown-driven feasibility report with Typst styling pipeline.
Introduce cmarker/codly-based MD workflow, brutalist cover layout, and shared brand tokens so colleagues can author reports in report.md while the template handles PDF output.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 19:29:48 +08:00

39 lines
1.2 KiB
Plaintext

#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
}