diff --git a/3rdparty/mmu_man/scripts/hugo_to_pandoc.sh b/3rdparty/mmu_man/scripts/hugo_to_pandoc.sh new file mode 100755 index 0000000000..eb2df57137 --- /dev/null +++ b/3rdparty/mmu_man/scripts/hugo_to_pandoc.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# This script tries to convert a hugo markdown source into a markdown that pandoc can read, to convert to ODT for example. + +# First filter turns inline links into footnotes with italic link text and monospace URL. +# Second filter turns img tags into regular markdown images +# Third filter converts enough of the Hugo header into pandoc's own header format. + +sed -r 's/\[([^\[]*)\]\(([^()]*)\)/*\1*^[`\2`]/g' | \ +sed -r 's,,![\2](static\1),g' | \ +sed -r '/^\+\+\+$/{c\ +--- +};/^tags = \[.*$/d;1,5s/(.*) = "(.*)"/\1: \2/'