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 — Run without arguments to configure your PDF step-by-step. It intelligently skips irrelevant questions (like starting page if numbering is disabled).
- Intelligent Font Discovery — Automatically finds and registers fonts from your system (Windows, Linux, macOS) by name (e.g.,
--title-font "Play"). - Fully Customizable UI — Change every label, color, and size via CLI. Default labels are in English for international consistency.
- Hierarchical Summary — Real tree-structured Table of Contents with terminal-like connection lines.
- Customizable Primary Color — Set the theme color for headers, folder icons, and accents with
--primary-color. - Smart Contrast — Automatically switches header text between black and white based on the brightness of your primary color for maximum legibility.
- Flexible Page Styling — Support for custom page background and code block colors.
- Git-Aware — Perfectly interprets
.gitignoreusing Git's native engine.
🛠 Installation
pip install codeannex
📖 Usage
Interactive Mode (Wizard)
Simply run without arguments to start the step-by-step configuration:
codeannex .
Automation / CI
Use the --no-input flag to disable the wizard in automated environments:
codeannex . --no-input
Professional Customization Example
python3 -m codeannex . \
--cover-title "Anexo I" \
--no-page-numbers \
--primary-color "#0f4761" \
--title-font "Play" --title-size 20 \
--normal-font "Times New Roman" --normal-size 12 \
--margin-top 2.5 --margin-bottom 2.5 --margin-left 3 --margin-right 3 \
--code-bg "#f5f5f5" --code-size 9
⚙️ Configuration Options
Document & Labels
--cover-title TITLE— Title for the cover (default: "ANEXO TÉCNICO").--cover-subtitle SUB— Subtitle for the cover.--summary-title TITLE— Title for the summary page.--repo-label LABEL— Prefix for repository link (default: "Repository: ").--project-label LABEL— Prefix for project name in footer.--file-part-format FMT— Format for file parts (default: "({current}/{total})").--no-input— Disable the interactive wizard.
Colors & Themes
--primary-color HEX— Main color for headers and accents.--page-bg-color HEX— Background color for all pages.--code-bg HEX— Background color for code blocks.--normal-color HEX/--title-color HEX— Text colors.
Fonts & Sizes
--title-font/--subtitle-font/--normal-font— System font names.--mono-font— Font for code (e.g., "Consolas", "Ubuntu Mono").--emoji-font— Font for emojis (e.g., "Noto Emoji").--code-size N— Font size for code blocks.
Layout
--margin CM— General margin for all sides.--margin-top,--margin-bottom,--margin-left,--margin-right— Specific margins in cm.--no-page-numbers— Disable page numbering.
🧪 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.2.0.tar.gz.
File metadata
- Download URL: codeannex-0.2.0.tar.gz
- Upload date:
- Size: 27.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 |
a9259e869b238ad50ae878627b90f9b2df3cf093d0a2d175ff272d57393a0da0
|
|
| MD5 |
4c784d4950f9992a28faf92a2ca8c87c
|
|
| BLAKE2b-256 |
6962199b7b2aec7feef760c7ea839037aef738dae2e46ed9b63235de1aa2b375
|
Provenance
The following attestation bundles were made for codeannex-0.2.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.2.0.tar.gz -
Subject digest:
a9259e869b238ad50ae878627b90f9b2df3cf093d0a2d175ff272d57393a0da0 - Sigstore transparency entry: 1238029415
- Sigstore integration time:
-
Permalink:
tanhleno/codeannex@913b87e4ae09eec8294de44ca58981b6ac629942 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/tanhleno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@913b87e4ae09eec8294de44ca58981b6ac629942 -
Trigger Event:
push
-
Statement type:
File details
Details for the file codeannex-0.2.0-py3-none-any.whl.
File metadata
- Download URL: codeannex-0.2.0-py3-none-any.whl
- Upload date:
- Size: 22.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 |
f82f15a655fdfa49a0a5eca11387f55610f6718da68e40890e5a2daf72d7cf95
|
|
| MD5 |
fe6ba79a82fbc0b030792970cc5bc06b
|
|
| BLAKE2b-256 |
4964e929e7e99e69fa8892ab8e81e021727fa76f9bfe17ebe7b20ea11daede4d
|
Provenance
The following attestation bundles were made for codeannex-0.2.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.2.0-py3-none-any.whl -
Subject digest:
f82f15a655fdfa49a0a5eca11387f55610f6718da68e40890e5a2daf72d7cf95 - Sigstore transparency entry: 1238029417
- Sigstore integration time:
-
Permalink:
tanhleno/codeannex@913b87e4ae09eec8294de44ca58981b6ac629942 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/tanhleno
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@913b87e4ae09eec8294de44ca58981b6ac629942 -
Trigger Event:
push
-
Statement type: