mdi
English | 中文
mdi(Markdown indexer) is a command line tool used to recursively generate markdown indexes in directories.
Installation
go install github.com/poneding/mdi@latest
Usage
Generate markdown index:
mdi gen
-d
or --workdir
: Specify the directory to generate markdown index.
-t
or --index-title
: Specify the title of markdown index, default is title of markdown index file or current directory name.
--home-title
: Specify the title of home link in markdown index, if not specified, use index-title
.
-f
or --root-index-file
: Specify the markdown root index file, default is zz_gneratered_mdi.md
.
--sub-index-file
: Specify the markdown sub index file, default is zz_gneratered_mdi.md
.
--inherit-gitignore
: Use .gitignore
file as ignore file, default is true
.
--override
: Override markdown existing index file, default is false
.
--no-header-link
: Do not generate header link in index file, default is false
.
-r
or --recursive
: Recursively generate markdown index in subdirectories, default is false
.
--nav
: Generate navigation in markdown file, default is false
.
-v
or --verbose
: Show verbose log, default is false
.
Use .mdiignore
file as ignore file by default.
Other commands:
mdi version
mdi help
mdi completion
Screenshots
Markdown folder:

Generate markdown index:
mdi gen -f README.md -t "My Notes"

As the same time, the index file will be generated in the subdirectory recursively.
Generate nav in markdown file:
mdi gen -f README.md -t "My Notes" --nav

Customize sub index title:
You can customize the sub index title by modifying the first-level title of the sub markdown index file generated in the subdirectory.