aboutsummaryrefslogtreecommitdiff
path: root/aux/emparse
diff options
context:
space:
mode:
Diffstat (limited to 'aux/emparse')
-rwxr-xr-xaux/emparse29
1 files changed, 14 insertions, 15 deletions
diff --git a/aux/emparse b/aux/emparse
index 73fdd5c..e59487d 100755
--- a/aux/emparse
+++ b/aux/emparse
@@ -15,7 +15,7 @@ function escape(s) {
}
function beginblock(name) {
- if (name == "nl") printf "<ol>\n"
+ if (name == "nl") printf "<ol class=\"reflist\" style=\"font-size: small;\">\n"
else printf "<%s>\n", name
}
@@ -57,8 +57,8 @@ function heading(level, line) {
function item(level, type, line) {
if (openitem) printf "</li>"
openitem = 1
- if (level > itemlevel) printf "<ul>\n"
- if (level < itemlevel) printf "</ul>\n"
+ if (level > itemlevel) printf "<%s>\n", type
+ if (level < itemlevel) printf "</%s>\n", type
itemlevel = level
if (type == "ul") {
sub("^ +- ", "")
@@ -92,8 +92,7 @@ function term(line, t) { # t is a local variable
function ref(v) {
if (ENVIRON["ref" v] != "")
return "(<a href=\"" ENVIRON["ref" v] "\">" linktext "</a>)"
- else
- return "[<a href=\"#ref" v "\">" v "</a>]"
+ return "[<a href=\"#ref" v "\">" v "</a>]"
}
function format(line) {
@@ -179,15 +178,15 @@ openblock == "nl" && /^ \[[0-9a-z]\]+ [^ ]+$/ { next } # hyperlink reference
openblock == "nl" && /^ \[[0-9a-z]\]+ / { item(1, "nl", line) } # text reference
openblock == "dl" && /^ .*: / { term(line) }
-openblock == "ul" && /^ -/ { item(2, "ul", line) }
-openblock == "ol" && /^ [0-9a-z]+\./ { item(2, "ol", line) }
-openblock == "ul" && /^ -/ { item(3, "ul", line) }
-openblock == "ol" && /^ [0-9a-z]+\./ { item(3, "ol", line) }
-openblock == "ul" && /^ -/ { item(4, "ul", line) }
-openblock == "ol" && /^ [0-9a-z]+\./ { item(4, "ol", line) }
-openblock == "ul" && /^ -/ { item(5, "ul", line) }
-openblock == "ol" && /^ [0-9a-z]+\./ { item(5, "ol", line) }
-openblock == "ul" && /^ -/ { item(6, "ul", line) }
-openblock == "ol" && /^ [0-9a-z]+\./ { item(6, "ol", line) }
+(openblock == "ul" || openblock == "ol") && /^ -/ { item(2, "ul", line) }
+(openblock == "ul" || openblock == "ol") && /^ [0-9a-z]+\./ { item(2, "ol", line) }
+(openblock == "ul" || openblock == "ol") && /^ -/ { item(3, "ul", line) }
+(openblock == "ul" || openblock == "ol") && /^ [0-9a-z]+\./ { item(3, "ol", line) }
+(openblock == "ul" || openblock == "ol") && /^ -/ { item(4, "ul", line) }
+(openblock == "ul" || openblock == "ol") && /^ [0-9a-z]+\./ { item(4, "ol", line) }
+(openblock == "ul" || openblock == "ol") && /^ -/ { item(5, "ul", line) }
+(openblock == "ul" || openblock == "ol") && /^ [0-9a-z]+\./ { item(5, "ol", line) }
+(openblock == "ul" || openblock == "ol") && /^ -/ { item(6, "ul", line) }
+(openblock == "ul" || openblock == "ol") && /^ [0-9a-z]+\./ { item(6, "ol", line) }
{ format($0) }