Let's say you use a local editor like Obsidian or Typora to take notes on a daily basis and save them all on your local file system. One day, you want to build a blog to share these notes, but too lazy to generate an outline for them. Well, this script is for you.
Suppose your notes are organized like this:
notes
├── 2021
│ ├── document_1.md
│ └── document_2.md
├── 2020
│ ├── document_0.md
│ └── cats.md
├── README.md // the homepage content
Just run gitbook_summary_generator.py <path_to_notes> > SUMMARY.md
, and you can easily build a simple static blog with gitbook.
Within each directory, the notes are sorted by last modified date. By default, the script reads the first line of the note as the title of the note. If you don't have any title in a note, it uses the document's filename and replaces '_'s to spaces.
You can freely use and modify this script as you want.
-- cyanide