Skip to main content

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, and fenced_code extensions.

Testing

pip install -e .[dev]
pytest -q

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

documentation_generator-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

documentation_generator-0.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file documentation_generator-0.1.0.tar.gz.

File metadata

File hashes

Hashes for documentation_generator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fec69bc34f89c0f003c566ae888601e3f186cb5294bce5f81f8a85392be836d6
MD5 8aa67d7fd0af81db0673762928b09dd0
BLAKE2b-256 dd77c7fefb339f36095639b6fe638697610d213a1cb306763f6c25ac0643aa39

See more details on using hashes here.

File details

Details for the file documentation_generator-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for documentation_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99df7486a86823d6a1b655cb86d962c2dd399875e217c8fda9b502a494a53d11
MD5 496c460b583942042b70775d7b0b9951
BLAKE2b-256 03eecd417a8ce2407e4a0dc70dc92f5da3d09f45dfcb80428b09654daae6a130

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page