Logic for chunking HTMLBook content into separate files