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