Skip to content

Instantly share code, notes, and snippets.

@noah
Last active September 8, 2018 03:30
Show Gist options
  • Save noah/9452301630e2610a3250b25c83308404 to your computer and use it in GitHub Desktop.
Save noah/9452301630e2610a3250b25c83308404 to your computer and use it in GitHub Desktop.
mmw: _inimalistic _arkdown _iki
#!/bin/sh
#
# mmw: _inimalistic _arkdown _iki
#
# dependencies:
# - grip (or another markdown compiler)
# - tree(1)
#
# installation:
# - cat mmw> ./git/hooks/post-commit
# - echo "all:\n\tmmw" > makefile
# - mkdir .output
#
# server {
# listen 80;
# server_name localhost;
# root /home/your/wiki/.output;
# index index.html;
# location / {
# autoindex on;
# try_files $uri $uri/ $uri.html =404;
# }
# }
#
# use:
# - create nested dirs of markdown
# - ./mmw and/or git commit (if post-commit hook)
#
# todo:
# - parallel make (grip is sloooow)
# - add iframes
find . -name "*.md" | while read f; do
echo $f
mkdir -p .output/$(dirname $f)
grip $f --export - > .output/"${f%.*}".html
done
unalias tree 2> /dev/null
tree \
-t \
-F \
-H . \
.output > .output/index.html
#.output | tee .output/index.html | elinks -dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment