this is probably going to be a series but anyway, meet Larry
Bash script for batch restructuring of raw markdown documentation export from Notion.so and fusing it into a single document.
Troubled Larry is basically an overly talkative pile-of-files-to-single-document converter aimed at making Notion.so-based product documentation printable. Tuned specifically to account for particular nuances in Notion markdown export and does three things:
- shifts (increments the level of) each heading (except the first one) in each .md file in the current wd
- drags the resulting files through pandoc and fuses them all into a single documentation file in GFM format
- talks a lot
Written and tested only locally so far (on MacOS X Mojave, GNU Bash 3.2.57). Looks alive.
- pandoc, installable through
brew install pandoc
- Get your documentation in order! All articles have to be numerated in the exact order you want them to appear in your resulting doc. I personally did that through adding a number to the article title. Like "A1. Abstract", "A2. What is this for", "B1. Common terms", "B2. Common elements" etc. Yeah, the trick is getting them all sortable alphabetically, cuz when you export your directory as md every article is gonna be a separate md file.
- Export your documentation from Notion using "Export all as markdown"
- Unpack the downloaded archive
- Cd to the resulting folder
- launch troubledlarry
- Do not be offended by the lad, he means well
I have already said that but Larry requires to be launched in the working folder, you cannot navigate it to the folder containing your .md files after you've summoned Larry.