transform the HTML into markdown (makes it easier to find sections)
splits the markdown into individual files based on the h1 in the document
move the images closer to the file embedding them
create data file for each image based on their alt text
Step 2,3 and 4 are combined in a single script, which has grown a little complex and would be better each in their own script, or at least separate JavaScript modules (to avoid re-parsing markdown files).
Potentially, step 1 could be broken down into individual remark/rehype modules as well (for testability).
The import does 4 things:
h1
in the documentStep 2,3 and 4 are combined in a single script, which has grown a little complex and would be better each in their own script, or at least separate JavaScript modules (to avoid re-parsing markdown files).
Potentially, step 1 could be broken down into individual remark/rehype modules as well (for testability).