Generates a professional PDF source code annex with Smart Index, Images and Emoji support.
Project description
📂 codeannex
Generates a professional PDF annex from a project's source code — with syntax highlighting, a hierarchical table of contents, image rendering, and intelligent font discovery.
🚀 Key Features
- Interactive Wizard 2.0 — Organized by sections (Project, Style, Typography, Layout, Filters) with smart defaults and explicit (Y/n) prompts.
- Git Integration & Version Tracking — Automatically detects Repository URL, Branch, and Commit SHA. Supports subdirectories by intelligently ignoring Git metadata if not at the root.
- Subdirectories First — Improved document organization by listing subdirectories and their contents before root files.
- Flexible File Filtering — Multi-pattern include and exclude glob filters (e.g.,
--include "src/*" --exclude "tests/*"). - Intelligent Font Discovery — Automatically finds fonts from your system (Windows, Linux, macOS) or custom paths via
--font-path. - Fully Customizable UI — Control everything: paper size (mm), margins (cm), colors (HEX), and font sizes.
- Hierarchical Summary — Real tree-structured Table of Contents with increasing page numbers and terminal-like connection lines.
- Professional Design — High-contrast line numbers, clean cover page, and smart contrast (auto-switching text between black/white based on accent brightness).
🛠 Installation
The recommended way to install codeannex is via pipx, which installs the tool in an isolated environment:
pipx install codeannex
For full SVG support (required for crisp line numbers and SVG image rendering):
pipx install "codeannex[svg]"
Alternatively, you can use standard pip: pip install codeannex
📖 Usage
Interactive Mode (Wizard)
Simply run without arguments to start the step-by-step configuration:
python3 -m codeannex
Automation / CI
python3 -m codeannex . \
--cover-title "Technical Annex" \
--primary-color "#0f4761" \
--code-size 9 \
--include "src/*" \
--exclude "*.log" \
--no-input
⚙️ Configuration Options
Git & Metadata
--repo-url URL— Manual repository URL.--branch NAME— Manual branch name.--no-git— Force disable Git integration.--repo-label LABEL— Label for repo (default: "Repository Name: ").
File Selection
--include PATTERN— Include glob pattern (can be used multiple times).--exclude PATTERN— Exclude glob pattern (can be used multiple times).
Design & Layout
--page-width MM/--page-height MM— Custom paper size in mm (default: A4).--margin CM— General margin (top, bottom, left, right).--primary-color HEX— Accent color for headers and summary icons.--code-size N— Font size for code and line numbers.
Fonts
--font-path PATH— Additional directory to search for.ttf/.otffiles.--title-font/--normal-font/--mono-font— System font names.
🧪 Testing
PYTHONPATH=. pytest
📄 License
MIT
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 codeannex-0.3.0.tar.gz.
File metadata
- Download URL: codeannex-0.3.0.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1542fe3b459843682c4fc9b5ecd32800d86347d8aa7cfdab94900c4ddbea4eba
|
|
| MD5 |
4a2d4110fc2d0d3436ee330b513bc14d
|
|
| BLAKE2b-256 |
79a1ddc9ffcbe02ab7b0d3d65d5a67f2e030e2fd357527dc72dac1240f17e31a
|
Provenance
The following attestation bundles were made for codeannex-0.3.0.tar.gz:
Publisher:
publish.yml on tanhleno/codeannex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeannex-0.3.0.tar.gz -
Subject digest:
1542fe3b459843682c4fc9b5ecd32800d86347d8aa7cfdab94900c4ddbea4eba - Sigstore transparency entry: 1239469498
- Sigstore integration time:
-
Permalink:
tanhleno/codeannex@4809ef74267ffaa0aa61f4ba33287c3b4ee1db3c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/tanhleno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4809ef74267ffaa0aa61f4ba33287c3b4ee1db3c -
Trigger Event:
push
-
Statement type:
File details
Details for the file codeannex-0.3.0-py3-none-any.whl.
File metadata
- Download URL: codeannex-0.3.0-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98d38cff2356e52c78989999a97f981e4cffd47aedbde5675ce2850be470df94
|
|
| MD5 |
03bb6568958f46f797d64dddc1cda09c
|
|
| BLAKE2b-256 |
17eee9ec2c9085a7c0c556966540933c134a1186be8bbd26e802863f8f4376f6
|
Provenance
The following attestation bundles were made for codeannex-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on tanhleno/codeannex
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codeannex-0.3.0-py3-none-any.whl -
Subject digest:
98d38cff2356e52c78989999a97f981e4cffd47aedbde5675ce2850be470df94 - Sigstore transparency entry: 1239469499
- Sigstore integration time:
-
Permalink:
tanhleno/codeannex@4809ef74267ffaa0aa61f4ba33287c3b4ee1db3c -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/tanhleno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4809ef74267ffaa0aa61f4ba33287c3b4ee1db3c -
Trigger Event:
push
-
Statement type: