Small, explicit options.
The command writes HTML to standard output unless you choose an output filename.
terminal
python3 leafindex.py DIRECTORY [OPTIONS]| Argument | Behavior |
|---|---|
DIRECTORY | An existing, non-symlink directory to list. |
--output PATH | Write a new UTF-8 HTML file. The parent directory must exist. Existing files are refused. |
--recursive | Include regular files inside ordinary subdirectories. |
--max-depth N | With recursion, allow N subdirectory levels; default 3. Zero lists root files only. |
--extensions .md,.pdf | Filter the final file suffix, ignoring case. A dot is optional. |
--title TEXT | Set the page title and heading. Default: File index. |
--version | Print the script version and exit. |
--help | Show 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
| Code | Meaning |
|---|---|
| 0 | Generation completed, or help/version was requested. |
| 1 | A read or write operation failed. |
| 2 | Arguments were invalid, the input directory was unavailable, or the output filename already existed. |
No options enable uploads, background jobs, file deletion, or automatic refresh.