Auto Summary allows to generate SUMMARY files for directory (and its subdirectories) containing Markdown files. This can be useful for maintaining personal knowledge database or team wiki. Auto summary can also watch your filetree and update all links on any file change, such as renaming, moving file around, deleting etc...
Auto Summary is availiable as a standalone python script and as vim plugin.
Auto Summary creates <DIRNAME>.md files for every directory and its subdirectories, where it finds markdown files, where DIRNAME is current directory name. See example below.
- Clone the repo
git clone https://github.com/technogleb/auto_summary.git ~/
- If you want to automatically watch for changes, you need to install watchdog
pip3 install -r ~/auto_summary/requirements.txt
- Generate SUMMARY
python3 ~/auto_summary/cli.py -r path/to/your/markdown/root
If you want to have wikilinks instead of classic markdown links, pass --wikilinks option
python3 ~/auto_summary/cli.py -r path/to/your/markdown/root --wikilinks
- Automatically watch for changes
To automatically watch changes and update links, run cli with --watch_changes
option.
Note that it requires watchdog to be installed.
python3 ~/auto_summary/cli.py -r path/to/your/markdown/root --watch_changes
Auto Summary can also be used as a Vim(NeoVim) plugin.
- Via your favorite plugin manager (here I use Vundle for example)
Add this to your .vimrc file (or to ~/.config/nvim/init.vim
if you use NeoVim)
Plugin technogleb/auto_summary
Don't forget to source your .vimrc later and run :PluginInstall
- Manually
mkdir -p ~/.vim/my_package/my_package/start
git clone https://github.com/technogleb/auto_summary.git ~/.vim/my_package/my_package/start
In order to use automatic mode, you need to install watchdog. Installation differs for Vim and NeoVim.
- Vim
NOTE: Auto Summary only supports python3.
NOTE: Vim can only use the python it was compiled with, so you have to install watchdog in its' site-packages dir.
NOTE: watchdog may conflict with other plugins, using watchdog, such as YouCompleteMe
-
Find python, your vim was compiled with by
vim --version
-
Install watchdog
/path/to/vim-compiled/python -m pip install -r ~/.vim/bundle/auto_summary/requirements.txt
- NeoVim
Use you default system python3, or install it into virtual environment
pip3 install -r ~/.vim/bundle/auto_summary/requirements.txt
- Generate SUMMARY
:Summarize
- generates SUMMARY, starting from your session root - i.e. where
you started your current vim session
:Summarize <path/to/root>
- generates SUMMARY, starting from path specified
- Automatically watch for changes
In order to automatically watch for changes, set let g:watch_markdown_changes=1