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>
3.1 KiB
3.1 KiB
Feasibility Report · 可行性研究报告模板
GreLin 可行性报告 Typst 模板,面向矿石分选项目论证与客户交付。同事用 Markdown 写正文,模板负责封面、页眉页脚与图表排版。
快速开始
- 编辑
content/report.md(或从content/report.template.md复制) - 用 VS Code / Cursor 打开
report.typ Ctrl+Shift+P→ Typst Preview 预览,或 Typst Export PDF 导出
仓库根目录编译(共享 brand/colors.typ):
typst compile feasibility/report.typ feasibility/sample.pdf --root .
示例输出:sample.pdf
工作流
| 文件 | 说明 |
|---|---|
content/report.md |
主编辑入口:YAML 元数据 + 正文 |
content/assets/ |
图片资源(支持 .jpg / .png / .svg) |
data/config.typ |
默认公司名、副标题等(YAML 未写时使用) |
data/theme.typ |
设计 token(字号、间距、表格) |
data/styling.typ |
标题 / 表格 / 图片 #show 规范 |
data/layout.typ |
封面、摘要、页眉组件 |
report.typ |
编译入口(一般无需改动) |
YAML 元数据
在 report.md 顶部填写:
---
title: 某某矿山智能分选可行性研究
brand: GreLin
company: 西安高岭绿能科技有限公司
date: 2026-06-22
version: v1.0
summary: |
摘要正文……
---
Markdown 写法
- 章节:
# 项目概述(自动编号为 1. / 1.1 / 1.1.1,无需手写「一、二、三」) - 表格:标准 GFM 表格语法
- 图片:
或assets/chart.png,文件放在content/assets/ - 行内代码:
`ONNX Runtime`(灰底、小圆角、品牌色文字) - 代码块:
```python围栏 + 语言名,由 codly 自动语法高亮并显示语言标签 - 下划线:
<u>文字</u>(品牌色,线下移 5pt) - Emoji:正文可直接写 🐱 等符号(需系统字体支持)
- 列表、加粗等均支持(基于 cmarker)
依赖包
| 包 | 用途 |
|---|---|
| cmarker | Markdown → Typst 正文 |
| codly + codly-languages | 代码块高亮与语言标签 |
可选扩展:toutu(目录)、hydra(页眉章节名)、cetz(矢量图表)。
环境要求
- Typst ≥ 0.14.0;请使用较新版本的 Tinymist 或 Typst CLI
- 首次编译会自动下载
cmarker、codly、codly-languages(需网络)
替换外部 MD
将同事发来的 .md 覆盖 content/report.md,图片放入 content/assets/ 并修正文内路径,重新预览即可。