A lightweight table-of-content generator for Markdown
Written in shell script, POSIX-compliant table of content (TOC for short) generator.
NOTE: This page's table of content was also made by this script.
I needed a TOC generator so I made one myself.
THE END
It's short, innit? 😏
For now, the only way is cloning the repository to your local machine.
Get the whole git tree.
git clone https://github.com/Adamocho/smalltoc.git ~/.local/smalltoc
Get the latest code only (git shallow clone) - less disk space.
git clone --depth 1 https://github.com/Adamocho/smalltoc.git ~/.local/smalltoc
Now cd
inside and install it.
./smalltoc.sh install
This script may need execute permission.
In that case use:[sudo] chmod +x FILENAME
Simply use uninstall
smalltoc uninstall
NOTE: This command DOES NOT remove the files from one's computer. It only deletes this script from
/usr/bin/
directory. If one wishes to remove the files entirely, delete the git repository (with uninstalling done first).
Usage is very straightforward. Just give it file(s) to generate TOC for.
smalltoc FILE_1 FILE_2 FILE_3 [...]
# OR
smalltoc [OPTION]
It saves them in the $HOME/.cache/smalltoc
directory.
Sample output
[...]
Generating TOC for ~/Documents/sample_readme.md
The file is saved in ~/.cache/smalltoc/README.md
Use it either without arguments or with -h
| --help
flags.