Typst 项目使用教程
1. 项目的目录结构及介绍
Typst 项目的目录结构如下:
typst/
├── Cargo.lock
├── Cargo.toml
├── CONTRIBUTING.md
├── CITATION.cff
├── Dockerfile
├── LICENSE
├── NOTICE
├── README.md
├── editorconfig
├── envrc
├── flake.lock
├── flake.nix
├── gitignore
├── rustfmt.toml
├── docs/
├── crates/
├── tests/
└── tools/
目录结构介绍
Cargo.lock
和Cargo.toml
: Rust 项目的依赖管理文件。CONTRIBUTING.md
: 贡献指南。CITATION.cff
: 引用信息。Dockerfile
: Docker 容器配置文件。LICENSE
: 项目许可证。NOTICE
: 项目通知。README.md
: 项目介绍和使用说明。editorconfig
,envrc
,gitignore
,rustfmt.toml
: 项目配置文件。docs/
: 文档目录。crates/
: Rust 包目录。tests/
: 测试目录。tools/
: 工具目录。
2. 项目的启动文件介绍
Typst 项目的启动文件主要是 Cargo.toml
和 main.rs
(假设在 crates/
目录下)。
Cargo.toml
Cargo.toml
是 Rust 项目的配置文件,包含了项目的元数据和依赖信息。
main.rs
main.rs
是 Rust 项目的入口文件,通常位于 crates/
目录下的某个子目录中。
3. 项目的配置文件介绍
Typst 项目的配置文件主要包括:
Cargo.toml
Cargo.toml
包含了项目的依赖、构建选项和其他配置信息。
rustfmt.toml
rustfmt.toml
是 Rust 代码格式化工具 rustfmt
的配置文件,用于定义代码风格。
Dockerfile
Dockerfile
用于构建 Docker 容器,包含了项目的运行环境和依赖。
editorconfig
editorconfig
文件用于定义编辑器的行为,如缩进风格、字符编码等。
gitignore
gitignore
文件用于指定 Git 版本控制系统忽略的文件和目录。
envrc
envrc
文件用于定义环境变量,通常与 direnv
工具配合使用。
以上是 Typst 项目的基本使用教程,涵盖了项目的目录结构、启动文件和配置文件的介绍。