Skip to content

Commit 280e17a

Browse files
jeremymanningclaude
andcommitted
feat: Add emoji figure support and diagram/chart container styles
Emoji figures (slime-mold inspired): - Size classes: emoji-xs through emoji-xxl (24px to 192px) - Background colors: emoji-bg-green, emoji-bg-teal, emoji-bg-orange, emoji-bg-blue - State classes: emoji-gray (inactive), emoji-faded (partially faded) - Layout classes: emoji-figure, emoji-row, emoji-col, emoji-grid - Labeled emojis with emoji-labeled class - Hierarchy support with emoji-hierarchy and connector lines Diagram and chart containers: - .diagram-container for Kroki/Mermaid SVG diagrams - .chart-container for Chart.js canvas elements - Caption styling for both diagram-caption and chart-caption Example slides added demonstrating: - Flow diagram with colored emoji backgrounds - Size comparison (xs through xl) - State comparison (normal, faded, inactive) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a5728d6 commit 280e17a

File tree

4 files changed

+368
-1
lines changed

4 files changed

+368
-1
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Table Splitting Implementation Notes
2+
3+
## Date: 2025-12-29
4+
5+
## Summary
6+
Implemented support for auto-splitting long tables across multiple slides in the Marp presentation compile pipeline.
7+
8+
## Files Modified
9+
10+
### 1. `/Users/jmanning/llm-course/slides/template_deck/process_markdown.py`
11+
- Added `parse_markdown_table()` function to parse markdown tables into header, separator, and data rows
12+
- Added `generate_table_html()` function to generate HTML tables with proper alignment
13+
- Added `split_table()` function to split long tables and generate multiple slides
14+
- Updated `process_markdown()` function signature to accept `max_table_rows` parameter (default: 8)
15+
- Added table detection logic in the main processing loop
16+
- Added statistics tracking for tables found and tables split
17+
- Updated argparse to include `--max-table-rows` / `-r` argument
18+
19+
### 2. `/Users/jmanning/llm-course/slides/template_deck/compile.sh`
20+
- Added `-r, --rows` option for max table rows per slide (default: 8)
21+
- Added `MAX_TABLE_ROWS` configuration variable
22+
- Updated Python command to pass `--max-table-rows` argument
23+
- Updated help text and examples
24+
25+
### 3. `/Users/jmanning/llm-course/slides/template_deck/themes/cdl-theme.css`
26+
- Added `.table-continued-indicator` and `.table-continued-indicator-last` CSS classes
27+
- Added positioning rules for table continued indicators
28+
- Added `.table-continuation` class for continuation tables
29+
30+
### 4. `/Users/jmanning/llm-course/slides/template_deck/theme_showcase.md`
31+
- Added new "Long table (auto-split demo)" slide with 17 data rows to test table splitting
32+
33+
## Implementation Details
34+
35+
### Table Detection
36+
- Tables are detected by lines that start and end with `|`
37+
- Lines are buffered until a non-table line is encountered
38+
39+
### Splitting Logic
40+
- Tables with more than `max_table_rows` data rows are split
41+
- Header row is replicated on each slide
42+
- Alignment from markdown separator row is preserved
43+
- Column widths are consistent via inline styles
44+
45+
### Continued Indicators
46+
- First slide: `<div class="table-continued-indicator">continued...</div>`
47+
- Middle slides: `<div class="table-continued-indicator">...continued...</div>`
48+
- Last slide: `<div class="table-continued-indicator-last">...continued</div>`
49+
50+
## Testing
51+
- Compiled `theme_showcase.md` successfully
52+
- 17-row table was split into 3 slides (8 + 8 + 2 rows)
53+
- Header row correctly replicated on all slides
54+
- Continued indicators correctly positioned
55+
56+
## Usage Examples
57+
```bash
58+
# Compile with default 8 rows per table
59+
./compile.sh theme_showcase.md
60+
61+
# Compile with 6 rows per table
62+
./compile.sh theme_showcase.md -r 6
63+
64+
# Compile with 10 rows per table
65+
./compile.sh theme_showcase.md --rows 10
66+
```

slides/template_deck/theme_showcase.html

Lines changed: 59 additions & 1 deletion
Large diffs are not rendered by default.

slides/template_deck/theme_showcase.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,69 @@ The quadratic memory complexity of attention limits context length.
293293

294294
---
295295

296+
# Emoji figures
297+
298+
<div class="emoji-figure">
299+
<div class="emoji-col">
300+
<span class="emoji emoji-xl emoji-bg emoji-bg-green">🎓</span>
301+
<span class="label">Students</span>
302+
</div>
303+
<span class="emoji emoji-lg">➡️</span>
304+
<div class="emoji-col">
305+
<span class="emoji emoji-xl emoji-bg emoji-bg-teal">🤖</span>
306+
<span class="label">LLM</span>
307+
</div>
308+
<span class="emoji emoji-lg">➡️</span>
309+
<div class="emoji-col">
310+
<span class="emoji emoji-xl emoji-bg emoji-bg-orange">💡</span>
311+
<span class="label">Insights</span>
312+
</div>
313+
</div>
314+
315+
---
316+
317+
# Emoji sizes and states
318+
319+
<div class="emoji-row">
320+
<div class="emoji-col">
321+
<span class="emoji emoji-xs">🧠</span>
322+
<span class="label">xs (24px)</span>
323+
</div>
324+
<div class="emoji-col">
325+
<span class="emoji emoji-sm">🧠</span>
326+
<span class="label">sm (48px)</span>
327+
</div>
328+
<div class="emoji-col">
329+
<span class="emoji emoji-md">🧠</span>
330+
<span class="label">md (72px)</span>
331+
</div>
332+
<div class="emoji-col">
333+
<span class="emoji emoji-lg">🧠</span>
334+
<span class="label">lg (96px)</span>
335+
</div>
336+
<div class="emoji-col">
337+
<span class="emoji emoji-xl">🧠</span>
338+
<span class="label">xl (128px)</span>
339+
</div>
340+
</div>
341+
342+
<div class="emoji-row" style="margin-top: 1em;">
343+
<div class="emoji-col">
344+
<span class="emoji emoji-lg">👤</span>
345+
<span class="label">Normal</span>
346+
</div>
347+
<div class="emoji-col">
348+
<span class="emoji emoji-lg emoji-faded">👤</span>
349+
<span class="label">Faded</span>
350+
</div>
351+
<div class="emoji-col">
352+
<span class="emoji emoji-lg emoji-gray">👤</span>
353+
<span class="label">Inactive</span>
354+
</div>
355+
</div>
356+
357+
---
358+
296359
# Course Information
297360

298361
<div style="display: flex; gap: 2em;">

slides/template_deck/themes/cdl-theme.css

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,3 +1268,183 @@ section:not(.lead):not(#\31) > .warning-box {
12681268
align-self: center !important;
12691269
justify-self: center !important;
12701270
}
1271+
1272+
/* ============================================
1273+
EMOJI FIGURES - Slime-Mold Inspired Styling
1274+
For creating emoji-based diagrams and figures
1275+
============================================ */
1276+
1277+
/* Base emoji styling - makes emojis behave as inline-blocks */
1278+
.emoji {
1279+
display: inline-block;
1280+
font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
1281+
line-height: 1;
1282+
vertical-align: middle;
1283+
}
1284+
1285+
/* Emoji size classes */
1286+
.emoji-xs { font-size: 24px; } /* Extra small */
1287+
.emoji-sm { font-size: 48px; } /* Small */
1288+
.emoji-md { font-size: 72px; } /* Medium */
1289+
.emoji-lg { font-size: 96px; } /* Large */
1290+
.emoji-xl { font-size: 128px; } /* Extra large */
1291+
.emoji-xxl { font-size: 192px; } /* Hero size */
1292+
1293+
/* Emoji with background - colored "pedestal" effect */
1294+
.emoji-bg {
1295+
display: inline-flex;
1296+
align-items: center;
1297+
justify-content: center;
1298+
padding: 0.3em;
1299+
border-radius: 8px;
1300+
}
1301+
1302+
.emoji-bg-orange { background-color: #f97316; }
1303+
.emoji-bg-teal { background-color: #14b8a6; }
1304+
.emoji-bg-green { background-color: #00693e; }
1305+
.emoji-bg-blue { background-color: #3b82f6; }
1306+
.emoji-bg-gray { background-color: #9ca3af; }
1307+
1308+
/* Grayscale effect for "inactive" emojis */
1309+
.emoji-gray,
1310+
.emoji-inactive {
1311+
filter: grayscale(100%);
1312+
opacity: 0.7;
1313+
}
1314+
1315+
.emoji-faded {
1316+
filter: grayscale(50%);
1317+
opacity: 0.8;
1318+
}
1319+
1320+
/* Emoji figure container - for grouping emojis into diagrams */
1321+
.emoji-figure {
1322+
display: flex;
1323+
flex-wrap: wrap;
1324+
justify-content: center;
1325+
align-items: center;
1326+
gap: 1em;
1327+
margin: 1em auto;
1328+
}
1329+
1330+
/* Row layout for emoji figures */
1331+
.emoji-row {
1332+
display: flex;
1333+
flex-direction: row;
1334+
justify-content: center;
1335+
align-items: flex-end;
1336+
gap: 2em;
1337+
}
1338+
1339+
/* Column layout for emoji figures */
1340+
.emoji-col {
1341+
display: flex;
1342+
flex-direction: column;
1343+
align-items: center;
1344+
gap: 0.5em;
1345+
}
1346+
1347+
/* Grid layout for emoji figures */
1348+
.emoji-grid {
1349+
display: grid;
1350+
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
1351+
gap: 1em;
1352+
justify-items: center;
1353+
align-items: center;
1354+
}
1355+
1356+
/* Emoji with label underneath */
1357+
.emoji-labeled {
1358+
display: flex;
1359+
flex-direction: column;
1360+
align-items: center;
1361+
gap: 0.3em;
1362+
}
1363+
1364+
.emoji-labeled .label {
1365+
font-size: 0.6em;
1366+
text-align: center;
1367+
max-width: 120px;
1368+
}
1369+
1370+
/* Hierarchy/tree structure */
1371+
.emoji-hierarchy {
1372+
display: flex;
1373+
flex-direction: column;
1374+
align-items: center;
1375+
gap: 0.5em;
1376+
}
1377+
1378+
.emoji-hierarchy-row {
1379+
display: flex;
1380+
justify-content: center;
1381+
gap: 3em;
1382+
position: relative;
1383+
}
1384+
1385+
/* Horizontal line connector for hierarchy */
1386+
.emoji-hierarchy-row.with-connector::before {
1387+
content: '';
1388+
position: absolute;
1389+
top: -25px;
1390+
left: 25%;
1391+
right: 25%;
1392+
height: 2px;
1393+
background-color: #9ca3af;
1394+
}
1395+
1396+
/* Vertical line from parent */
1397+
.emoji-hierarchy-row.with-connector::after {
1398+
content: '';
1399+
position: absolute;
1400+
top: -25px;
1401+
left: 50%;
1402+
width: 2px;
1403+
height: 25px;
1404+
background-color: #9ca3af;
1405+
transform: translateX(-50%);
1406+
}
1407+
1408+
/* ============================================
1409+
DIAGRAM AND CHART STYLING
1410+
============================================ */
1411+
1412+
/* Kroki/Mermaid diagram containers */
1413+
.diagram-container {
1414+
display: flex !important;
1415+
justify-content: center !important;
1416+
align-items: center !important;
1417+
width: 100% !important;
1418+
margin: 0.5em auto !important;
1419+
}
1420+
1421+
.diagram-container img {
1422+
max-width: 90% !important;
1423+
max-height: 60vh !important;
1424+
object-fit: contain !important;
1425+
}
1426+
1427+
/* Chart.js canvas containers */
1428+
.chart-container {
1429+
display: flex !important;
1430+
justify-content: center !important;
1431+
align-items: center !important;
1432+
width: 80% !important;
1433+
max-height: 55vh !important;
1434+
margin: 0.5em auto !important;
1435+
}
1436+
1437+
.chart-container canvas {
1438+
max-width: 100% !important;
1439+
max-height: 100% !important;
1440+
}
1441+
1442+
/* Caption styling for diagrams and charts */
1443+
.diagram-caption,
1444+
.chart-caption {
1445+
text-align: center !important;
1446+
font-size: 0.7em !important;
1447+
font-style: italic !important;
1448+
color: #6b7c85 !important;
1449+
margin-top: 0.3em !important;
1450+
}

0 commit comments

Comments
 (0)