diff --git a/README.md b/README.md index fe04fb59..4cf51470 100644 --- a/README.md +++ b/README.md @@ -459,9 +459,9 @@

- - - Agent Skills + + + Agent Skills

@@ -523,9 +523,9 @@ _Easily generate web assets from Claude Code including favicons, app icons (PWA)

- - - Workflows & Knowledge Guides + + + Workflows & Knowledge Guides

@@ -1055,9 +1055,9 @@ _A Rust CLI tool that lets you delegate development tasks to AI agents running i

- - - Status Lines + + + Status Lines

@@ -1625,9 +1625,9 @@ _Reformats documentation to use React Stepper component, transforming heading fo

- - - CLAUDE.md Files + + + CLAUDE.md Files

diff --git a/assets/card-clients-light-anim-lineprint.svg b/assets/card-clients-light-anim-lineprint.svg index 8794d5ce..ee0f8753 100644 --- a/assets/card-clients-light-anim-lineprint.svg +++ b/assets/card-clients-light-anim-lineprint.svg @@ -23,11 +23,11 @@ 08 - Clients - - Alternative UIs - & front-ends - §8 + Clients + + Alternative UIs + & front-ends + §8 diff --git a/assets/card-clients.svg b/assets/card-clients.svg index 39553ffc..c1ab77b4 100644 --- a/assets/card-clients.svg +++ b/assets/card-clients.svg @@ -1,10 +1,9 @@ - + - + - @@ -41,14 +40,14 @@ - - 📱 CLIENTS - + + CLIENTS + - + Alternative UIs - + & front-ends diff --git a/assets/card-commands-light-anim-lineprint.svg b/assets/card-commands-light-anim-lineprint.svg index 0cde04d8..89029066 100644 --- a/assets/card-commands-light-anim-lineprint.svg +++ b/assets/card-commands-light-anim-lineprint.svg @@ -23,11 +23,11 @@ 06 - Commands - - Slash-commands - & shortcuts - §6 + Commands + + Slash-commands + & shortcuts + §6 diff --git a/assets/card-commands.svg b/assets/card-commands.svg index 422ebaea..561859b3 100644 --- a/assets/card-commands.svg +++ b/assets/card-commands.svg @@ -1,9 +1,8 @@ - + - @@ -32,14 +31,14 @@ - - 🔪 COMMANDS - + + COMMANDS + - + Slash-commands - + & shortcuts diff --git a/assets/card-config-light-anim-lineprint.svg b/assets/card-config-light-anim-lineprint.svg index 9db330cb..82b83bfc 100644 --- a/assets/card-config-light-anim-lineprint.svg +++ b/assets/card-config-light-anim-lineprint.svg @@ -23,11 +23,11 @@ 07 - CLAUDE.md - - Config files - & project setup - §7 + CLAUDE.md + + Config files + & project setup + §7 diff --git a/assets/card-config.svg b/assets/card-config.svg index e1c7358c..0e3fb316 100644 --- a/assets/card-config.svg +++ b/assets/card-config.svg @@ -1,9 +1,8 @@ - + - @@ -32,14 +31,14 @@ - - 📂 CLAUDE.MD - + + CLAUDE.MD + - + CLAUDE.md files - + & project setup diff --git a/assets/card-custom-light-anim-lineprint.svg b/assets/card-custom-light-anim-lineprint.svg index 86c06b42..0b45353f 100644 --- a/assets/card-custom-light-anim-lineprint.svg +++ b/assets/card-custom-light-anim-lineprint.svg @@ -23,11 +23,11 @@ 05 - Hooks - - Lifecycle scripts - & automation - §5 + Hooks + + Lifecycle scripts + & automation + §5 diff --git a/assets/card-custom.svg b/assets/card-custom.svg index 0e21bf6b..1118bb69 100644 --- a/assets/card-custom.svg +++ b/assets/card-custom.svg @@ -1,9 +1,8 @@ - + - @@ -32,14 +31,14 @@ - - 🪝 HOOKS - + + HOOKS + - + Lifecycle scripts - + & automation diff --git a/assets/card-docs-light-anim-lineprint.svg b/assets/card-docs-light-anim-lineprint.svg index 25a7e951..7bca3067 100644 --- a/assets/card-docs-light-anim-lineprint.svg +++ b/assets/card-docs-light-anim-lineprint.svg @@ -23,11 +23,11 @@ 09 - Docs - - Official guides - & resources - §9 + Docs + + Official guides + & resources + §9 diff --git a/assets/card-docs.svg b/assets/card-docs.svg index 06de0b2c..b081f7e6 100644 --- a/assets/card-docs.svg +++ b/assets/card-docs.svg @@ -1,9 +1,8 @@ - + - @@ -32,14 +31,14 @@ - - 🏛️ DOCS - + + DOCS + - + Official guides - + & resources diff --git a/assets/card-skills-light-anim-lineprint.svg b/assets/card-skills-light-anim-lineprint.svg index f3438e2f..0d0fe2cb 100644 --- a/assets/card-skills-light-anim-lineprint.svg +++ b/assets/card-skills-light-anim-lineprint.svg @@ -23,11 +23,11 @@ 01 - Agent Skills - - Model-controlled configs - for specialized tasks - §1 + Agent Skills + + Model-controlled configs + for specialized tasks + §1 diff --git a/assets/card-skills.svg b/assets/card-skills.svg index 22f0d13e..5371776c 100644 --- a/assets/card-skills.svg +++ b/assets/card-skills.svg @@ -1,10 +1,9 @@ - + - + - @@ -41,14 +40,14 @@ - - 🤖 SKILLS - + + SKILLS + - + Agent capabilities - + & specialized tasks diff --git a/assets/card-statusline-light-anim-lineprint.svg b/assets/card-statusline-light-anim-lineprint.svg index 45719ecc..a8cb0e70 100644 --- a/assets/card-statusline-light-anim-lineprint.svg +++ b/assets/card-statusline-light-anim-lineprint.svg @@ -23,11 +23,11 @@ 04 - Status Lines - - Statusline configs - & customizations - §4 + Status Lines + + Statusline configs + & customizations + §4 diff --git a/assets/card-statusline.svg b/assets/card-statusline.svg index d608f244..1900734d 100644 --- a/assets/card-statusline.svg +++ b/assets/card-statusline.svg @@ -1,10 +1,9 @@ - + - + - @@ -41,14 +40,14 @@ - - 📊 STATUS - + + STATUS + - + Statusline configs - + & customizations diff --git a/assets/card-tooling-light-anim-lineprint.svg b/assets/card-tooling-light-anim-lineprint.svg index 522862b0..8bc46a52 100644 --- a/assets/card-tooling-light-anim-lineprint.svg +++ b/assets/card-tooling-light-anim-lineprint.svg @@ -23,11 +23,11 @@ 03 - Tooling - - MCP servers, CLIs, - & development tools - §3 + Tooling + + MCP servers, CLIs, + & development tools + §3 diff --git a/assets/card-tooling.svg b/assets/card-tooling.svg index 986a838d..71d53832 100644 --- a/assets/card-tooling.svg +++ b/assets/card-tooling.svg @@ -1,9 +1,8 @@ - + - @@ -32,14 +31,14 @@ - - 🧰 TOOLING - + + TOOLING + - + Apps & utilities - + built on Claude Code diff --git a/assets/card-workflows-light-anim-lineprint.svg b/assets/card-workflows-light-anim-lineprint.svg index 28fed56e..15de1625 100644 --- a/assets/card-workflows-light-anim-lineprint.svg +++ b/assets/card-workflows-light-anim-lineprint.svg @@ -23,11 +23,11 @@ 02 - Workflows - - Guides & knowledge - for specific projects - §2 + Workflows + + Guides & knowledge + for specific projects + §2 diff --git a/assets/card-workflows.svg b/assets/card-workflows.svg index b226a435..a460189a 100644 --- a/assets/card-workflows.svg +++ b/assets/card-workflows.svg @@ -1,9 +1,8 @@ - + - @@ -32,14 +31,14 @@ - - 🧠 WORKFLOWS - + + WORKFLOWS + - + Development - + methodologies diff --git a/assets/header_alternative_clients-light-v3.svg b/assets/header_alternative_clients-light-v3.svg index 3bfcc126..f30a5fd9 100644 --- a/assets/header_alternative_clients-light-v3.svg +++ b/assets/header_alternative_clients-light-v3.svg @@ -1,7 +1,6 @@ - + @@ -42,4 +41,4 @@ - + \ No newline at end of file diff --git a/assets/header_alternative_clients.svg b/assets/header_alternative_clients.svg index 917a04f3..08f1f7f6 100644 --- a/assets/header_alternative_clients.svg +++ b/assets/header_alternative_clients.svg @@ -1,45 +1,44 @@ - + - - - + + + - - + - - + + - - - + + + - + - + - - + + - + @@ -47,10 +46,9 @@ - - + + Alternative Clients 📱 - @@ -61,36 +59,36 @@ - + - + - + - + - - + + - + - + - + \ No newline at end of file diff --git a/assets/header_claude_md_files-light-v3.svg b/assets/header_claude_md_files-light-v3.svg new file mode 100644 index 00000000..e4fa8a97 --- /dev/null +++ b/assets/header_claude_md_files-light-v3.svg @@ -0,0 +1,44 @@ + + + + + + + + 07 + + + + + + CLAUDE.md Files + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/header_claude_md_files.svg b/assets/header_claude_md_files.svg new file mode 100644 index 00000000..674664b3 --- /dev/null +++ b/assets/header_claude_md_files.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CLAUDE.md Files 📂 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/header_hooks-light-v3.svg b/assets/header_hooks-light-v3.svg index 2cc2fc1f..c121fb6f 100644 --- a/assets/header_hooks-light-v3.svg +++ b/assets/header_hooks-light-v3.svg @@ -1,7 +1,6 @@ - + @@ -42,4 +41,4 @@ - + \ No newline at end of file diff --git a/assets/header_hooks.svg b/assets/header_hooks.svg index d7809f35..2e73f4b4 100644 --- a/assets/header_hooks.svg +++ b/assets/header_hooks.svg @@ -1,45 +1,44 @@ - + - - - + + + - - + - - + + - - - + + + - + - + - - + + - + @@ -47,10 +46,9 @@ - - + + Hooks 🪝 - @@ -61,36 +59,36 @@ - + - + - + - + - - + + - + - + - + \ No newline at end of file diff --git a/assets/header_official_documentation-light-v3.svg b/assets/header_official_documentation-light-v3.svg index c877abd6..015a334b 100644 --- a/assets/header_official_documentation-light-v3.svg +++ b/assets/header_official_documentation-light-v3.svg @@ -1,7 +1,6 @@ - + @@ -42,4 +41,4 @@ - + \ No newline at end of file diff --git a/assets/header_official_documentation.svg b/assets/header_official_documentation.svg index 3cd19f44..336118dc 100644 --- a/assets/header_official_documentation.svg +++ b/assets/header_official_documentation.svg @@ -1,45 +1,44 @@ - + - - - + + + - - + - - + + - - - + + + - + - + - - + + - + @@ -47,10 +46,9 @@ - - + + Official Documentation 🏛️ - @@ -61,36 +59,36 @@ - + - + - + - + - - + + - + - + - + \ No newline at end of file diff --git a/assets/header_skills-light-v3.svg b/assets/header_skills-light-v3.svg new file mode 100644 index 00000000..79cfde95 --- /dev/null +++ b/assets/header_skills-light-v3.svg @@ -0,0 +1,44 @@ + + + + + + + + 01 + + + + + + Agent Skills + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/header_skills.svg b/assets/header_skills.svg new file mode 100644 index 00000000..5888e480 --- /dev/null +++ b/assets/header_skills.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Agent Skills 🤖 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/header_slash_commands-light-v3.svg b/assets/header_slash_commands-light-v3.svg index 256fbed4..5840c627 100644 --- a/assets/header_slash_commands-light-v3.svg +++ b/assets/header_slash_commands-light-v3.svg @@ -1,7 +1,6 @@ - + @@ -25,7 +24,7 @@ font-weight="600" fill="#3d3530" letter-spacing="0.5"> - Slash Commands + Slash-Commands @@ -42,4 +41,4 @@ - + \ No newline at end of file diff --git a/assets/header_slash_commands.svg b/assets/header_slash_commands.svg index 0eac66f7..9462841a 100644 --- a/assets/header_slash_commands.svg +++ b/assets/header_slash_commands.svg @@ -1,45 +1,44 @@ - + - - - + + + - - + - - + + - - - + + + - + - + - - + + - + @@ -47,10 +46,9 @@ - - + + Slash-Commands 🔪 - @@ -61,36 +59,36 @@ - + - + - + - + - - + + - + - + - + \ No newline at end of file diff --git a/assets/header_statusline-light-v3.svg b/assets/header_statusline-light-v3.svg new file mode 100644 index 00000000..c5dac410 --- /dev/null +++ b/assets/header_statusline-light-v3.svg @@ -0,0 +1,44 @@ + + + + + + + + 04 + + + + + + Status Lines + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/header_statusline.svg b/assets/header_statusline.svg new file mode 100644 index 00000000..2ce98b36 --- /dev/null +++ b/assets/header_statusline.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Status Lines 📊 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/header_tooling-light-v3.svg b/assets/header_tooling-light-v3.svg index b7d98352..458b80d5 100644 --- a/assets/header_tooling-light-v3.svg +++ b/assets/header_tooling-light-v3.svg @@ -1,7 +1,7 @@ - + @@ -30,7 +30,7 @@ - + diff --git a/assets/header_tooling.svg b/assets/header_tooling.svg index 22ddebaa..98a7e79f 100644 --- a/assets/header_tooling.svg +++ b/assets/header_tooling.svg @@ -1,45 +1,44 @@ - + - - - + + + - - + - - + + - - - + + + - + - + - - + + - + @@ -47,10 +46,9 @@ - - + + Tooling 🧰 - @@ -61,36 +59,36 @@ - + - + - + - + - - + + - + - + - + \ No newline at end of file diff --git a/assets/header_workflows-light-v3.svg b/assets/header_workflows-light-v3.svg new file mode 100644 index 00000000..31dd8d52 --- /dev/null +++ b/assets/header_workflows-light-v3.svg @@ -0,0 +1,44 @@ + + + + + + + + 02 + + + + + + Workflows & Knowledge Guides + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/header_workflows.svg b/assets/header_workflows.svg new file mode 100644 index 00000000..52fc94d7 --- /dev/null +++ b/assets/header_workflows.svg @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Workflows & Knowledge Guides 🧠 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/makeover-banner.svg b/assets/makeover-banner.svg index bc6ceb2b..ce6810e8 100644 --- a/assets/makeover-banner.svg +++ b/assets/makeover-banner.svg @@ -23,9 +23,9 @@ - + - + @@ -33,9 +33,8 @@ - + - @@ -366,22 +365,22 @@ - - + + EXTREME REPO - - + + MAKEOVER BY - - + + CLAUDE CODE WEB! diff --git a/assets/subheader_ci_deployment.svg b/assets/subheader_ci_deployment.svg index 9911bc43..219a4c58 100644 --- a/assets/subheader_ci_deployment.svg +++ b/assets/subheader_ci_deployment.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_code_analysis_testing.svg b/assets/subheader_code_analysis_testing.svg index 0463012a..8708c75f 100644 --- a/assets/subheader_code_analysis_testing.svg +++ b/assets/subheader_code_analysis_testing.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_context_loading_priming.svg b/assets/subheader_context_loading_priming.svg index cee15235..48aab8f0 100644 --- a/assets/subheader_context_loading_priming.svg +++ b/assets/subheader_context_loading_priming.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_documentation_changelogs.svg b/assets/subheader_documentation_changelogs.svg index 78c0c63e..593cb927 100644 --- a/assets/subheader_documentation_changelogs.svg +++ b/assets/subheader_documentation_changelogs.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_domain_specific.svg b/assets/subheader_domain_specific.svg index 692a55ee..57516ceb 100644 --- a/assets/subheader_domain_specific.svg +++ b/assets/subheader_domain_specific.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_general.svg b/assets/subheader_general.svg index 93566323..6a610bd8 100644 --- a/assets/subheader_general.svg +++ b/assets/subheader_general.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_general_1.svg b/assets/subheader_general_1.svg index 93566323..6a610bd8 100644 --- a/assets/subheader_general_1.svg +++ b/assets/subheader_general_1.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_general_2.svg b/assets/subheader_general_2.svg index 93566323..6a610bd8 100644 --- a/assets/subheader_general_2.svg +++ b/assets/subheader_general_2.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_general_3.svg b/assets/subheader_general_3.svg index 93566323..6a610bd8 100644 --- a/assets/subheader_general_3.svg +++ b/assets/subheader_general_3.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_general_4.svg b/assets/subheader_general_4.svg index 93566323..6a610bd8 100644 --- a/assets/subheader_general_4.svg +++ b/assets/subheader_general_4.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_general_5.svg b/assets/subheader_general_5.svg index 93566323..6a610bd8 100644 --- a/assets/subheader_general_5.svg +++ b/assets/subheader_general_5.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_general_6.svg b/assets/subheader_general_6.svg index 93566323..6a610bd8 100644 --- a/assets/subheader_general_6.svg +++ b/assets/subheader_general_6.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_general_7.svg b/assets/subheader_general_7.svg index 93566323..6a610bd8 100644 --- a/assets/subheader_general_7.svg +++ b/assets/subheader_general_7.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_ide_integrations.svg b/assets/subheader_ide_integrations.svg index e1b9cf80..ed5edfa2 100644 --- a/assets/subheader_ide_integrations.svg +++ b/assets/subheader_ide_integrations.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_language_specific.svg b/assets/subheader_language_specific.svg index 1411772d..0a99a7ae 100644 --- a/assets/subheader_language_specific.svg +++ b/assets/subheader_language_specific.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_miscellaneous.svg b/assets/subheader_miscellaneous.svg index d09c62c0..fed631b7 100644 --- a/assets/subheader_miscellaneous.svg +++ b/assets/subheader_miscellaneous.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_orchestrators.svg b/assets/subheader_orchestrators.svg index 70105f04..b02f1d6e 100644 --- a/assets/subheader_orchestrators.svg +++ b/assets/subheader_orchestrators.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_project_scaffolding_mcp.svg b/assets/subheader_project_scaffolding_mcp.svg index 8478fe95..7842bbb0 100644 --- a/assets/subheader_project_scaffolding_mcp.svg +++ b/assets/subheader_project_scaffolding_mcp.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_project_task_management.svg b/assets/subheader_project_task_management.svg index eeb11216..081dc714 100644 --- a/assets/subheader_project_task_management.svg +++ b/assets/subheader_project_task_management.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_usage_monitors.svg b/assets/subheader_usage_monitors.svg index 5694ef8f..c6a50d9d 100644 --- a/assets/subheader_usage_monitors.svg +++ b/assets/subheader_usage_monitors.svg @@ -1,4 +1,4 @@ - + diff --git a/assets/subheader_version_control_git.svg b/assets/subheader_version_control_git.svg index be7e0fa4..7b2c55eb 100644 --- a/assets/subheader_version_control_git.svg +++ b/assets/subheader_version_control_git.svg @@ -1,4 +1,4 @@ - + diff --git a/scripts/generate_readme.py b/scripts/generate_readme.py index 7f22d62d..741cf38e 100644 --- a/scripts/generate_readme.py +++ b/scripts/generate_readme.py @@ -21,53 +21,74 @@ def load_template(template_path): return f.read() -def create_h2_svg_file(text, filename, assets_dir): - """Create an animated hero-centered H2 header SVG file.""" - # Escape XML special characters - text_escaped = text.replace("&", "&").replace("<", "<").replace(">", ">") +def create_h2_svg_file(text: str, filename: str, assets_dir: str, icon: str = "") -> str: + """Create an animated hero-centered H2 header SVG file. + + Args: + text: The header text (e.g., "Agent Skills") + filename: The output filename + assets_dir: Directory to save the SVG + icon: Optional emoji icon to append (e.g., "🤖") + + Returns: + The filename of the created SVG + """ + # Build display text with optional icon + display_text = f"{text} {icon}" if icon else text - svg_content = f""" + # Escape XML special characters + text_escaped = display_text.replace("&", "&").replace("<", "<").replace(">", ">") + + # Calculate viewBox bounds based on text length + # Text is centered at x=400, font-size 38px ≈ 22px per char, emoji ≈ 50px + text_width = len(text) * 22 + (50 if icon else 0) + half_text = text_width / 2 + # Ensure we include decorations (x=187 to x=613) plus text bounds with generous padding + left_bound = int(min(180, 400 - half_text - 30)) + right_bound = int(max(620, 400 + half_text + 30)) + viewbox_width = right_bound - left_bound + + svg_content = f""" - - - + + + - - + - - + + - - - + + + - + - + - - + + - + @@ -75,10 +96,9 @@ def create_h2_svg_file(text, filename, assets_dir): - - + + {text_escaped} - @@ -89,36 +109,36 @@ def create_h2_svg_file(text, filename, assets_dir): - + - + - + - + - - + + - + - + - + """ @@ -140,7 +160,7 @@ def create_h3_svg_file(text, filename, assets_dir): text_width = len(text) * 10 total_width = text_width + 50 # Add padding for decorative elements - svg_content = f""" + svg_content = f""" @@ -333,11 +353,14 @@ def generate_category_header_light_svg(title, section_number="01"): title: The category title (e.g., "Agent Skills", "Tooling") section_number: Two-digit section number (e.g., "01", "02") """ + # Escape XML special characters + title_escaped = title.replace("&", "&").replace("<", "<").replace(">", ">") + # Calculate text width for positioning title_width = len(title) * 14 # Approximate width per character line_end_x = max(640, 220 + title_width + 50) - return f""" + return f""" @@ -766,19 +789,40 @@ def generate_toc_sub_svg(directory_name, description): # ============================================================================= -def ensure_category_header_exists(category_id, title, section_number, assets_dir): +def ensure_category_header_exists( + category_id: str, + title: str, + section_number: str, + assets_dir: str, + icon: str = "", + always_regenerate: bool = True, +) -> tuple[str, str]: """Ensure category header SVGs exist, generating them if needed. - Returns tuple of (dark_filename, light_filename). + Args: + category_id: The category identifier (e.g., "skills", "tooling") + title: The display title (e.g., "Agent Skills") + section_number: Two-digit section number (e.g., "01") + assets_dir: Directory to save SVGs + icon: Optional emoji icon for dark mode header + always_regenerate: If True, regenerate even if file exists (default True) + + Returns: + Tuple of (dark_filename, light_filename) """ # Define filenames safe_name = category_id.replace("-", "_") dark_filename = f"header_{safe_name}.svg" light_filename = f"header_{safe_name}-light-v3.svg" - # Check and generate light version + # Generate dark version + dark_path = os.path.join(assets_dir, dark_filename) + if always_regenerate or not os.path.exists(dark_path): + create_h2_svg_file(title, dark_filename, assets_dir, icon=icon) + + # Generate light version light_path = os.path.join(assets_dir, light_filename) - if not os.path.exists(light_path): + if always_regenerate or not os.path.exists(light_path): svg_content = generate_category_header_light_svg(title, section_number) with open(light_path, "w", encoding="utf-8") as f: f.write(svg_content) @@ -1332,14 +1376,28 @@ def generate_weekly_section(csv_data): return "\n".join(lines).rstrip() + "\n" -def generate_section_content(category, csv_data, general_map=None, assets_dir=None): - """Generate content for a category based on CSV data.""" +def generate_section_content( + category: dict, + csv_data: list, + general_map: dict | None = None, + assets_dir: str | None = None, + section_index: int = 0, +) -> str: + """Generate content for a category based on CSV data. + + Args: + category: Category dictionary with name, id, icon, description, subcategories + csv_data: List of resource dictionaries from CSV + general_map: Map for handling multiple "General" subcategory anchors + assets_dir: Directory to save generated SVG assets + section_index: Zero-based index of this section (for section numbering) + """ lines = [] # Get category details - # id = category.get("id", "") + category_id = category.get("id", "") title = category.get("name", "") - # icon = category.get("icon", "") + icon = category.get("icon", "") description = category.get("description", "").strip() category_name = category.get("name", "") subcategories = category.get("subcategories", []) @@ -1368,9 +1426,11 @@ def generate_section_content(category, csv_data, general_map=None, assets_dir=No anchor = title.lower().replace(" ", "-").replace("&", "").replace("/", "").replace(".", "") anchor_id = f"{anchor}-" # Category headers have "-" suffix - # Get pre-made header SVG files for this category - category_id = category.get("id", "") - dark_header, light_header = get_category_header_svg(category_id) + # Generate header SVG files for this category (dark and light versions) + section_number = str(section_index + 1).zfill(2) # "01", "02", etc. + dark_header, light_header = ensure_category_header_exists( + category_id, title, section_number, assets_dir, icon=icon, always_regenerate=True + ) # Add header with proper ID and theme-adaptive picture element lines.append(f'

') @@ -1592,9 +1652,9 @@ def generate_readme_from_templates(csv_path, template_dir, output_path): # Generate body sections body_sections = [] - for category in categories: + for section_index, category in enumerate(categories): section_content = generate_section_content( - category, csv_data, general_anchor_map, assets_dir=assets_dir + category, csv_data, general_anchor_map, assets_dir=assets_dir, section_index=section_index ) body_sections.append(section_content)