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-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.
- The ADP guide: The ADP User Guide
- The ADP api: ADP User Interface
- The Style-Maker guide: The Style-maker Guide
- The Style-Maker api: Style-maker API
Keyword name | File type | Extra dependencies | Authors |
---|---|---|---|
:github-md | md |
nil | Héctor Galbis Sanchis |