Skip to main content

Generate forensic report using docxtpl templates

Project description

laudo

Convert markdown files to docx or pdf using docxtpl templates.

Installation

pip install laudo

Requires Python 3.13+ and LibreOffice for PDF output.

Usage

CLI

laudo gen [--dir <folder>] [--debug] [--pdf] [--output <path>] [--template <path>]
laudo captions [--dir <folder>]
laudo template <name> [--dir <folder>]
laudo vars [--dir <folder>]
laudo init <name> [--dir <folder>]
laudo install

Python API

from laudo import convert

convert("my_project/", "output.docx")
convert("my_project/", "output.pdf")

Input Folder Structure

my_project/
├── template.docx          # docxtpl template with Jinja2 placeholders
├── fotos/                 # Images (captions edited via GUI)
│   ├── image1.png
│   └── events/
│       └── party.jpg
├── context.txt            # (optional) Variables one per line: key = value
├── intro.md               # One or more .md files
└── chapter-1.md

Template

A standard Word document using docxtpl syntax with Jinja2 placeholders like {{ variable }} or {{p intro|markdown }}.

To use a template from a shared folder, create .laudo/.template with the template name and set the LAUDOS_TEMPLATES_FOLDER environment variable.

context.txt

Optional file with variables in key = value format, one per line. Lines starting with # and empty lines are ignored. These variables are available for substitution inside .md files via {{ varname }}.

Markdown files

Every .md file is read and its content is injected as a template variable named after the filename (without extension, spaces → underscores):

File Template variable
intro.md intro
chapter 1.md chapter_1

Inside markdown files you can reference context variables with {{ varname }} and embed image groups with image_group(name, cols).

Images

All images in fotos/ (including subdirectories) are available as the pics variable in templates. Use pics.group("events") to get images from a subfolder, or pics.all for all images. Captions are edited via the laudo captions GUI.

Template helpers

  • {{p variable\|markdown }} — render markdown as formatted docx content
  • {{p subdoc("file.docx", key=val) }} — embed a sub-template
  • {{p image("fotos/logo.png", width=50) }} — inline image with size control

License

MIT

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

laudo-0.2.1.tar.gz (94.6 kB view details)

Uploaded Source

Built Distribution

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

laudo-0.2.1-py3-none-any.whl (100.0 kB view details)

Uploaded Python 3

File details

Details for the file laudo-0.2.1.tar.gz.

File metadata

  • Download URL: laudo-0.2.1.tar.gz
  • Upload date:
  • Size: 94.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for laudo-0.2.1.tar.gz
Algorithm Hash digest
SHA256 3332f92d77c11915ca80e1101d38b72770106206347af64f684d1ae47784643a
MD5 3aab58c08bcfa47563601aceaa89e254
BLAKE2b-256 e3426fe335875cd078c6b11e4ec518253bc68375ef9f808a717a2725fcaee1c2

See more details on using hashes here.

File details

Details for the file laudo-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: laudo-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 100.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for laudo-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2e7a667820be858b101fd2425e467df408cb5a7ea8672d464453912737c1996b
MD5 1dfda4039809b783dc07aee86373ae67
BLAKE2b-256 dd86f16412cb1aa6b67c1e7161223e5527794b999cffbfd88c5e16326ff6514e

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