summaryrefslogblamecommitdiffstatshomepage
path: root/util/mdconv.sh
blob: 58f9cd8a681e7102e32fa3a736252e83cfd6dd66 (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 class="post">
		<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>
	<section class="post">
		$(lowdown $flags "$1")
	</section>
</article>
EOF