codeannex 0.4.2__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codeannex-0.4.2 → codeannex-0.4.3}/PKG-INFO +1 -1
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/interface/cli.py +78 -72
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/PKG-INFO +1 -1
- {codeannex-0.4.2 → codeannex-0.4.3}/pyproject.toml +1 -1
- {codeannex-0.4.2 → codeannex-0.4.3}/LICENSE +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/README.md +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/__init__.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/__main__.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/core/__init__.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/core/config.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/core/pdf_builder.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/interface/__init__.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/io/__init__.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/io/file_utils.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/io/git_utils.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/renderer/__init__.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/renderer/fonts.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/renderer/highlight.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/renderer/text_utils.py +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/SOURCES.txt +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/dependency_links.txt +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/entry_points.txt +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/requires.txt +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/top_level.txt +0 -0
- {codeannex-0.4.2 → codeannex-0.4.3}/setup.cfg +0 -0
|
@@ -78,84 +78,90 @@ def _input_field(label, default):
|
|
|
78
78
|
return input(prompt).strip()
|
|
79
79
|
|
|
80
80
|
def run_interactive_wizard(args):
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
try:
|
|
82
|
+
print(f"\n{BOLD}{BLUE}✨ Welcome to codeannex Interactive Wizard! ✨{RESET}")
|
|
83
|
+
print(f"{YELLOW}Uppercase letters in prompts indicate the [default] action on Enter.{RESET}\n")
|
|
84
|
+
|
|
85
|
+
root = Path(args.dir).resolve()
|
|
86
|
+
git_url, git_branch, _ = get_git_info(root)
|
|
87
|
+
remotes = get_git_remotes(root)
|
|
88
|
+
total_steps = 6
|
|
88
89
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
# 1. Project Identity
|
|
91
|
+
_print_header(1, total_steps, "Project Identity", "Basic identification of your document")
|
|
92
|
+
args.name = _input_field("Project Name", args.name or root.name) or (args.name or root.name)
|
|
92
93
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
94
|
+
# 2. Repository Info
|
|
95
|
+
has_git = bool(remotes or git_branch)
|
|
96
|
+
if has_git:
|
|
97
|
+
if len(remotes) > 1:
|
|
98
|
+
_print_header(2, total_steps, "Repository Info", "Multiple Git remotes detected")
|
|
99
|
+
print(f" Available remotes:")
|
|
100
|
+
remote_names = list(remotes.keys())
|
|
101
|
+
for i, name in enumerate(remote_names, 1):
|
|
102
|
+
print(f" {i}. {name} ({remotes[name]})")
|
|
103
|
+
|
|
104
|
+
choice = _input_field("Select remote (number) or press Enter for origin", "1")
|
|
105
|
+
if choice.isdigit() and 1 <= int(choice) <= len(remote_names):
|
|
106
|
+
selected_remote = remote_names[int(choice)-1]
|
|
107
|
+
git_url = remotes[selected_remote]
|
|
108
|
+
elif "origin" in remotes:
|
|
109
|
+
git_url = remotes["origin"]
|
|
110
|
+
else:
|
|
111
|
+
git_url = remotes[remote_names[0]]
|
|
112
|
+
elif len(remotes) == 1:
|
|
113
|
+
git_url = list(remotes.values())[0]
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
_print_header(2, total_steps, "Repository Info", f"Detected: {git_branch or 'N/A'} @ {git_url or 'N/A'}")
|
|
116
|
+
if input(f" Use detected Git info? ({GREEN}Y{RESET}/n): ").strip().lower() != 'n':
|
|
117
|
+
args.branch = git_branch
|
|
118
|
+
args.repo_url = git_url
|
|
119
|
+
else:
|
|
120
|
+
args.branch = _input_field("Branch Name", git_branch or 'None') or git_branch
|
|
121
|
+
args.repo_url = _input_field("Repository URL", git_url or 'None') or git_url
|
|
118
122
|
else:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
if _ask_section(2, total_steps, "Repository Info", "Branch and Repository URL (No Git detected)"):
|
|
123
|
-
args.branch = _input_field("Branch Name", "None") or None
|
|
124
|
-
args.repo_url = _input_field("Repository URL", "None") or None
|
|
123
|
+
if _ask_section(2, total_steps, "Repository Info", "Branch and Repository URL (No Git detected)"):
|
|
124
|
+
args.branch = _input_field("Branch Name", "None") or None
|
|
125
|
+
args.repo_url = _input_field("Repository URL", "None") or None
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
127
|
+
# 3. Visual Style
|
|
128
|
+
if _ask_section(3, total_steps, "Visual Style", "Titles, Subtitles, Accent Colors"):
|
|
129
|
+
args.cover_title = _input_field("Cover Title", args.cover_title) or args.cover_title
|
|
130
|
+
args.cover_subtitle = _input_field("Cover Subtitle", args.cover_subtitle) or args.cover_subtitle
|
|
131
|
+
args.primary_color = _input_field("Primary Accent Color (HEX)", args.primary_color) or args.primary_color
|
|
132
|
+
args.title_color = _input_field("Title Color (HEX)", args.title_color) or args.title_color
|
|
132
133
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
134
|
+
# 4. Typography
|
|
135
|
+
if _ask_section(4, total_steps, "Typography", "Fonts and Text Sizes"):
|
|
136
|
+
args.title_font = _input_field("Title Font", args.title_font or 'Helvetica') or args.title_font
|
|
137
|
+
args.normal_font = _input_field("Normal Font", args.normal_font or 'Helvetica') or args.normal_font
|
|
138
|
+
args.mono_font = _input_field("Monospace Font", args.mono_font or 'Auto') or args.mono_font
|
|
139
|
+
args.code_size = int(_input_field("Code Font Size", args.code_size) or args.code_size)
|
|
140
|
+
|
|
141
|
+
paths = _input_field("Additional Font Paths (comma-separated)", "None")
|
|
142
|
+
if paths:
|
|
143
|
+
args.font_path = [p.strip() for p in paths.split(",") if p.strip()]
|
|
144
|
+
|
|
145
|
+
# 5. Page Layout
|
|
146
|
+
if _ask_section(5, total_steps, "Page Layout & Margins", "Margins, Paper Size, Page Numbering"):
|
|
147
|
+
args.margin_top = float(_input_field("Top Margin (cm)", args.margin_top or 2.0) or (args.margin_top or 2.0))
|
|
148
|
+
args.margin_bottom = float(_input_field("Bottom Margin (cm)", args.margin_bottom or 2.0) or (args.margin_bottom or 2.0))
|
|
149
|
+
args.page_width = float(_input_field("Page Width (mm)", 210.0) or 210.0)
|
|
150
|
+
args.page_height = float(_input_field("Page Height (mm)", 297.0) or 297.0)
|
|
151
|
+
args.no_page_numbers = input(f" Disable page numbers? (y/{GREEN}N{RESET}): ").strip().lower() == 'y'
|
|
152
|
+
if not args.no_page_numbers:
|
|
153
|
+
args.start_page = int(_input_field("Start Page Number", args.start_page) or args.start_page)
|
|
143
154
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
args.no_page_numbers = input(f" Disable page numbers? (y/{GREEN}N{RESET}): ").strip().lower() == 'y'
|
|
151
|
-
if not args.no_page_numbers:
|
|
152
|
-
args.start_page = int(_input_field("Start Page Number", args.start_page) or args.start_page)
|
|
155
|
+
# 6. Filters
|
|
156
|
+
if _ask_section(6, total_steps, "File Filters", "Include/Exclude patterns (glob)"):
|
|
157
|
+
inc = _input_field("Include Patterns (comma-separated)", "None")
|
|
158
|
+
if inc: args.include = [p.strip() for p in inc.split(",") if p.strip()]
|
|
159
|
+
exc = _input_field("Exclude Patterns (comma-separated)", "None")
|
|
160
|
+
if exc: args.exclude = [p.strip() for p in exc.split(",") if p.strip()]
|
|
153
161
|
|
|
154
|
-
|
|
155
|
-
if _ask_section(6, total_steps, "File Filters", "Include/Exclude patterns (glob)"):
|
|
156
|
-
inc = _input_field("Include Patterns (comma-separated)", "None")
|
|
157
|
-
if inc: args.include = [p.strip() for p in inc.split(",") if p.strip()]
|
|
158
|
-
exc = _input_field("Exclude Patterns (comma-separated)", "None")
|
|
159
|
-
if exc: args.exclude = [p.strip() for p in exc.split(",") if p.strip()]
|
|
162
|
+
print(f"\n{BOLD}{GREEN}🚀 Configuration complete! Generating PDF...{RESET}\n")
|
|
160
163
|
|
|
161
|
-
|
|
164
|
+
except KeyboardInterrupt:
|
|
165
|
+
import sys
|
|
166
|
+
print(f"\n\n{YELLOW}⚠️ Wizard aborted by user (Ctrl+C).{RESET}")
|
|
167
|
+
sys.exit(0)
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "codeannex"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.3"
|
|
8
8
|
description = "Generates a professional PDF source code annex with Smart Index, Images and Emoji support."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|