Convert Markdown to polished documents with reusable themes
Project description
DocuCraft
Stop writing PDFs by hand. Write Markdown, get a polished document.
import docu_craft
docu_craft.render("report.md", theme="scholar")
What it does
You write content in Markdown. DocuCraft handles everything else:
- Picks a theme — fonts, colors, margins, tables, code blocks, all styled consistently
- Validates structure — checks that your document has the sections it needs before rendering
- Handles emoji — replaces emoji characters with proper PNG images in the PDF
- Finds your assets — themes, skeletons, and emoji sets from the package, your home folder, or any mounted path
No more pasting CSS into scripts. No more fighting with PDF libraries. No more weasyprint.HTML(string=html, base_url='.').write_pdf(...) every time.
Install
pip install docu_craft
# with ReportLab support
pip install "docu_craft[reportlab]"
# everything
pip install "docu_craft[all]"
Themes
Built-in themes, ready to use:
| Theme | Best for |
|---|---|
scholar |
Academic articles, PhD documents |
handout |
Course materials, workshops |
tech-doc |
API docs, technical references |
official |
Institutional letters, formal reports |
docu_craft.render("thesis.md", theme="scholar")
docu_craft.render("class_notes.md", theme="handout")
Drop your own theme in ~/docu_craft/themes/mytheme/style.css and use it the same way.
Skeletons
Skeletons define what sections a document should have. DocuCraft tells you if something is missing before you render.
doc = docu_craft.Document("thesis.md")
doc.apply_skeleton("academic_article").validate() # raises if Introducción or Conclusiones missing
doc.render()
Built-in skeletons: academic_article, plan_trabajo, tech_doc, official_letter, course_handout.
Write your own in YAML or as a Python class with custom validation logic.
Emoji in PDFs
PDF fonts don't render emoji. DocuCraft swaps them for PNG images automatically.
docu_craft.render("notes.md", theme="scholar", emoji_set="twemoji")
Two sets ship with the package: noto-minimal (60 common emoji, Apache 2.0) and twemoji (3800+ emoji, CC-BY 4.0). Download more:
python -m docu_craft.emoji.downloader twemoji
python -m docu_craft.emoji.downloader noto
Config layers
Set defaults once, override whenever you need:
# ~/docu_craft/config.yaml — your personal defaults
defaults:
theme: scholar
emoji_set: twemoji
# .docu_craft.yaml — per-project overrides
defaults:
theme: handout
---
theme: official
---
# Per-document frontmatter overrides everything above
# Explicit argument wins over all of the above
docu_craft.render("file.md", theme="tech-doc")
Extended storage
Point DocuCraft at any folder — a team share, a mounted drive, a network path. It searches all of them for themes, skeletons, and emoji sets.
docu_craft.add_extended_store("/mnt/team/docu_craft-assets", name="team")
docu_craft.add_extended_store("G:/Shared/styles", name="gdrive")
Or declare it in .docu_craft.yaml:
extended_stores:
- /mnt/team/docu_craft-assets
- path: G:/Shared/styles
name: gdrive
Pluggable renderers
docu_craft.register_renderer(
format="pdf",
module_path="mypackage.renderer:MyRenderer",
engine="myengine",
package="mypackage",
install="pip install mypackage",
)
doc.render(format="pdf", engine="myengine")
| Format | Engine | Status |
|---|---|---|
| weasyprint | ✅ | |
| reportlab | 🚧 WIP |
License
Apache 2.0 © Christian A. Servin Lozano
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 docu_craft-0.1.0.tar.gz.
File metadata
- Download URL: docu_craft-0.1.0.tar.gz
- Upload date:
- Size: 357.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 |
4c41a6ae4b8eac0a86ddd251a9697a167cd7679246226e08e27c3b42ed4c69e1
|
|
| MD5 |
a8c0eb4a99f609281e79afdc7a9c12c7
|
|
| BLAKE2b-256 |
c39dec4d45900f7bdd3ff84e8c874af75dcc51abc05ce83e20b24ffacbc51870
|
Provenance
The following attestation bundles were made for docu_craft-0.1.0.tar.gz:
Publisher:
publish.yml on CServinL/docu-craft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docu_craft-0.1.0.tar.gz -
Subject digest:
4c41a6ae4b8eac0a86ddd251a9697a167cd7679246226e08e27c3b42ed4c69e1 - Sigstore transparency entry: 1459480187
- Sigstore integration time:
-
Permalink:
CServinL/docu-craft@a3810dbadeb77f291d9b330b9455e27ec86c6c1f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CServinL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3810dbadeb77f291d9b330b9455e27ec86c6c1f -
Trigger Event:
push
-
Statement type:
File details
Details for the file docu_craft-0.1.0-py3-none-any.whl.
File metadata
- Download URL: docu_craft-0.1.0-py3-none-any.whl
- Upload date:
- Size: 475.4 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 |
b3c4c4c6172b8b8b6ba45de33704bb27a73a13500d7b5771bc10cee9ad9b1703
|
|
| MD5 |
4d5541f3b8f29d89612c3615f5463aba
|
|
| BLAKE2b-256 |
4c9edeb879e7c6af71cbc87c33dbc52aa587fa1be56a99f68ebd93c99461be03
|
Provenance
The following attestation bundles were made for docu_craft-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on CServinL/docu-craft
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docu_craft-0.1.0-py3-none-any.whl -
Subject digest:
b3c4c4c6172b8b8b6ba45de33704bb27a73a13500d7b5771bc10cee9ad9b1703 - Sigstore transparency entry: 1459480650
- Sigstore integration time:
-
Permalink:
CServinL/docu-craft@a3810dbadeb77f291d9b330b9455e27ec86c6c1f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CServinL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a3810dbadeb77f291d9b330b9455e27ec86c6c1f -
Trigger Event:
push
-
Statement type: