Check whether there are any URLs before iterating over them.
[mkws-moved-to-github.git] / doc / tweak-html
index 44d208b..b12cdec 100755 (executable)
@@ -3,4 +3,18 @@
 # Tweak the HTML generated by pandoc into the form we want
 
 cat ${@+"$@"} |
-    sed '/^<col width="[0-9]*%" \/>$//d'
+    sed '/^<col width="[0-9]*%" \/>$/d' |
+    sed 's/<body>/&\
+<img src="images\/mkws-logo-300px.png" alt="MKWS logo"\/>/' | awk '
+/^<(h[12]|div) id/ {
+  if (seen) {
+    print "</div>";
+  }     
+  print "<div class='"'"pane"'"'>";
+  seen = 1;
+}
+/^<hr/ {
+  print "</div>";
+}
+{ print }
+'