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.
Files changed (25) hide show
  1. {codeannex-0.4.2 → codeannex-0.4.3}/PKG-INFO +1 -1
  2. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/interface/cli.py +78 -72
  3. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/PKG-INFO +1 -1
  4. {codeannex-0.4.2 → codeannex-0.4.3}/pyproject.toml +1 -1
  5. {codeannex-0.4.2 → codeannex-0.4.3}/LICENSE +0 -0
  6. {codeannex-0.4.2 → codeannex-0.4.3}/README.md +0 -0
  7. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/__init__.py +0 -0
  8. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/__main__.py +0 -0
  9. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/core/__init__.py +0 -0
  10. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/core/config.py +0 -0
  11. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/core/pdf_builder.py +0 -0
  12. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/interface/__init__.py +0 -0
  13. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/io/__init__.py +0 -0
  14. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/io/file_utils.py +0 -0
  15. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/io/git_utils.py +0 -0
  16. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/renderer/__init__.py +0 -0
  17. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/renderer/fonts.py +0 -0
  18. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/renderer/highlight.py +0 -0
  19. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex/renderer/text_utils.py +0 -0
  20. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/SOURCES.txt +0 -0
  21. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/dependency_links.txt +0 -0
  22. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/entry_points.txt +0 -0
  23. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/requires.txt +0 -0
  24. {codeannex-0.4.2 → codeannex-0.4.3}/codeannex.egg-info/top_level.txt +0 -0
  25. {codeannex-0.4.2 → codeannex-0.4.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeannex
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: Generates a professional PDF source code annex with Smart Index, Images and Emoji support.
5
5
  License: MIT
6
6
  Project-URL: Repository, https://github.com/tanhleno/codeannex
@@ -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
- print(f"\n{BOLD}{BLUE}✨ Welcome to codeannex Interactive Wizard! ✨{RESET}")
82
- print(f"{YELLOW}Uppercase letters in prompts indicate the [default] action on Enter.{RESET}\n")
83
-
84
- root = Path(args.dir).resolve()
85
- git_url, git_branch, _ = get_git_info(root)
86
- remotes = get_git_remotes(root)
87
- total_steps = 6
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
- # 1. Project Identity
90
- _print_header(1, total_steps, "Project Identity", "Basic identification of your document")
91
- args.name = _input_field("Project Name", args.name or root.name) or (args.name or root.name)
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
- # 2. Repository Info
94
- has_git = bool(remotes or git_branch)
95
- if has_git:
96
- if len(remotes) > 1:
97
- _print_header(2, total_steps, "Repository Info", "Multiple Git remotes detected")
98
- print(f" Available remotes:")
99
- remote_names = list(remotes.keys())
100
- for i, name in enumerate(remote_names, 1):
101
- print(f" {i}. {name} ({remotes[name]})")
102
-
103
- choice = _input_field("Select remote (number) or press Enter for origin", "1")
104
- if choice.isdigit() and 1 <= int(choice) <= len(remote_names):
105
- selected_remote = remote_names[int(choice)-1]
106
- git_url = remotes[selected_remote]
107
- elif "origin" in remotes:
108
- git_url = remotes["origin"]
109
- else:
110
- git_url = remotes[remote_names[0]]
111
- elif len(remotes) == 1:
112
- git_url = list(remotes.values())[0]
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
- _print_header(2, total_steps, "Repository Info", f"Detected: {git_branch or 'N/A'} @ {git_url or 'N/A'}")
115
- if input(f" Use detected Git info? ({GREEN}Y{RESET}/n): ").strip().lower() != 'n':
116
- args.branch = git_branch
117
- args.repo_url = git_url
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
- args.branch = _input_field("Branch Name", git_branch or 'None') or git_branch
120
- args.repo_url = _input_field("Repository URL", git_url or 'None') or git_url
121
- else:
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
- # 3. Visual Style
127
- if _ask_section(3, total_steps, "Visual Style", "Titles, Subtitles, Accent Colors"):
128
- args.cover_title = _input_field("Cover Title", args.cover_title) or args.cover_title
129
- args.cover_subtitle = _input_field("Cover Subtitle", args.cover_subtitle) or args.cover_subtitle
130
- args.primary_color = _input_field("Primary Accent Color (HEX)", args.primary_color) or args.primary_color
131
- args.title_color = _input_field("Title Color (HEX)", args.title_color) or args.title_color
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
- # 4. Typography
134
- if _ask_section(4, total_steps, "Typography", "Fonts and Text Sizes"):
135
- args.title_font = _input_field("Title Font", args.title_font or 'Helvetica') or args.title_font
136
- args.normal_font = _input_field("Normal Font", args.normal_font or 'Helvetica') or args.normal_font
137
- args.mono_font = _input_field("Monospace Font", args.mono_font or 'Auto') or args.mono_font
138
- args.code_size = int(_input_field("Code Font Size", args.code_size) or args.code_size)
139
-
140
- paths = _input_field("Additional Font Paths (comma-separated)", "None")
141
- if paths:
142
- args.font_path = [p.strip() for p in paths.split(",") if p.strip()]
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
- # 5. Page Layout
145
- if _ask_section(5, total_steps, "Page Layout & Margins", "Margins, Paper Size, Page Numbering"):
146
- args.margin_top = float(_input_field("Top Margin (cm)", args.margin_top or 2.0) or (args.margin_top or 2.0))
147
- args.margin_bottom = float(_input_field("Bottom Margin (cm)", args.margin_bottom or 2.0) or (args.margin_bottom or 2.0))
148
- args.page_width = float(_input_field("Page Width (mm)", 210.0) or 210.0)
149
- args.page_height = float(_input_field("Page Height (mm)", 297.0) or 297.0)
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
- # 6. Filters
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
- print(f"\n{BOLD}{GREEN}🚀 Configuration complete! Generating PDF...{RESET}\n")
164
+ except KeyboardInterrupt:
165
+ import sys
166
+ print(f"\n\n{YELLOW}⚠️ Wizard aborted by user (Ctrl+C).{RESET}")
167
+ sys.exit(0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeannex
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: Generates a professional PDF source code annex with Smart Index, Images and Emoji support.
5
5
  License: MIT
6
6
  Project-URL: Repository, https://github.com/tanhleno/codeannex
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codeannex"
7
- version = "0.4.2"
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