Created
February 7, 2018 01:03
-
-
Save Turupawn/99df57c923ba2f649a5026393b60de4c to your computer and use it in GitHub Desktop.
Bakeing A Github Readme into an HTML
This file contains hidden or 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/bash | |
#Usage | |
#Place this scprit in the wiki folder and run the following using your github : | |
#bash bake_wiki.sh USER PASS | |
for fullfile in *; do | |
filename=$(basename "$fullfile") | |
filename="${filename%.*}" | |
echo $filename | |
grip "$filename.md" --export export/"$filename.html" --user=$1 --pass=$2 | |
for fullfile2 in *; do | |
filename2=$(basename "$fullfile2") | |
filename2="${filename2%.*}" | |
find="-" | |
replace=" " | |
filename_with_spaces=${filename2//$find/$replace} | |
sed -i -e "s/\[\[$filename_with_spaces]]/<a href='$filename2.html'>$filename_with_spaces<\/a>/g" export/"$filename.html" | |
done | |
done |
I had to add --no-inline
for grip (v4.5.2
) installed via pip
$ ll -ogh
total 76M
-rw-r--r-- 1 614K Nov 21 04:11 API-Access-options.html
-rw-r--r-- 1 618K Nov 21 04:11 Building.html
-rw-r--r-- 1 621K Nov 21 03:22 Comments.html
-rw-r--r-- 1 622K Nov 21 03:22 'Comments-(C-compatible).html'
-rw-r--r-- 1 614K Nov 21 03:22 Community-options.html
...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can change
to