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 — featuring syntax highlighting, a hierarchical table of contents, image rendering, and version tracking.
🚀 Key Features
- Interactive Wizard 2.0 — Step-by-step configuration with smart sections (Project, Style, Typography, Layout, Filters) and explicit default prompts.
- Git Version Tracking — Automatically detects Repository URL, Branch, and Commit SHA. Smart root detection avoids Git metadata on subdirectories.
- Smart SVG Rendering — Files are rendered as both a high-quality image and XML code. Entries are intelligently deduplicated in the summary.
- Improved Document Structure — Subdirectories and their contents are listed before root files for better organization.
- High-Contrast Design — Redesigned cover page, thickened image frames, and optimized line number legibility.
- Intelligent Font Discovery — Automatically finds fonts from your system or custom directories via
--font-path. - Flexible File Filtering — Multi-pattern include and exclude glob filters (e.g.,
--include "src/*" --exclude "tests/*"). - Pro-Level UI — Control paper size (mm), margins (cm), accent colors (HEX), and font sizes.
🛠 Installation
The recommended way to install codeannex is via pipx:
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 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
Default output filename is {project_name}_code_annex.pdf.
⚙️ 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: ").
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, summary icons, and links.--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 tests --cov=codeannex
📄 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.4.3.tar.gz.
File metadata
- Download URL: codeannex-0.4.3.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62ece05af03a3de985e930d810db1386523bddcf144d30d008f363cae1997775
|
|
| MD5 |
5d19be9734d85e8b2c360663241709e0
|
|
| BLAKE2b-256 |
c651632aa1fc817ebab5b50cbc1a43da55d09f9def324be4cfd36a346580a36b
|
Provenance
The following attestation bundles were made for codeannex-0.4.3.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.4.3.tar.gz -
Subject digest:
62ece05af03a3de985e930d810db1386523bddcf144d30d008f363cae1997775 - Sigstore transparency entry: 1245134560
- Sigstore integration time:
-
Permalink:
tanhleno/codeannex@40545d8afe54b014cdf538ab42bdbfc6f0a4dc89 -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/tanhleno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@40545d8afe54b014cdf538ab42bdbfc6f0a4dc89 -
Trigger Event:
push
-
Statement type:
File details
Details for the file codeannex-0.4.3-py3-none-any.whl.
File metadata
- Download URL: codeannex-0.4.3-py3-none-any.whl
- Upload date:
- Size: 23.9 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 |
42d21c3541fe06b7c30fe607ed646c366a9c27bdc902e5842da05969dc9ffb71
|
|
| MD5 |
5c53ff75ec3114a90c01e76d29907450
|
|
| BLAKE2b-256 |
07b0258b2905f43c8f781cdd585169ec1a77e3c1b8d46c97bcff0579056b6771
|
Provenance
The following attestation bundles were made for codeannex-0.4.3-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.4.3-py3-none-any.whl -
Subject digest:
42d21c3541fe06b7c30fe607ed646c366a9c27bdc902e5842da05969dc9ffb71 - Sigstore transparency entry: 1245134565
- Sigstore integration time:
-
Permalink:
tanhleno/codeannex@40545d8afe54b014cdf538ab42bdbfc6f0a4dc89 -
Branch / Tag:
refs/tags/v0.4.3 - Owner: https://github.com/tanhleno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@40545d8afe54b014cdf538ab42bdbfc6f0a4dc89 -
Trigger Event:
push
-
Statement type: