documentation-generator
Tiny, composable Markdown document builder with optional HTML/PDF export.
Features
- Build documents by chaining: paragraphs, tables, lists, code blocks, and remarks.
- Render to Markdown; convert to HTML (Markdown lib) or PDF (WeasyPrint).
- Tables render in GitHub‑style Markdown (via tabulate).
Requirements
- Python 3.13+
Installation
pip install -e . # install project (editable)
# or just runtime deps
pip install tabulate Markdown
# to enable PDF export
pip install weasyprint
# dev/test extras
pip install -e .[dev]
Quick Start
from document import Document
import pandas as pd
doc = (
Document()
.add_title("Sample Doc")
.add_paragraph("Intro text", heading="Introduction")
.add_list(["alpha", "beta", "gamma", "delta"], heading="Things")
.add_codeblock("print('hello')", language="python")
.add_remark("Remember to pin versions.", kind="TIP")
)
# Tables accept pandas or polars DataFrame
df = pd.DataFrame({"a": [1, 2], "b": [3, 4]})
doc.add_table(df, heading="Data", footer="auto‑generated")
# Render as Markdown string
markdown_text = doc.render()
print(markdown_text)
# Save to files
doc.save_as("md") # writes document.md
doc.save_as("html") # writes document.html
# Requires: pip install weasyprint
doc.save_as("pdf") # writes document.pdf
Remarks (Admonitions)
add_remark(text, kind)supports:INFO,WARNING,DANGER,TIP.- Uses Markdown admonition syntax, e.g.
!!! warning. - HTML conversion enables
admonition,tables, andfenced_codeextensions.
Testing
pip install -e .[dev]
pytest -q
Release files for documentation-generator 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| documentation_generator-0.1.0.tar.gz | 8.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| documentation_generator-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.7 kB
Release files / documentation_generator-0.1.0.tar.gz
| Download URL | documentation_generator-0.1.0.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fec69bc34f89c0f003c566ae888601e3f186cb5294bce5f81f8a85392be836d6
|
|
BLAKE2b-256 checksum How to use checksums |
dd77c7fefb339f36095639b6fe638697610d213a1cb306763f6c25ac0643aa39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.10
|
Release files / documentation_generator-0.1.0-py3-none-any.whl
| Download URL | documentation_generator-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
99df7486a86823d6a1b655cb86d962c2dd399875e217c8fda9b502a494a53d11
|
|
BLAKE2b-256 checksum How to use checksums |
03eecd417a8ce2407e4a0dc70dc92f5da3d09f45dfcb80428b09654daae6a130
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.10
|