classbook

Turn course notes, slides or PDFs into a Classbook — an interactive offline study website with lessons, animations, hoverable formulas, exercises and code, ready for GitHub Pages.

¿Qué es classbook?

classbook is a Claude Code agent skill that turn course notes, slides or PDFs into a Classbook — an interactive offline study website with lessons, animations, hoverable formulas, exercises and code, ready for GitHub Pages.

Compatible con~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/2248220hub/classbook_v1/tree/HEAD/skill/classbook

Installed? Explore more Productividad y colaboración skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Vista previa

Del README del skill

classbook preview

Documentación

Classbook — notes in, interactive classbook out

A classbook is a static website (plain HTML/CSS/JS, no server, no build tools beyond Python's standard library). Each unit is a folder; each lesson in it is a <section> the reader steps through with a stepper, a story panel on the right, and — only where the topic needs them — widgets, animations, formulas with hoverable symbols, code in any language, exercises and quick checks. Practice, Code Lab and Cheatsheet views are assembled automatically, and their tabs disappear when a unit has nothing for them.

Everything is in this skill folder:

pathwhat it is
engine/the site engine copied into every classbook: assets/ (style, app, plotting/animation helpers, KaTeX, font) and build.py
templates/classbook.json, home.html, and a unit template (unit/content.html, unit/widgets.js) showing every block
scripts/new_classbook.pycreate a classbook folder (engine + config + home + first unit) and build it
scripts/add_unit.pyadd a lesson unit, lab or project; registers it in classbook.json
scripts/check.pybuild + catch broken symbols, widgets, exercises, links, JS errors before publishing
references/authoring.mdevery content macro, with examples — read before writing content
references/widgets.mdthe Plot / UI / M API, UI.player animations, widget recipes — read before writing widgets
references/pedagogy.mdhow to turn notes into a learning journey — read when planning units
references/publishing.mdGitHub Pages, custom colours, updating the engine

Workflow

  1. Read the notes fully (PDF → text, slides, markdown, photos of handwriting). List the topics, the formulas, the worked examples, the code and the exercises they contain. Note the audience level.
  2. Plan (see references/pedagogy.md): units → lessons (4–10 per unit, 15–35 min each). For each lesson decide its one key idea and which blocks it actually needs (table below). Show the plan to the person if they are present and the course is large; otherwise state your plan and proceed.
  3. Create the classbook:
    python scripts/new_classbook.py <target> --title "…" --subject "…" --languages py:Python[,f90:Fortran|m:MATLAB|r:R|cpp:C++|js:JavaScript|jl:Julia] --no-unit
    python scripts/add_unit.py <target> --id 01 --name "…" --lessons "Title 1|Title 2|…" [--kind lab|project --label "Lab 1 ·"]
    
    Use --languages "" for a course with no code (history, languages, biology…).
  4. Write each unit's content.html with the macros in references/authoring.md, faithful to the notes (same notation, same examples, same order unless pedagogy demands otherwise). Fill the right-panel story, key idea and "you'll learn" list of every lesson. Remove every TODO.
  5. Write widgets.js only for lessons where something can be explored (slider → plot) or watched (an animation of a process). Define the SYMBOLS used by \h{key}{…}. Test numbers you quote: run any code you include (it must print what the text says).
  6. Edit home.html (description, suggested order table, credits to the notes' authors).
  7. Check: python scripts/check.py <target> until 0 errors; then open the pages in a browser (Playwright screenshots if available) — look at every widget once, on desktop and at phone width.
  8. Deliver: the folder is the website. For GitHub, follow references/publishing.md.

Use only what the topic needs

Nothing is mandatory except a section's title, its prose and its right-panel story. Choose per lesson:

the notes contain…use
a definition, law or equation<x-f> formula with \h{key}{…} hover symbols (+ code if the course has code)
a parameter whose effect matters ("what if σ doubles?")a slider widget (recipe 1)
a process in time: motion, growth, a wave, a cycle, a historical sequencean animation with UI.player (recipe 2)
an algorithm or a procedurea stepped animation (UI.player({steps}), recipe 3) or <x-steps>
a derivation or a proof<x-steps> (each line revealed with its justification)
numeric worked examples<x-ex> checked exercises with hint and full solution
concepts, vocabulary, cause–effect (non-numeric subjects)<x-mcq> quick checks with a "why"
open-ended understanding<x-think> reflection prompts
program code / lab scripts<x-code> (inline or from code/ files), a lab unit (--kind lab)
a long running example across the coursea project unit + <x-link kind="project"> from each lesson
figures, photos, diagrams from the notes<figure class="fig"><img src="figures/…"><figcaption>…

Do not add a widget, an animation, an exercise or a code block just to fill a section. One strong widget beats three decorative ones. A pure-concept course can have no code and no formulas at all — the Code Lab and Cheatsheet tabs then vanish by themselves.

Quality bar

  • Start every lesson from intuition and a concrete case; then the precise statement; then limits and common mistakes (BASIC → CORE → ADVANCED labels, references/pedagogy.md).
  • Every number in the text is computed or quoted from the notes, never invented. Exercise answers are verified (compute them). Code blocks run.
  • Credit the original authors of the notes on the home page; do not copy copyrighted textbook text verbatim beyond short quotes — rewrite in your own words.
  • Keep the visual language: warm paper, ink borders, monospace, one accent colour per unit.
  • Widgets must redraw on resize/theme (root._redraw = draw) and work at phone width.
  • Animations start paused for readers who prefer reduced motion (UI.player does this) and pause themselves when hidden.

Skills relacionados