Evaluate AlpineJS for this. Specifically, will Alpine register when new commands are loaded with x-html?
[ ] Globally, track renderedChapters: number[] and currentChapter: number
[ ] When currentChapter changes, unload any chapters more than 2 chapters distant from currentChapter. Load the next and previous chapter(s) (if needed). Insert the loaded chapter into the correct position in the DOM.
With infinite scroll, let's put the book/chapter in a breadcrumb/floating header/something to let the reader see the context at a glance. Maybe a sticky header?
Evaluate AlpineJS for this. Specifically, will Alpine register when new commands are loaded with x-html?
renderedChapters: number[]
andcurrentChapter: number