1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00
dotfiles/blog/.local/bin/exportWiki

18 lines
599 B
Plaintext
Raw Normal View History

2020-07-06 15:07:22 +00:00
#!/bin/sh
2020-10-09 15:14:58 +00:00
fromDir="$HOME/Documents/slip-box/"
2020-07-06 15:07:22 +00:00
toDir="$HOME/devel/personal/Ryankes.eu/wiki"
date=$(date)
rm -rf "$toDir"/wiki/*
grep -ril "^\#+select_tags:[\ a-zA-Z0-9]namepage" "$fromDir"*.org | while read -r line; do
2020-07-06 15:07:22 +00:00
baseName="$(basename "$line")"
markdownFilename="$(echo "$baseName" | cut -f 1 -d '.').md"
pandoc "$line" --filter convertLinks.py -t markdown_mmd+yaml_metadata_block -o "$toDir/wiki/$markdownFilename" -s
echo "Exporting $baseName to $markdownFilename"
done
git -C "$toDir" add .
git -C "$toDir" commit -m "feat: update $date"
2020-07-06 15:07:22 +00:00
git -C "$toDir" push origin master