Add Documentation, Please. A documentation generator.

Upstream URL


Héctor Galbis Sanchis


The Unlicense

Add Documentation, Please

Welcome to ADP!


Add Documentation, Please is a library for literate programming and semi-automatic API generation. There are already good projects for literate programming like Erudite so, why another project? Well, they work differently and Erudite just doesn't adjust to my needs.

ADP is simple but practical. To generate documentation you have to use different macros. For example, if you want a header, then you use the ADP:HEADER macro. Or if you want a block of code you use ADP:CODE-BLOCK. The reason behind using macros to literate programming is that you can make your own macros using the ones exported by ADP.

Generating the API documentation is also easy. Suppose that you have the following function definition:

(DEFUN FOO () "A function that does nothing." (VALUES))

ADP redefines the macro DEFUN. To generate the documentation for this function you just need to tell Common Lisp that the macro ADP:DEFUN used is the one from the package adp:

(ADP:DEFUN FOO () "A function that does nothing" (VALUES))

That's all! And the same occurs with every Common Lisp macro that defines something, like ADP:DEFPACKAGE or ADP:DEFINE-METHOD-COMBINATION.

You may be thinking that this will make your code slower because now your code is gathering information for printing documentation. But that is not the case. The documentation generation is controlled by a global variable. This way, when you load your system like always, ADP will do nothing. Literally (try to macroexpand some ADP macro). The generation is activated only when you load your system using the function ADP:LOAD-DOCUMENTATION-SYSTEM. Even you can create a different system for loading the files you need for documentation.

Finally, you can also choose between several styles. Each style creates different files. For example, the style GITHUB-MD generates md files. In fact, the readme file you are reading right now has been generated by ADP, so if this is a markdown file you are seeing the GITHUB-MD style. Another style could generate html files or tex files.


ADP is available on Quicklisp! So, just eval (ql:quickload :adp). It is also available on the Ultralisp distribution.


Available styles

Keyword nameFile typeExtra dependenciesAuthors
:github-mdmdNILHéctor Galbis Sanchis

Dependencies (2)

  • alexandria
  • hyperspec

Dependents (0)

    • GitHub
    • Quicklisp