Commit 42d3eb41 authored by David Byers's avatar David Byers
Browse files

Improvements to code generated by docgen.

parent 30d0dafa
......@@ -62,9 +62,9 @@
(defun lyskom-docgen-fixup-sgml (str)
(when str
(let ((s str))
(setq s (replace-in-string s "&" "&"))
(setq s (replace-in-string s "<" "&lt;"))
(setq s (replace-in-string s ">" "&lt;"))
(setq s (replace-in-string s "&" "&amp;"))
s)))
(defun lyskom-docgen-get-name (fn lang)
......@@ -128,11 +128,10 @@
(lambda (x)
(format "<keycap>%s</keycap>"
(lyskom-docgen-fixup-sgml (key-description x))))
binding " "))
binding "; "))
(defun lyskom-docgen-2 ()
(lyskom-docgen-princ "<variablelist>\n")
(lyskom-traverse command lyskom-commands
(let* ((name-sv (lyskom-docgen-get-name command 'sv))
(name-en (lyskom-docgen-get-name command 'en))
......@@ -141,35 +140,34 @@
(doc-en (lyskom-docgen-get-doc command)))
(lyskom-docgen-princ
(format "\
<varlistentry>
<term><anchor id=\"fn:%s\" />%s</term>
<listitem>
<informaltable frame=\"top\">
<tgroup cols=\"2\">
<tbody valign=\"top\">
<row>
<entry>English name</entry>
<entry>%s</entry>
</row>
<row>
<entry>English binding</entry>
<entry>%s</entry>
</row>
<row>
<entry>Swedish name</entry>
<entry>%s</entry>
</row>
<row>
<entry>Swedish binding</entry>
<entry>%s</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<section id=\"fn:%s\"><title>%s (%s)</title>
<informaltable frame=\"top\">
<tgroup cols=\"2\">
<tbody valign=\"top\">
<row>
<entry>English name</entry>
<entry>%s</entry>
</row>
<row>
<entry>English binding</entry>
<entry>%s</entry>
</row>
<row>
<entry>Swedish name</entry>
<entry>%s</entry>
</row>
<row>
<entry>Swedish binding</entry>
<entry>%s</entry>
</row>
</tbody>
</tgroup>
</informaltable>
%s
</listitem>
</varlistentry>\n\n"
</section>\n\n"
command
name-en
command
name-en
(lyskom-docgen-format-key-sequence bind-en)
......@@ -177,21 +175,20 @@
(lyskom-docgen-format-key-sequence bind-sv)
doc-en))
(setq lyskom-docgen-found-functions
(cons command lyskom-docgen-found-functions))))
(lyskom-docgen-princ "</variablelist>\n\n"))
(cons command lyskom-docgen-found-functions)))))
(defun lyskom-docgen-generate-missing-anchors ()
(lyskom-docgen-princ "<para>")
(lyskom-docgen-princ "<section><title>Dummy anchors</title><para>\n")
(lyskom-traverse fn (set-difference lyskom-docgen-xrefd-functions
lyskom-docgen-found-functions)
(lyskom-docgen-princ
(format "<anchor id=\"fn:%s\" />Missing target: %s;" fn fn)))
(format "<anchor id=\"fn:%s\" />Missing target: %s; \n" fn fn)))
(lyskom-traverse var (set-difference lyskom-docgen-xrefd-variables
lyskom-docgen-found-variables)
(lyskom-docgen-princ
(format "<anchor id=\"var:%s\" />Missing target: %s;" var var)))
(lyskom-docgen-princ "</para>"))
(format "<anchor id=\"var:%s\" />Missing target: %s; \n" var var)))
(lyskom-docgen-princ "</para></section>\n"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment