naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.1k stars 327 forks source link

Auto Pagination / Page Breaks #3737

Open Gazook89 opened 2 months ago

Gazook89 commented 2 months ago

Your idea:

It would be nice to not need manual page breaks-- the document should automatically determine where page breaks are needed and create a new page. Manual page breaks would still be allowed.

An example of a web document editor that manages to do this is Google Docs.

Likely, some method of calculating the height of elements and determining when that total height is greater than the page/container height, and then splitting the last element that overflows into a new page/container. Calculating heights of whole elements is likely "easy", but a library would likely be needed for calculating exactly where to split the text node of the last element.

Or, a library to handle it all (paged.js).

There are likely a million edge cases where this will have poor results. But I think it's worth a try at some point, if for no other reason than to have a good answer when someone else asks for it.

5e-Cleric commented 1 month ago

issue #66 was the original tracker, but it is abandoned and contains no additional information.