$ ./indexmaker
- Finds all Markdown files in current folder
- Recursively finds all Markdown files in subdirs
- Creates
index.md, and adds Markdown relative links inside thatindex.mdfor all found Markdown files.
Supported file extensions: .markdown, .mdown, .mkdn, .md, .mkd, .mdwn.
Example; given this folder structure and files:
.
├── LICENSE.txt
├── README.md
├── example_dir1
│ ├── another_dir1.md
│ └── dir1.md
├── example_dir2
│ └── dir2_subdir
│ └── subdir2.md
├── index.md
├── indexmaker.py
└── root_md.md
Generates this index.md:
[README.md](./README.md)
[root_md.md](./root_md.md)
[example_dir1/another_dir1.md](example_dir1/another_dir1.md)
[example_dir1/dir1.md](example_dir1/dir1.md)
[example_dir2/dir2_subdir/subdir2.md](example_dir2/dir2_subdir/subdir2.md)
If an existing index.md is found it is renamed index_old.md.
Note the script doesn't add a link for itself, ie, no link is created for index.md or index_old.md. In the scenario above indexmaker.py had previously been run so there was already a prior index.md in the root of the folder.
To choose your own labels for generated links, run with the interactive flag:
$ ./indexmaker -i
$ ./indexmaker -h
Please open an issue.
Tested:
- OSX: py 2.7 & 3.4.3
- Windows 7: py 2.7 & 3.4.3
