summaryrefslogblamecommitdiffstatshomepage
path: root/util/mdconv.sh
blob: 4385f51a0b68dc6c5ebc4b0f3f9275d05f36e382 (plain) (tree)
1
2
3
4
5
6
7
8





                                  

                                               





                                          
                                                              

                                                                                
                              

          
set -e

title="$(lowdown -X title "$1")"
date="$(lowdown -X date "$1")"
author="$(lowdown -X author "$1")"

flags="--html-no-skiphtml --html-no-escapehtml"

cat<<EOF
<?xml version="1.0" encoding="UTF-8" ?>
<article data-sblg-article="true">
	<header>
		<h1>$title</h1>
		<address>$author</address>
		<a href=".." title="Back to frontpage">↖</a>
		<time datetime="$date">$(date -d"$date" '+%A, %B %e, %Y')</time>
	</header>
	$(lowdown $flags "$1")
</article>
EOF