Skip to content

feat: notebook-style templates + handwritten fonts (closes #101) - #102

Merged
ajianaz merged 3 commits into
developfrom
feat/notebook-templates
Sep 23, 2026
Merged

ajianaz merged 3 commits into
developfrom
feat/notebook-templates

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

What

Two-part feature implementing #101:

PR part 1 (fonts): bundle Kalam (Light/Regular/Bold) + Caveat (Medium/Bold), OFL licensed, downloaded via Google Fonts CSS API with TrueType magic-byte verification. Registered in build_font_db (10 -> 15 bundled fonts).

PR part 2 (templates):

  • notebook-cover (1080x1350): handwritten hero (Caveat), uppercase subtitle, tagline banner, 6-step pipeline with inline SVG icons (note/phone/brain/search/spark/rocket - no emoji per Cosy mandate), dashed intro box, 9-row TOC with dot leaders, topics footer
  • notebook-page (1080x1350): chapter title box, star SVG bullets, dashed example box (optional, dynamic height), cloud punchline bubble (dynamic height), optional second dashed box, bottom brand line
  • Shrink-to-fit for hero/chapter/tagline titles; TOC max-length guards; light paper theme (intentional deviation from Catppuccin dark - paper look requires it)

Why

Educational study-notes carousels are a proven viral IG format (reference: viral @abhi_techhub handwritten-notes post). Until now only reproducible via the external HTML pipeline; this brings it into Cosy as API-renderable templates.

Testing

  • defaults render clean (no warnings) for both templates
  • stress test at schema max-lengths: dynamic boxes/bubble hold, shrink-to-fit keeps titles in-frame; vision QA PASS after 6 calibration rounds (fixes: spiral pattern clipping, f-string geometry bug, glyph fallback to non-bundled fonts -> replaced with SVG shapes, line-overlap, bubble height)
  • cargo fmt + cargo clippy -D warnings clean; full test suite 174/174 green
  • validate: both defaults valid
  • docs pages + gallery + sidebar + CHANGELOG; previews on MinIO CDN (200)

Closes #101

- Kalam Light/Regular/Bold + Caveat Medium/Bold (OFL, from Google Fonts,
  TrueType magic verified)
- registered in build_font_db for notebook-style templates
- bundled font count 10 -> 15
- notebook-cover: handwritten hero, tagline banner, 6-step pipeline with
  inline SVG icons (no emoji), dashed intro box, 9-row TOC with dot leaders
- notebook-page: chapter title box, star bullets, dashed example box,
  dynamic-height cloud punchline, optional second dashed box, brand line
- shrink-to-fit hero/chapter/tagline titles; schema max-length guards
- light paper theme (defaults deviate from Catppuccin dark by design)
- docs pages + gallery cards + sidebar + changelog; MinIO previews live
- closes #101
Comment thread docs/.vitepress/config.ts Outdated
},
},
})
'notebook-cover',
<text x="160" y="1022" font-family="Kalam,cursive" font-size="25" font-weight="700" fill="{{ brand.accent_color | default('#1e3a8a') }}">{{ slide.extra_title }}</text>
<text x="160" y="1062" font-family="Kalam,cursive" font-size="22" fill="{{ brand.accent_color | default('#1e3a8a') }}">{% for ln in slide.extra_text|default('')|wordwrap(60)|split('\n') %}<tspan x="160" dy="{{ 0 if loop.first else 32 }}">{{ ln }}</tspan>{% endfor %}</text>
{% endif %}
<!-- bottom brandline -->
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

- config.ts: move notebook sidebar entries INSIDE defineConfig() theme
  config (appended after the closing paren before, syntax error)
- notebook-page footer: Patrick Hand is not bundled; use Kalam
- notebook-cover defaults: clamp TOC entries to schema max 22
@ajianaz
ajianaz merged commit 8e7e671 into develop Sep 23, 2026
11 checks passed
@ajianaz
ajianaz deleted the feat/notebook-templates branch September 23, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: notebook-style carousel templates (cover + page) with handwritten fonts

2 participants