YakultPDF
YakultPDF 是一个基于 Pandoc 和 Typst 的 Markdown → PDF 工具库和命令行程序,面向中文报告、书籍、稿纸和 3:4 练习页。
- PyPI 包名:
yakultpdf - 命令行:
yakultpdf - Python 导入名:
mark2pdf
Markdown + 配置 → YakultPDF / Pandoc → Typst 模板 → PDF
系统要求
- Python 3.11+
- Pandoc
- Typst
完整安装方法见安装指引。
快速开始
安装 Python 包:
uv tool install yakultpdf
确认三个组件可用:
yakultpdf --version
pandoc --version
typst --version
准备 demo.md:
# 我的第一份 PDF
这是由 YakultPDF 生成的文档。
转换并使用输入文件名作为输出名:
yakultpdf convert demo.md --force-filename
独立模式会在当前目录生成 demo.pdf。更多内容见快速开始。
工作区
长期项目建议初始化工作区:
yakultpdf init my-docs
cd my-docs
yakultpdf convert index.md
工作区使用 mark2pdf.config.toml 管理输入、输出、模板和字体,PDF 默认写入 out/。
[paths]
in = "."
out = "out"
tmp = "tmp"
template = "template"
fonts = "fonts"
[options]
default_template = "nb"
withcover = false
overwrite = false
配置、Frontmatter 和封面规则见配置指南。
主要能力
- 单文件、目录合并和批量转换
- 工作区本地模板、字体和资源管理
- NB 模板的封面、目录、背景页、整页图片和 Mermaid
- 远程图片下载与 Markdown 资源结构迁移
- 简繁转换和 PDF 压缩
- classic / small 中文稿纸
- 简洁版和精装版 Worksheet 练习页
- Python API
文档
完整入口:YakultPDF 用户文档。
| 文档 | 内容 |
|---|---|
| 工作区使用指南 | 目录、资源和常用工作流 |
| CLI 命令参考 | 当前命令与参数 |
| 配置指南 | TOML、Frontmatter、模板和封面 |
| NB 模板语法 | 页面和组件扩展 |
| 稿纸模式 | classic、small 和着重号 |
| Worksheet 模板 | 五种练习页版式 |
| Python API | 程序化转换 |
| Docker 与 Web 服务 | 容器部署 |
Python API
from mark2pdf import convert_file
from mark2pdf.core import ConversionOptions
result = convert_file(
"input.md",
output_file="output.pdf",
options=ConversionOptions(overwrite=True, force_filename=True),
)
完整签名和目录转换示例见Python API 文档。
开发与测试
uv sync
uv run pytest
项目架构见 DEVELOPMENT.md,发布流程见 RELEASING.md。Agent 规则见 AGENTS.md。
License
MIT
Metadata
Release files for yakultpdf 0.10.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| yakultpdf-0.10.11.tar.gz | 6.1 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yakultpdf-0.10.11-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.6 MB
Release files / yakultpdf-0.10.11.tar.gz
| Download URL | yakultpdf-0.10.11.tar.gz |
|---|---|
| Size | 6.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
928594e7f3696f3a304795db192cd364bd61842cdf3e18ea61a868e23c6fc2b9
|
|
BLAKE2b-256 checksum How to use checksums |
42dc9654a3a358bade8e1bf6099c95575f8b2e49788617d6954c1c78c6fe6d6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / yakultpdf-0.10.11-py3-none-any.whl
| Download URL | yakultpdf-0.10.11-py3-none-any.whl |
|---|---|
| Size | 433.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
847e9b2866d3abac18da899437b4c88f1a8ebec6a36de8cb53e5b1583dc5668d
|
|
BLAKE2b-256 checksum How to use checksums |
73fe20aff9c429221ec5c2244262a134a121c6ff0991347eba627657b817b959
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.1 {"installer":{"name":"uv","version":"0.13.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for yakultpdf 0.10.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.