-
-
Save noah/9452301630e2610a3250b25c83308404 to your computer and use it in GitHub Desktop.
mmw: _inimalistic _arkdown _iki
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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