Skip to content

Commit fd4583b

Browse files
testac974claude
andcommitted
Fix TOC generation and add proper navigation menu
- Fix generate-toc.sh to filter out Part 99 (test), front matter, and non-numeric chapters (index, specifications) - Regenerate TOC with all Part 1 chapters (was missing ch 3 & 4) - Add auto TOC regeneration to pre-commit hook - Add Jekyll navigation structure (_data/navigation.yml) - Add custom header with proper hamburger menu (_includes/header.html) - Add navigation styles (assets/css/style.scss) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 87741e9 commit fd4583b

6 files changed

Lines changed: 231 additions & 43 deletions

File tree

.husky/pre-commit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
echo "Running pre-commit validation (same checks as CI)..."
44
echo ""
55

6+
# Regenerate table of contents if any book content changed
7+
if git diff --cached --name-only | grep -q "^book/"; then
8+
echo "Book content changed, regenerating table of contents..."
9+
npm run generate:toc
10+
git add book/TABLE_OF_CONTENTS.md
11+
echo ""
12+
fi
13+
614
# Run the same validation as CI
715
# This mirrors .github/workflows/validate.yml
816
npm run validate

book/TABLE_OF_CONTENTS.md

Lines changed: 28 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Chapter 1: The Renaissance Developer
66

7+
78
- [Introduction: The Specialist's Dilemma](./part1-foundations/01-renaissance-developer/01-introduction-the-specialist-s-dilemma.md)
89
- [The Renaissance Developer Model](./part1-foundations/01-renaissance-developer/02-the-renaissance-developer-model.md)
910
- [What Changes, What Doesn't](./part1-foundations/01-renaissance-developer/03-what-changes-what-doesn-t.md)
@@ -17,6 +18,7 @@
1718

1819
### Chapter 2: What is Agentic Coding?
1920

21+
2022
- [Introduction](./part1-foundations/02-what-is-agentic-coding/01-introduction.md)
2123
- [Defining Agentic Coding](./part1-foundations/02-what-is-agentic-coding/02-defining-agentic-coding.md)
2224
- [The Spectrum of Agentic Coding](./part1-foundations/02-what-is-agentic-coding/03-the-spectrum-of-agentic-coding.md)
@@ -28,13 +30,34 @@
2830
- [Summary](./part1-foundations/02-what-is-agentic-coding/09-summary.md)
2931
- [Further Reading](./part1-foundations/02-what-is-agentic-coding/10-further-reading.md)
3032

31-
### Chapter index: Part 1: Foundations
33+
### Chapter 3: Architecture Principles for Agentic Development
34+
35+
36+
- [Introduction: Why Architecture Matters for AI Agents](./part1-foundations/03-architecture-principles/01-introduction.md)
37+
- [The Digestibility Principle: Fitting in Context Windows](./part1-foundations/03-architecture-principles/02-the-digestibility-principle.md)
38+
- [Component Decomposition: Breaking Down for AI Understanding](./part1-foundations/03-architecture-principles/03-component-decomposition.md)
39+
- [Interface Boundaries: Clear Contracts for AI and Humans](./part1-foundations/03-architecture-principles/04-interface-boundaries.md)
40+
- [Separation of Concerns: Making Code Modifiable by AI](./part1-foundations/03-architecture-principles/05-separation-of-concerns.md)
41+
- [Testability: Validating AI-Generated Code](./part1-foundations/03-architecture-principles/06-testability-for-ai-code.md)
42+
- [Practical Application: Architecting a Real System](./part1-foundations/03-architecture-principles/07-practical-application.md)
43+
- [Common Pitfalls: Architecture Anti-Patterns for AI](./part1-foundations/03-architecture-principles/08-common-pitfalls.md)
44+
- [Summary: Key Architectural Principles](./part1-foundations/03-architecture-principles/09-summary.md)
45+
- [Further Reading: Architecture Resources](./part1-foundations/03-architecture-principles/10-further-reading.md)
46+
47+
### Chapter 4: Digestible Interfaces
48+
3249

33-
*[View Chapter](./part1-foundations/README.md)*
50+
- [Introduction: The Interface Problem](./part1-foundations/04-digestible-interfaces/01-introduction.md)
51+
- [Defining Digestibility](./part1-foundations/04-digestible-interfaces/02-defining-digestibility.md)
52+
- [Human Constraints: Working Memory Limits](./part1-foundations/04-digestible-interfaces/03-human-constraints.md)
53+
- [AI Constraints: Context Window Limits](./part1-foundations/04-digestible-interfaces/04-ai-constraints.md)
54+
- [Unified Principles: Interfaces That Serve Both](./part1-foundations/04-digestible-interfaces/05-unified-principles.md)
55+
- [Examples: Good vs. Bad Interfaces](./part1-foundations/04-digestible-interfaces/06-examples-good-vs-bad.md)
56+
- [Common Pitfalls in Interface Design](./part1-foundations/04-digestible-interfaces/07-common-pitfalls.md)
57+
- [Measuring Digestibility](./part1-foundations/04-digestible-interfaces/08-measuring-digestibility.md)
58+
- [Summary: The Unified Design Philosophy](./part1-foundations/04-digestible-interfaces/09-summary.md)
59+
- [Further Reading and Resources](./part1-foundations/04-digestible-interfaces/10-further-reading.md)
3460

35-
Part 1 establishes the mindset and mental models for agentic development,
36-
covering the Renaissance Developer concept, what agentic coding means,
37-
architecture principles, and new bottlenecks in AI-assisted development.
3861

3962
## Part 2
4063

@@ -45,13 +68,6 @@ architecture principles, and new bottlenecks in AI-assisted development.
4568
[Placeholder: 2-3 sentence summary of this chapter's content
4669
for search and navigation purposes. To be written during drafting.]
4770

48-
### Chapter index: Part 2: The Playbook
49-
50-
*[View Chapter](./part2-playbook/README.md)*
51-
52-
Part 2 provides the complete 6-week workflow from idea to production,
53-
covering each phase of the journey with actionable guidance.
54-
5571
## Part 3
5672

5773
### Chapter 1: EARS Notation for Requirements
@@ -61,13 +77,6 @@ covering each phase of the journey with actionable guidance.
6177
[Placeholder: 2-3 sentence summary of this chapter's content
6278
for search and navigation purposes. To be written during drafting.]
6379

64-
### Chapter index: Part 3: Patterns & Tools
65-
66-
*[View Chapter](./part3-patterns-tools/README.md)*
67-
68-
Part 3 provides deep reference material for specific techniques,
69-
organized by category for easy lookup when you need specific guidance.
70-
7180
## Part 4
7281

7382
### Chapter 5: Implementing the MVP
@@ -76,27 +85,3 @@ organized by category for easy lookup when you need specific guidance.
7685

7786
[Placeholder: 2-3 sentence summary of this chapter's content
7887
for search and navigation purposes. To be written during drafting.]
79-
80-
### Chapter index: Part 4: Complete Example
81-
82-
*[View Chapter](./part4-example/README.md)*
83-
84-
Part 4 proves the 6-week promise with a complete real-world project,
85-
documenting every step from idea to deployed MVP.
86-
87-
## Part 99
88-
89-
### Chapter 1: Test Chapter
90-
91-
*[View Chapter](./test-chapter.md)*
92-
93-
Test chapter for validating build scripts.
94-
95-
## Part front
96-
97-
### Chapter preface: Preface
98-
99-
*[View Chapter](./preface.md)*
100-
101-
The preface explains the book's purpose, who it's for, how to use it effectively,
102-
and what you can expect to achieve by following the 6-week playbook.

book/_data/navigation.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Navigation structure for the book website
2+
# This powers the hamburger menu and sidebar navigation
3+
4+
main:
5+
- title: "Home"
6+
url: "/"
7+
- title: "Preface"
8+
url: "/preface"
9+
- title: "Table of Contents"
10+
url: "/TABLE_OF_CONTENTS"
11+
12+
parts:
13+
- title: "Part 1: Foundations"
14+
url: "/part1-foundations/"
15+
chapters:
16+
- title: "1. The Renaissance Developer"
17+
url: "/part1-foundations/01-renaissance-developer/01-introduction-the-specialist-s-dilemma"
18+
- title: "2. What is Agentic Coding?"
19+
url: "/part1-foundations/02-what-is-agentic-coding/01-introduction"
20+
- title: "3. Architecture Principles"
21+
url: "/part1-foundations/03-architecture-principles/01-introduction"
22+
- title: "4. Digestible Interfaces"
23+
url: "/part1-foundations/04-digestible-interfaces/01-introduction"
24+
25+
- title: "Part 2: The Playbook"
26+
url: "/part2-playbook/"
27+
chapters:
28+
- title: "3. Brainstorm to Brief"
29+
url: "/part2-playbook/03-brainstorm-to-brief"
30+
31+
- title: "Part 3: Patterns & Tools"
32+
url: "/part3-patterns-tools/"
33+
chapters:
34+
- title: "1. EARS Notation"
35+
url: "/part3-patterns-tools/specifications/ears-notation"
36+
37+
- title: "Part 4: Complete Example"
38+
url: "/part4-example/"
39+
chapters:
40+
- title: "5. Implementing the MVP"
41+
url: "/part4-example/05-implementing-mvp"

book/_includes/header.html

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<header class="site-header">
2+
<div class="wrapper">
3+
<a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>
4+
5+
<nav class="site-nav">
6+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
7+
<label for="nav-trigger">
8+
<span class="menu-icon">
9+
<svg viewBox="0 0 18 15" width="18px" height="15px">
10+
<path d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.032C17.335,0,18,0.665,18,1.484L18,1.484z M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.032C17.335,6.031,18,6.696,18,7.516L18,7.516z M18,13.516C18,14.335,17.335,15,16.516,15H1.484 C0.665,15,0,14.335,0,13.516l0,0c0-0.82,0.665-1.483,1.484-1.483h15.032C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
11+
</svg>
12+
</span>
13+
</label>
14+
15+
<div class="trigger">
16+
{% for item in site.data.navigation.main %}
17+
<a class="page-link" href="{{ item.url | relative_url }}">{{ item.title }}</a>
18+
{% endfor %}
19+
20+
<div class="nav-parts">
21+
{% for part in site.data.navigation.parts %}
22+
<div class="nav-part">
23+
<a class="page-link part-title" href="{{ part.url | relative_url }}">{{ part.title }}</a>
24+
{% if part.chapters %}
25+
<ul class="nav-chapters">
26+
{% for chapter in part.chapters %}
27+
<li><a href="{{ chapter.url | relative_url }}">{{ chapter.title }}</a></li>
28+
{% endfor %}
29+
</ul>
30+
{% endif %}
31+
</div>
32+
{% endfor %}
33+
</div>
34+
</div>
35+
</nav>
36+
</div>
37+
</header>

book/assets/css/style.scss

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
---
3+
4+
@import "minima";
5+
6+
// Custom navigation styles for the book
7+
8+
.site-nav {
9+
.trigger {
10+
.nav-parts {
11+
@media screen and (max-width: 600px) {
12+
display: block;
13+
padding-top: 10px;
14+
border-top: 1px solid #e8e8e8;
15+
margin-top: 10px;
16+
}
17+
}
18+
19+
.nav-part {
20+
margin-bottom: 15px;
21+
22+
.part-title {
23+
font-weight: bold;
24+
color: #424242;
25+
display: block;
26+
padding: 5px 0;
27+
}
28+
29+
.nav-chapters {
30+
list-style: none;
31+
margin: 0;
32+
padding-left: 15px;
33+
34+
li {
35+
margin: 5px 0;
36+
37+
a {
38+
color: #828282;
39+
font-size: 14px;
40+
text-decoration: none;
41+
42+
&:hover {
43+
color: #2a7ae2;
44+
}
45+
}
46+
}
47+
}
48+
}
49+
}
50+
51+
// Desktop: show dropdown on hover
52+
@media screen and (min-width: 601px) {
53+
.nav-parts {
54+
display: none;
55+
position: absolute;
56+
right: 0;
57+
top: 100%;
58+
background: white;
59+
border: 1px solid #e8e8e8;
60+
border-radius: 5px;
61+
padding: 15px;
62+
min-width: 280px;
63+
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
64+
z-index: 1000;
65+
}
66+
67+
.trigger:hover .nav-parts,
68+
.nav-parts:hover {
69+
display: block;
70+
}
71+
}
72+
}
73+
74+
// Mobile nav improvements
75+
@media screen and (max-width: 600px) {
76+
.site-nav {
77+
.trigger {
78+
clear: both;
79+
display: none;
80+
padding: 10px;
81+
background: #fdfdfd;
82+
border: 1px solid #e8e8e8;
83+
border-radius: 5px;
84+
max-height: 80vh;
85+
overflow-y: auto;
86+
}
87+
88+
input:checked ~ .trigger {
89+
display: block;
90+
}
91+
92+
.page-link {
93+
display: block;
94+
padding: 8px 0;
95+
margin: 0;
96+
border-bottom: 1px solid #eee;
97+
}
98+
}
99+
}

scripts/generate-toc.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,27 @@ items.sort((a, b) => {
3737
3838
// Group items by part and chapter
3939
const parts = {};
40+
const frontMatter = []; // For preface, index, etc.
41+
4042
items.forEach(item => {
4143
if (!item.part || !item.chapter) return; // Skip book-level files without part/chapter
4244
45+
// Skip test chapters (part 99+) and non-numeric parts
46+
const partNum = parseInt(item.part);
47+
if (isNaN(partNum) || partNum >= 99 || partNum === 0) {
48+
// Store front matter separately if it has content
49+
if (item.part === "front" || item.part === 0) {
50+
frontMatter.push(item);
51+
}
52+
return;
53+
}
54+
55+
// Skip non-numeric chapters (like "index", "specifications")
56+
const chapterNum = parseInt(item.chapter);
57+
if (isNaN(chapterNum)) {
58+
return;
59+
}
60+
4361
if (!parts[item.part]) parts[item.part] = {};
4462
if (!parts[item.part][item.chapter]) {
4563
parts[item.part][item.chapter] = {

0 commit comments

Comments
 (0)