summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmacro.py3
-rwxr-xr-xmacro2html.py5
2 files changed, 7 insertions, 1 deletions
diff --git a/macro.py b/macro.py
index 957c7af..40262cb 100755
--- a/macro.py
+++ b/macro.py
@@ -104,9 +104,10 @@ class Macro:
raise Exception("%s: malformed license section" % filePath)
body = collapseText(body)
elif key == "obsolete macro":
- key = "obsolete"
if '' in body:
raise Exception("%s: malformed obsoleted section" % filePath)
+ key = "obsolete"
+ body = collapseText(body)
elif key == "description":
body = collapseText(body)
else:
diff --git a/macro2html.py b/macro2html.py
index d49d9c9..8e14bf7 100755
--- a/macro2html.py
+++ b/macro2html.py
@@ -41,6 +41,7 @@ tmpl = """\
<h1>
%(name)s
</h1>
+%(obsolete)s
<h2>
SYNOPSIS
</h2>
@@ -101,6 +102,10 @@ if len(sys.argv) != 3:
(m4File,outFile) = sys.argv[1:]
assert outFile != m4File
m = Macro(m4File)
+if m.__dict__.get("obsolete"):
+ m.obsolete = "<h2>Obsolete Macro</h2>" + '\n'.join(map(formatParagraph, m.obsolete))
+else:
+ m.obsolete = ""
m.synopsis = "<br>\n".join([ "<code>%s</code>" % quoteHtml(l) for l in m.synopsis ])
m.description = '\n\n'.join(map(formatParagraph, m.description))
m.description = m.description.replace("</pre>\n\n<pre>", "\n\n")