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

18 lines
599 B
Bash

#!/bin/sh
fromDir="$HOME/Documents/slip-box/"
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
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 "docs: update $date"
git -C "$toDir" push origin master