Add your description here
Project description
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
Project details
Release history Release notifications | RSS feed
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 documentation_generator-0.1.0.tar.gz.
File metadata
- Download URL: documentation_generator-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fec69bc34f89c0f003c566ae888601e3f186cb5294bce5f81f8a85392be836d6
|
|
| MD5 |
8aa67d7fd0af81db0673762928b09dd0
|
|
| BLAKE2b-256 |
dd77c7fefb339f36095639b6fe638697610d213a1cb306763f6c25ac0643aa39
|
File details
Details for the file documentation_generator-0.1.0-py3-none-any.whl.
File metadata
- Download URL: documentation_generator-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99df7486a86823d6a1b655cb86d962c2dd399875e217c8fda9b502a494a53d11
|
|
| MD5 |
496c460b583942042b70775d7b0b9951
|
|
| BLAKE2b-256 |
03eecd417a8ce2407e4a0dc70dc92f5da3d09f45dfcb80428b09654daae6a130
|