I am looking for a way to produce HTML documentation for functions and variables defined in my .el files. One way I have seen suggested is by using texi2html tool. The challenge is to produce the input for texi2html. In particular, how do I export help for multiple Emacs-Lisp symbols into a single Texinfo file?


For racket-mode I wanted to have GitHub host a Reference.md file that recapitulated the doc strings for user commands, vars, and faces. That way, people could browse online without installing.

What I came up with to do so is racket-make-doc.el. How it works:

  1. I specify the commands, vars, and faces in a defconst for each.
  2. Iterate over each, using (respectively) (documentation symbol), (documentation-property s 'variable-documentation), and (documentation-property symbol 'face-documentation).
  3. Do some cleanup and transforms to try to produce valid markdown:
    • Try to "linkify".
    • Adjust <code>-ish quotes from `docstring' to `markdown` style.
    • HTML escaping.

It's all a bit kludgy but I offer it as-is in case it's a starting point.

Step 3 could instead emit a .org or .texinfo format file. I suppose it could even emit a .html file in the first place.

UPDATE: More recently, I'm doing almost exactly what I think you want: these sources produce this HTML.

 | racket-mode.org |     +---------------+      ---------------
 | #!INCLUDE:      |--<--| reference.org |--<--/ generate.el  /---<--{doc strings}
 +-----------------+     +---------------+     ---------------
        |       +------------------+       +------------------+
        +--->---| racket-mode.texi |--->---| racket-mode.info |
        |       +------------------+       +------------------+
        |       +------------------+
        +--->---| racket-mode.html |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.