diff options
-rwxr-xr-x | macro.py | 3 | ||||
-rwxr-xr-x | macro2html.py | 5 |
2 files changed, 7 insertions, 1 deletions
@@ -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") |