Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate HTML from Emacs Lisp documentation?

Emacs calls itself self-documenting. This means that you can use Emacs to read the documentation that is encoded in the Emacs-Lisp files.

Is there an easy way to export this documentation to HTML, so that the documentation can be placed on a website? I know that the FSF publishes the documentation at http://www.gnu.org/software/emacs/manual/emacs.html but not all of the Emacs modules are listed there.

Update: I'm interested in the documentation in the elisp files, not in texinfo files. I also want the documentation for the functions and for the "major mode". In the Emacs documentation viewer, this is all nicely hyperlinked and it would be great if that were preserved in HTML.

like image 791
Philippe Avatar asked May 18 '11 08:05

Philippe


Video Answer


2 Answers

I don't think the documentation is "encoded in Emacs-Lisp files". They're stored as texinfo documents that can be exported to HTML (which is I think how the GNU documentation site is generated). texi2html can convert texinfo files into HTML.

The docstrings for the functions are stored in the elisp files directly. If you want those, you'll have to iterate through the list of functions, get the docstring and create an HTML file. I think it should be doable in a few lines of elisp.

Xah Lee comments here on how they should be using HTML anyway.

like image 41
Noufal Ibrahim Avatar answered Oct 24 '22 20:10

Noufal Ibrahim


Part of the answer may be to simply use/extend existing Lisp automatic documentation generators. Here are a few links that might get you there:

  • Albert
  • atdoc
  • CLiki page on documentation tools
like image 103
semperos Avatar answered Oct 24 '22 20:10

semperos