Export Feishu/Lark docs with synced blocks to Markdown and themeable PDF
Project description
lark-doc-exporter
Export Feishu/Lark docs with synced blocks expanded into:
- Markdown with localized images
- Recommended native Feishu PDF with AI-footer post-processing
- Optional locally rendered PDF when you need theme/CSS control
Requirements
- Base requirements:
lark-cliconfigured with a user session- Python 3.14
- For
--pdf-mode native:- no Chromium runtime is required
- PyMuPDF is already bundled through this package dependency
- For
--pdf-mode rendered:- a working Chrome/Chromium runtime, or the ability to install one with
uvx --from playwright playwright install chromium
- a working Chrome/Chromium runtime, or the ability to install one with
If you use uvx / uv tool install, uv can provision the required Python for
the tool environment automatically.
Quick Start
uv tool install lark-doc-exporter
lark-doc-exporter \
--doc "https://dynamia-ai.feishu.cn/wiki/BVXXwgzbZivjQZkr7jmcsGcinGh" \
--output-dir exports/native \
--formats markdown,pdf \
--pdf-mode native
That is the recommended PDF path unless you explicitly need local --theme /
--css control.
Rendered PDF Mode
Use rendered mode only when you need local styling control:
uvx --from playwright playwright install chromium
lark-doc-exporter \
--doc "https://dynamia-ai.feishu.cn/wiki/WEgBwqGYOiBoQikRzjncvJDonAg" \
--output-dir exports/rendered \
--formats markdown,pdf \
--theme default \
--pdf-mode rendered
If you already have a browser binary, you can point the exporter at it with
LARK_DOC_EXPORTER_CHROMIUM=/path/to/chromium.
Environment Check
lark-doc-exporter doctor
doctor always checks lark-cli, and it also reports Chromium readiness for
--pdf-mode rendered. Native mode does not require Chromium, so missing
Chromium no longer makes the overall doctor result fail.
One-off Run
If you do not want a persistent tool install:
uvx lark-doc-exporter \
--doc "https://dynamia-ai.feishu.cn/wiki/BVXXwgzbZivjQZkr7jmcsGcinGh" \
--output-dir exports/native \
--formats markdown,pdf \
--pdf-mode native
Install As A Tool
After installing the released package, companion-skill operations stay the same:
lark-doc-exporter skill install --dry-run
lark-doc-exporter skill install
Auto mode installs the companion skill into every detected supported host:
- Codex:
~/.agents/skills/lark-doc-exporter - Claude Code:
~/.claude/skills/lark-doc-exporter
Use --host codex, --host claude, or --host all to target specific hosts. --dry-run previews the install plan and target directories without writing files. Use --force only when you intentionally want to replace an existing unmanaged target directory.
Output
markdownkeeps the localized Markdown file in the output directory.pdfuses Feishu native PDF plus footer handling (--pdf-mode native) or local HTML/CSS + Chromium (--pdf-mode rendered).images/contains same-run localized image assets used by the Markdown/PDF.
Native PDF Mode
Prefer this mode unless you need local theme/CSS control:
lark-doc-exporter \
--doc "https://dynamia-ai.feishu.cn/wiki/BVXXwgzbZivjQZkr7jmcsGcinGh" \
--output-dir exports/native \
--formats pdf \
--pdf-mode native
Native mode rules:
- only the PDF branch changes; markdown stays on the current markdown pipeline
- explicit non-default
--theme/--cssare rejected - success states are
removedandnot_found - failure states emit warnings and keep
<stem>.native-raw.pdffor inspection
Themes
Themes and custom CSS apply only to --pdf-mode rendered.
Built-in themes:
defaultcompany
You can also layer custom CSS on top:
lark-doc-exporter \
--doc "https://dynamia-ai.feishu.cn/wiki/WEgBwqGYOiBoQikRzjncvJDonAg" \
--output-dir exports/company \
--formats pdf \
--theme company \
--css /path/to/your-company-print.css
Development / Unreleased
Use the Git URL or a local checkout only when you intentionally need unreleased code:
uvx --from git+https://github.com/spencercjh/lark-doc-exporter lark-doc-exporter doctor
git clone https://github.com/spencercjh/lark-doc-exporter
cd lark-doc-exporter
uv sync --python 3.14 --group dev
make fmt
make ci
# Optional runtime/environment check (not part of required CI)
uv run lark-doc-exporter doctor
Notes
- The current implementation still uses a temporary Feishu doc to translate the expanded XML into fresh Markdown.
- The temporary doc is deleted by default after the Markdown export step. Use
--keep-temp-doconly when you need to inspect that intermediate document. - Feishu image
authcodeURLs expire quickly, so image localization happens in the same run as the Markdown export.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lark_doc_exporter-0.4.0.tar.gz.
File metadata
- Download URL: lark_doc_exporter-0.4.0.tar.gz
- Upload date:
- Size: 35.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
178d6f69a28f9a7a66c1f5da202ca62a9a82402fec496c535435e09a027f34f1
|
|
| MD5 |
204a4e0309f117b083d8a02c8f3cd977
|
|
| BLAKE2b-256 |
ca18f4706c3c61e99c75362f88593b1665a5d28ac2dcb3052447d2ba3f4460f2
|
Provenance
The following attestation bundles were made for lark_doc_exporter-0.4.0.tar.gz:
Publisher:
publish-pypi.yml on spencercjh/lark-doc-exporter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lark_doc_exporter-0.4.0.tar.gz -
Subject digest:
178d6f69a28f9a7a66c1f5da202ca62a9a82402fec496c535435e09a027f34f1 - Sigstore transparency entry: 2034143971
- Sigstore integration time:
-
Permalink:
spencercjh/lark-doc-exporter@45b77ff9148720a2743e40a938872dde5c1f8dfa -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/spencercjh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@45b77ff9148720a2743e40a938872dde5c1f8dfa -
Trigger Event:
push
-
Statement type:
File details
Details for the file lark_doc_exporter-0.4.0-py3-none-any.whl.
File metadata
- Download URL: lark_doc_exporter-0.4.0-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2973c5c1d402631d791d28b0373c39ec5839eb5835edd1139533d2b7d0a56650
|
|
| MD5 |
ae9523ad611c8d7dd1f64d2c92588c46
|
|
| BLAKE2b-256 |
eb85eaad67faa5c018b7d11f2d1df56cf0a758b8b196904ab992472cb2835ff6
|
Provenance
The following attestation bundles were made for lark_doc_exporter-0.4.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on spencercjh/lark-doc-exporter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lark_doc_exporter-0.4.0-py3-none-any.whl -
Subject digest:
2973c5c1d402631d791d28b0373c39ec5839eb5835edd1139533d2b7d0a56650 - Sigstore transparency entry: 2034144594
- Sigstore integration time:
-
Permalink:
spencercjh/lark-doc-exporter@45b77ff9148720a2743e40a938872dde5c1f8dfa -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/spencercjh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@45b77ff9148720a2743e40a938872dde5c1f8dfa -
Trigger Event:
push
-
Statement type: