Leaf Index
Leaf Index

Small, explicit options.

The command writes HTML to standard output unless you choose an output filename.

terminal
python3 leafindex.py DIRECTORY [OPTIONS]
ArgumentBehavior
DIRECTORYAn existing, non-symlink directory to list.
--output PATHWrite a new UTF-8 HTML file. The parent directory must exist. Existing files are refused.
--recursiveInclude regular files inside ordinary subdirectories.
--max-depth NWith recursion, allow N subdirectory levels; default 3. Zero lists root files only.
--extensions .md,.pdfFilter the final file suffix, ignoring case. A dot is optional.
--title TEXTSet the page title and heading. Default: File index.
--versionPrint the script version and exit.
--helpShow command help.

Standard output

terminal
python3 leafindex.py ./notes --title "Project files"

Without --output, the HTML is printed to the terminal and the links assume the resulting page lives inside the input directory. Prefer --output when saving: it calculates links relative to the output folder and protects an existing filename.

Suffix matching

A filter of .txt includes both notes.txt and NOTES.TXT. A filter of .gz matches the final suffix of archive.tar.gz; the tool does not inspect file contents.

Exit status

CodeMeaning
0Generation completed, or help/version was requested.
1A read or write operation failed.
2Arguments were invalid, the input directory was unavailable, or the output filename already existed.

No options enable uploads, background jobs, file deletion, or automatic refresh.