The Fifth Tome
The fifth tome is primarily based on the 5e SRD 5.2.1 and 5.1, released by Wizards of the Coast. The current public version (the first) is available here: The Fifth Tome.
The idea of a fully self-contained player tome was inspired by the TiddlyWiki project and the work of Downfallx, OldManUmby, Crobi, and the maintainers over at 5e Bits.
It was built with a combination of Gemini and Claude and my carefully maintained Obsidian vault.
How the Classroom Tome works
What follows is an AI-Generated summary of the structure of the file. The code itself is open. The Fifth Tome is licensed the same as the SRD (CC-BY), so go ahead and dig in!
The Tome is one HTML file with no server, no build step, and no outside assets. Open it in a browser and it runs offline open it in BBEdit and you’ll see the code and content. It covers SRD 5.2.1 (2024) characters for levels 1–20 with an interactive character builder, a character sheet, a level-up wizard, a dice roller, a journal, and a rules reference.
What’s inside the file
Styles: one CSS block at the top. The look is set by a handful of colour, font and radius variables at the start of
:root, so a re-theme means editing those lines.Page: plain HTML sections for the home hub, builder, sheet, rules, journal and modals. The JavaScript fills them in.
Rules data: a single
SRDobject in its own script block holds all the classes, species, backgrounds, feats, spells, equipment and glossary text. Class tables, feature lists and the rules reference are all built from this object.App code: a second script block, in numbered sections: constants, tracking tools, the builder, level-up, the sheet and backup.
How the data flows
The app keeps one
stateobject: the current character, the saved roster, journals and notes.Every change goes through
saveState(), which writesstateto the browser’slocalStorage.loadState()reads it back and repairs any damaged or hand-edited character as it loads.Backup and Restore export and import a character as a Markdown file, so players can hand one in to their DM or move it between devices.
Where to change things
Theme: the
:rootvariables.House rules:
tableRulesHtml()holds the Covenant Table Rules tab. Edit or replace those boxes with your own table’s rules.Rules comparison boxes:
EDITION_DIFFSholds the 2014-vs-2024 boxes, each with direct quotes you can verify.Starter heroes:
PREGENSandPREGEN_SPECS.Classes and feats: these are derived from
SRD(viaCLASS_DATA,ORIGIN_FEATS,MI_LISTSand similar). Fix the data first, and the screens follow.Homebrew: students can add their own items, feats, features and spells on the sheet and during level-up. The Tome stores what they type but doesn’t interpret it.
Your own variant: change
TOME_VERSIONand the credit text.
Tips for hand-coders and LLM users
Make each change as a small script that patches the previous version of the file. Keep the old versions untouched. If a patch breaks something, you re-run it instead of untangling a 1.3 MB file by hand.
Don’t change
STORAGE_KEYor the Markdown backup format. Either one will lock students out of the characters they already saved.Keep rules text word-for-word from the SRD. If you add comparisons, quote both editions, and don’t write a “difference” where the rule is the same.
Test by driving the real screens with a browser tool such as Playwright. Build and level every class from 1 to 20, run a backup and restore, and check phone and desktop widths.
When you ask an LLM to edit the file, give it the section names above and ask for a patch against one section, not a rewrite of the whole file.
Keep your own credits. The SRD text is CC BY 4.0, so keep the Wizards of the Coast statements and add credit for anything you bring in.