Skip to main content

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 资源结构迁移
  • 简繁转换和基于 pypdf 的 PDF 压缩
  • classic / small 中文稿纸
  • 简洁版和精装版 Worksheet 练习页
  • Python API

文档

完整入口:YakultPDF 用户文档。

文档 内容
工作区使用指南 目录、资源和常用工作流
CLI 命令参考 当前命令与参数
配置指南 TOML、Frontmatter、模板和封面
字体配置与下载 字体目录、安装方式和回退行为
NB 模板语法 页面和组件扩展
稿纸模式 classic、small 和着重号
Worksheet 模板 五种练习页版式
Sixgrid 模板 A4 横向 6×6 内容卡网格
Python API 程序化转换

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.11.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yakultpdf 0.11.4
File Size Uploaded Provenance Actions
yakultpdf-0.11.4.tar.gz 3.5 MB Without provenance Details for yakultpdf-0.11.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for yakultpdf 0.11.4
File Interpreter ABI Platform Actions
yakultpdf-0.11.4-py3-none-any.whl Python 3 none any Details for yakultpdf-0.11.4-py3-none-any.whl

Total release size: 4.0 MB

Release files / yakultpdf-0.11.4.tar.gz

Download URL yakultpdf-0.11.4.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
02f32e093ed024f1ad631ef83df5330af0cf97af5f89d466cedb6bcea9728a55
BLAKE2b-256 checksum
How to use checksums
5e678701503aa5515fd0499931cb8cbaa46578de8168313c0d69f87b0d8ab226
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.11.4-py3-none-any.whl

Download URL yakultpdf-0.11.4-py3-none-any.whl
Size 482.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51ceae8e47ea1079e7dc79ca45a080eeb84ca62fc48f896580681b27fc5f1b25
BLAKE2b-256 checksum
How to use checksums
ffa6f83f840facdafb8207605a7e5e5e434b52e4a2cc2026e7c0a3f0ae6825d1
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.11.4

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.11.4 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page