The idea sounds really nice on paper, considering that the project took inspiration from an EBook reader. There are a few direction that can be considered to implement this:
Inspecting the source code of existing javascript libraries like epub.js or foliate.js
Something related to the Knuth-Plass algorithm
However, the main problem is that the HTML text needs to be pre-processed from client side to be paginated correctly (it needs information on client view port, container size etc), eliminating the advantage of SSR entirely.
So the real question is, is it worth it?
The idea sounds really nice on paper, considering that the project took inspiration from an EBook reader. There are a few direction that can be considered to implement this:
However, the main problem is that the HTML text needs to be pre-processed from client side to be paginated correctly (it needs information on client view port, container size etc), eliminating the advantage of SSR entirely. So the real question is, is it worth it?