Skip to content

Commit 2f2125b

Browse files
authored
Merge pull request #139 from nerdai/nerdai/adjust-to-conform-to-manning-guidelines
2 parents 87c11a6 + 44877e1 commit 2f2125b

File tree

4 files changed

+84
-74
lines changed

4 files changed

+84
-74
lines changed

Makefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ coverage-report: ## Show coverage summary in terminal
2020
coverage-html: ## Generate HTML coverage report
2121
coverage html
2222

23-
diagrams: ## Generate UML diagrams from PlantUML files
24-
@echo "Generating UML diagrams..."
25-
@mkdir -p uml/rendered
26-
@find uml -name "*.puml" -not -path "uml/common/*" -exec dirname {} \; | sed 's|^uml|uml/rendered|' | sort -u | xargs mkdir -p
27-
@find uml -name "*.puml" -not -path "uml/common/*" -exec sh -c 'java -jar ~/plantuml.jar -SDPI=300 -o "$$(dirname "{}" | sed "s|^uml|$(PWD)/uml/rendered|")" "{}"' \;
28-
@echo "Diagrams generated in uml/rendered/ directory with chapter structure!"
29-
30-
diagrams-svg: ## Generate SVG diagrams (for web)
23+
diagrams: ## Generate SVG diagrams (for web)
3124
@echo "Generating SVG diagrams..."
3225
@mkdir -p uml/rendered
3326
@find uml -name "*.puml" -not -path "uml/common/*" -exec dirname {} \; | sed 's|^uml|uml/rendered|' | sort -u | xargs mkdir -p

uml/README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,12 @@ plantuml-new -SDPI=300 uml/ch04/llm_agent_class.puml
5454

5555
```sh
5656
# Generate all diagrams using make
57-
make diagrams # PNG files
58-
make diagrams-svg # SVG files
57+
make diagrams # SVG files
5958

6059
# Or manually generate all files
6160
plantuml-new -SDPI=300 uml/**/*.puml
6261
```
6362

64-
## Directory Structure
65-
66-
```sh
67-
uml/
68-
├── common/
69-
│ └── book-clean.puml # Shared styling
70-
├── ch04/
71-
│ ├── llm_agent_class.puml
72-
│ └── llm_agent_sequence.puml
73-
└── rendered/ # Generated images
74-
└── ch04/
75-
├── llm_agent_class.png
76-
├── llm_agent_class.svg
77-
├── llm_agent_sequence.png
78-
└── llm_agent_sequence.svg
79-
```
63+
> [!NOTE]
64+
> For the book, most of these SVG images are further polished with
65+
> inkscape.

uml/ch01/llm_agent_build_mental_model.puml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
@startmindmap llm_agent_build_mental_model
2-
3-
<style>
4-
rootNode {
5-
LineThickness 2.0
6-
}
7-
</style>
2+
!include ../common/book-clean.puml
83

94
* LLM Agent
105
**_ Stage 3
@@ -19,11 +14,11 @@ rootNode {
1914
left side
2015

2116
**_ Stage 1
22-
*** LLM
23-
**** Ollama
2417
*** Tools
2518
**** SimpleFunction
2619
**** PydanticFunction
20+
*** LLM
21+
**** Ollama
2722

2823
**_ Stage 2
2924
*** MCP Tools

uml/common/book-clean.puml

Lines changed: 76 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,81 @@
1-
' Clean, professional theme for print
2-
skinparam shadowing false
3-
skinparam roundcorner 12
4-
skinparam dpi 300
1+
'── Book-clean theme (Manning font spec) ──────────────────────
2+
' You can override font families before including:
3+
' !define GRAPHIC_FONT Arial
4+
' !define ANNO_FONT "Humanist 521 Bold Condensed" ' or Times
5+
' !define CODE_FONT "Courier Std"
56

6-
' Background and borders
7-
skinparam backgroundcolor white
8-
skinparam arrowcolor #333
9-
skinparam linecolor #333
10-
skinparam arrowthickness 1.2
7+
!ifndef GRAPHIC_FONT
8+
!define GRAPHIC_FONT "Arial"
9+
!endif
10+
!ifndef ANNO_FONT
11+
!define ANNO_FONT "Times"
12+
!endif
13+
!ifndef CODE_FONT
14+
!define CODE_FONT "Courier Std"
15+
!endif
16+
17+
' General look
18+
skinparam Shadowing false
19+
skinparam RoundCorner 12
20+
21+
skinparam dpi 128
22+
23+
' Background & borders
24+
skinparam BackgroundColor white
25+
skinparam ArrowColor #333
26+
skinparam LineColor #333
27+
skinparam ArrowThickness 1.2
1128

1229
' Participants
13-
skinparam participantbackgroundcolor #f9fafb
14-
skinparam participantbordercolor #222
15-
skinparam participantpadding 6
30+
skinparam ParticipantBackgroundColor #f9fafb
31+
skinparam ParticipantBorderColor #222
32+
skinparam ParticipantPadding 6
1633

1734
' Lifelines
18-
skinparam sequencelifelinebackgroundcolor white
19-
20-
' Notes
21-
skinparam noteBackgroundColor #fffbe6
22-
skinparam noteBorderColor #e0d97a
23-
skinparam noteBorderThickness 1
24-
25-
' Fonts
26-
skinparam defaultfontname "Inter, Arial"
27-
skinparam defaultfontsize 16
28-
skinparam titleFontSize 20
29-
skinparam titleFontColor #222
30-
31-
' Alignment
32-
skinparam SequenceMessageAlign center
33-
34-
' Visibility Symbols
35-
skinparam classAttributeIconSize 0
36-
skinparam classOperationIconSize 0
37-
skinparam classFontName Courier
38-
skinparam classAttributeFontName Courier
39-
skinparam classFontSize 14
40-
41-
' Stereotypes
42-
skinparam stereotypePosition bottom
43-
44-
' Sequence Message Alignment
45-
skinparam sequenceMessageAlign reverseDirection
35+
skinparam SequenceLifeLineBackgroundColor white
36+
37+
' Notes / legends (Annotations)
38+
skinparam NoteBackgroundColor #fffbe6
39+
skinparam NoteBorderColor #e0d97a
40+
skinparam NoteBorderThickness 1
41+
42+
'──────────── Fonts (per Manning spec) ────────────
43+
' Graphic text
44+
skinparam DefaultFontName GRAPHIC_FONT
45+
skinparam DefaultFontSize 7
46+
skinparam ArrowFontName GRAPHIC_FONT
47+
skinparam ArrowFontSize 7
48+
skinparam ParticipantFontName GRAPHIC_FONT
49+
skinparam ParticipantFontSize 7
50+
51+
' Headings
52+
skinparam TitleFontName GRAPHIC_FONT
53+
skinparam TitleFontSize 8
54+
skinparam TitleFontColor #222
55+
' Sequence group header labels (loop/alt/opt/etc.)
56+
skinparam SequenceGroupFontName GRAPHIC_FONT
57+
skinparam SequenceGroupFontSize 8
58+
59+
' Annotations (notes/legend)
60+
skinparam NoteFontName ANNO_FONT
61+
skinparam NoteFontSize 9
62+
skinparam LegendFontName ANNO_FONT
63+
skinparam LegendFontSize 9
64+
65+
' Code text (class diagrams etc.)
66+
skinparam ClassFontName CODE_FONT
67+
skinparam ClassFontSize 8
68+
skinparam ClassAttributeFontName CODE_FONT
69+
skinparam ClassAttributeFontSize 8
70+
skinparam ClassOperationFontName CODE_FONT
71+
skinparam ClassOperationFontSize 8
72+
73+
' Hide the little +/# icons next to members
74+
skinparam ClassAttributeIconSize 0
75+
skinparam ClassOperationIconSize 0
76+
77+
' Stereotypes under the box
78+
skinparam StereotypePosition bottom
79+
80+
' Sequence message alignment (one setting only)
81+
skinparam SequenceMessageAlign reverseDirection

0 commit comments

Comments
 (0)