aboutsummaryrefslogtreecommitdiff
path: root/convert_microposts_standalone.sh
blob: b78b73320fce95950387fc075e490d3dc359847b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

for md in $(ls ./microposts/*.md); do
    base=$(basename $md)
    fname="${base%%.*}"
#    pandoc -s -f markdown -t org -o ./microposts/${fname}.org ${md}
    echo "pandoc -s -f markdown -t org --filter ./filter.hs --metadata filename=${fname} -o ./microposts/${fname}.org ${md}"
    pandoc -s -f markdown -t org --filter ./filter-standalone.hs --metadata title=${fname} -o ./microposts/${fname}.org ${md}
#    sed -i "s/:END:/&\n/" ./microposts/${fname}.org  # add a new line before the content
done
sed -i 's/^\(#+date:\s\+\)\(.\{10\}\)/\1<\2>/' ./microposts/*.org  # fix the dates