[erlang-questions] Accessing the documentation at runtime

Richard A. O'Keefe <>
Thu Sep 29 01:56:53 CEST 2016



On 29/09/16 7:28 AM, Vlad Dumitrescu wrote:
> Hi,
>
> Following the documentation discussion, and the details about how Elixir
> supports that as API, I wonder if we could (should?) support something
> similar for Erlang.

Quintus Prolog did this back in the 1980s.
The manuals were originally written in Scribe,
then switched over to LaTeX, using very simple
markup.
They were automatically converted to plain text
files, one per section, and
- REPL "take me to this section"
- REPL "take me to this topic"
- Emacs "take me to the documentation for this"
- Emacs "navigate within documentation"
worked from that.

I believe SWI Prolog does something similar.

R has its own markup "Rd" and
   R CMD Rdconv
     converts Rd to plain text, LaTeX, HTML,
     or extracts examples so R can run them.
   R CMD Rd2pdf
     converts Rd (listed files, or in a directory)
     to PDF.
   R CMD Rd2txt
     converts Rd to plain text
This means that it's possible to write a 'man' equivalent
for R if you know where the Rd files are.  It also supports

   help(topic, package = NULL, lib.loc = NULL,
           verbose = getOption("verbose"),
           try.all.packages = getOption("help.try.all.packages"),
           help_type = getOption("help_type"))
   help.search(pattern, fields = c("alias", "concept", "title"),
           apropos, keyword, whatis, ignore.case = TRUE,
           package = NULL, lib.loc = NULL,
           help.db = getOption("help.db"),
           verbose = getOption("verbose"),
           rebuild = FALSE, agrep = NULL, use_UTF8 = FALSE,
           types = getOption("help.search.types"))
   ??pattern
   field??pattern
   ?word

in the REPL, and of course help() and help.search()
may be called from code.

Note that a good way to store XML is to use a compressor like XMill.



More information about the erlang-questions mailing list