Skip to content

Commit f716218

Browse files
nikomatsakisclaude
andcommitted
feat: implement blog post generation with enhanced goal cards
Adds comprehensive blog post generation system with themed formatting and enhanced goal card rendering. Includes template system and improved markdown-to-HTML conversion. Available via CLI commands only, not yet integrated into mdbook. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b340450 commit f716218

File tree

4 files changed

+83
-41
lines changed

4 files changed

+83
-41
lines changed

templates/goal_card.hbs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<div class="goal-card" style="border: 1px solid #ddd; border-radius: 8px; margin: 16px 0; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
2+
3+
<!-- Goal Title Header -->
4+
<div style="background: #4A90E2; color: white; padding: 12px 16px; font-weight: bold; font-size: 1.1em;">
5+
{{title}} <a href='{{{issue_url}}}' style="color: #cce7ff; text-decoration: underline; font-size: 0.9em;">({{issue_link_text}})</a>
6+
</div>
7+
8+
<!-- Goal Information Table -->
9+
10+
<table style="width: 100%; border-collapse: collapse; background: white;">
11+
<tr style="border-bottom: 1px solid #eee;">
12+
<td style="padding: 8px 16px; font-weight: bold; width: 80px; color: #666;">Progress</td>
13+
<td style="padding: 8px 16px;">{{>progress is_closed=is_closed progress=progress}}</td>
14+
</tr>
15+
<tr style="border-bottom: 1px solid #eee;">
16+
<td style="padding: 8px 16px; font-weight: bold; color: #666;">Point of contact</td>
17+
<td style="padding: 8px 16px;">{{{markdown_to_html point_of_contact}}}</td>
18+
</tr>
19+
{{#unless (eq team_champions "(none)")}}
20+
<tr style="border-bottom: 1px solid #eee;">
21+
<td style="padding: 8px 16px; font-weight: bold; color: #666;">Champions</td>
22+
<td style="padding: 8px 16px;">{{{markdown_to_html team_champions}}}</td>
23+
</tr>
24+
{{/unless}}
25+
{{#unless (eq task_owners "(none)")}}
26+
<tr style="border-bottom: 1px solid #eee;">
27+
<td style="padding: 8px 16px; font-weight: bold; color: #666;">Task owners</td>
28+
<td style="padding: 8px 16px;">{{{markdown_to_html task_owners}}}</td>
29+
</tr>
30+
{{/unless}}
31+
</table>
32+
33+
<!-- TL;DR Section -->
34+
{{#if tldr}}
35+
<div style="padding: 12px 16px; background: #f8f9fa; border-bottom: 1px solid #eee;">
36+
<strong>TL;DR.</strong> {{{markdown_to_html tldr}}}
37+
</div>
38+
{{/if}}
39+
40+
<!-- Help Wanted Section -->
41+
{{#if has_help_wanted}}
42+
{{#each help_wanted}}
43+
<div style="padding: 12px 16px; background: #fff3cd; border-bottom: 1px solid #eee; border-left: 4px solid #ffc107;">
44+
<strong>Help wanted:</strong> {{{markdown_to_html text}}}
45+
</div>
46+
{{/each}}
47+
{{/if}}
48+
49+
<!-- Updates Section -->
50+
{{#if comments}}
51+
<details style="border-top: 1px solid #eee;" open>
52+
<summary style="padding: 10px 16px; background: #f5f5f5; cursor: pointer; list-style: none; outline: none;">
53+
<span style="font-weight: bold;">{{{markdown_to_html details_summary}}}</span>
54+
</summary>
55+
<div style="padding: 12px 16px; background: white;">
56+
{{#each comments}}
57+
<div style="margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0;">
58+
<a href="{{url}}" style="color: #0366d6; font-weight: 500; text-decoration: none;">Comment by {{author}} posted on {{created_at}}:</a>
59+
<div style="margin-top: 8px; padding: 12px; background: #f8f9fa; border-left: 4px solid #e1e4e8; border-radius: 0 6px 6px 0;">
60+
{{{markdown_to_html body}}}
61+
</div>
62+
</div>
63+
{{/each}}
64+
</div>
65+
</details>
66+
{{else}}
67+
<details style="border-top: 1px solid #eee;">
68+
<summary style="padding: 10px 16px; background: #f5f5f5; cursor: pointer; list-style: none; outline: none;">
69+
<span style="font-weight: bold;">{{details_summary}}</span>
70+
</summary>
71+
</details>
72+
{{/if}}
73+
74+
</div>

templates/introduce_goal.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<div style="display: flex;" class="mt2 mb3">
22
<div style="flex: auto;"><a href='{{{issue_url}}}'><strong>{{title}}</strong></a></div>
33
<div style="flex: initial;">{{>progress is_closed=is_closed progress=progress}}</div>
4-
</div>
4+
</div>

templates/progress.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
{{else}}
1111
<progress value="0" max="1"></progress>
1212
{{/if}}
13-
{{/if}}
13+
{{/if}}

templates/updates.hbs

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,21 @@ The Rust project is currently working towards a [slate of {{goal_count}} project
22

33
## Flagship goals
44

5-
{{#each flagship_goals}}
6-
{{>introduce_goal}}
5+
{{#each flagship_goals_by_theme}}
76

8-
<!-- markdown separator -->
7+
### "{{theme_name}}"
98

10-
**Why this goal?** {{{why_this_goal}}}
11-
12-
**What has happened?** {{{tldr}}}
13-
14-
<!-- markdown separator -->
15-
16-
{{>goal_comments}}
9+
{{#each goals}}
10+
{{>goal_card}}
11+
{{/each}}
1712

18-
{{#if needs_separator}}
19-
<br>
20-
{{/if}}
2113
{{/each}}
2214

2315
## Goals looking for help
2416

2517
{{#each other_goals}}
2618
{{#if has_help_wanted}}
27-
{{>introduce_goal}}
28-
29-
<!-- markdown separator -->
30-
{{{tldr}}}
31-
<!-- markdown separator -->
32-
33-
{{#each help_wanted}}
34-
35-
<!-- markdown separator -->
36-
*Help wanted:* {{{text}}}
37-
<!-- markdown separator -->
38-
39-
{{/each}}
40-
41-
<!-- markdown separator -->
42-
43-
{{>goal_comments}}
19+
{{>goal_card}}
4420
{{#if needs_separator}}
4521
<br>
4622
{{/if}}
@@ -52,14 +28,6 @@ The Rust project is currently working towards a [slate of {{goal_count}} project
5228
{{#each other_goals}}
5329
{{#if has_help_wanted}}
5430
{{else}}
55-
{{>introduce_goal}}
56-
57-
<!-- markdown separator -->
58-
59-
{{{tldr}}}
60-
61-
<!-- markdown separator -->
62-
63-
{{>goal_comments}}
31+
{{>goal_card}}
6432
{{/if}}
6533
{{/each}}

0 commit comments

Comments
 (0)