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 资源结构迁移
  • 简繁转换和 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.7

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.10.7
File Size Uploaded Provenance
yakultpdf-0.10.7.tar.gz 6.1 MB Without provenance Details

Built distribution (wheel)

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

Total release size: 6.5 MB

Release files / yakultpdf-0.10.7.tar.gz

Download URL yakultpdf-0.10.7.tar.gz
Size 6.1 MB
Tags Source
SHA-256 checksum
How to use checksums
db800e10ba5bdaaddeb36a54937fcd15867256069cbc440dfff670de7b8f3ebc
BLAKE2b-256 checksum
How to use checksums
71e6252091676a4c7dd7a47e0124f7753fba574941a45f9492ec2b7a401573c5
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.7-py3-none-any.whl

Download URL yakultpdf-0.10.7-py3-none-any.whl
Size 432.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
654884c72ef701bb55d5e5ccfe71d0681d794f0748a292b801d6830ec5ff2d6b
BLAKE2b-256 checksum
How to use checksums
baa1edaa1eaf7e1c5b4339ce51a4a26b9dba45bf1312cc8c98a5dc3cd820a6aa
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.7

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.

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