Your first file index.
Start with a small directory of files you are comfortable listing.
1. Get the script
Download the readable Python file and keep the accompanying MIT license. No package installation or account is required.
Check Python from a terminal:
python3 --versionThis release targets Python 3.9 or later. The commands below use macOS/Linux shell syntax; Windows users can use py -3 in place of python3 if that is their Python launcher.
2. Choose a directory
For example, a folder named notes containing a few text files:
notes/
packing.txt
reading.txt3. Generate a new page
python3 leafindex.py ./notes --output ./notes/index.html --title "Reading notes"The output filename must not already exist. If it does, choose a different name. The tool does not overwrite your existing pages.
4. Open and check
Open notes/index.html in a browser. Follow each link to confirm it points to the intended file. You can compare the result with the included sample.
To test through a local web server, run:
python3 -m http.server 8000 --bind 127.0.0.1 --directory ./notesOpen http://127.0.0.1:8000/. Stop the preview with Ctrl+C. This preview is bound to your own computer.