Package liber
The Liber library is a HTML documentation generation tool for Common Lisp
packages. It extracts documentation strings written in a custom markup
language and generates either multiple HTML pages or a single HTML page for
the documentation. The source code for the Liber library is available on GitHub.
Liber is developed using SBCL on Ubuntu. The library runs successfully on Windows. The Liber library is licensed under the MIT license.
Liber is a forck of the atdoc library written by David Lichteblau.
Liber is developed using SBCL on Ubuntu. The library runs successfully on Windows. The Liber library is licensed under the MIT license.
Liber is a forck of the atdoc library written by David Lichteblau.
About This PackageOutput formats Sample Documentation The Liber syntax Writing a documentation string Generating formatted documentation Generating unformatted XML OverviewAuthorCopyright (C) 2006 - 2008 David LichteblauCopyright (C) 2012 . 2025 Dieter Kaiser HomepageThe documentation is available at Liber API documentation.DownloadThe source code for the Liber library is available on GitHub.InstallationThe Liber library is ASDF-installable:(asdf:load-system :liber) DependenciesThe Liber library needs Closure XML, Split sequence, Xuriella XSLT, Closer-MOP, and their dependencies.Output formatsThe Liber library can currently generate documentation in these formats:
Sample DocumentationAs an example, code from the book Lisp (3rd edition) by Winston and Horn is chosen. You can find the code with an ASDF definition in the example/ subdirectory of the Liber sources so that you can easily compile it yourself. The code included is the Blocks World, from chapter 21: "The Blocks World with Classes and Methods" and chapter 22: "Answering Questions about Goals". Note that the source code from the book has been taken from the publically available lisp3 tarball and is covered by its own license, different from the license of the Liber library.In general, you will write a Lisp script that loads the necessary packages for the documentation, configures the environment and executes the HTML generation. Below is an example from the generate-html.lisp file for the BLOCKS-WORD example that comes with the library. ;; Make HTML (multiple pages) (defun generate-html () (let* ((base (asdf:component-pathname (asdf:find-system :blocks-world))) (output-directory (merge-pathnames "doc/" base))) (ensure-directories-exist output-directory) (liber:generate-html-documentation '(:blocks-world :blocks-world-goals) output-directory :author "Crategus" :author-url "http://www.crategus.com" :index-title "Blocks World API documentation" :heading "blocks-world" :css "default.css" :icon "lambda.icon" :single-page-p nil :paginate-section-p nil :include-slot-definitions-p t :include-internal-symbols-p nil))) The Liber syntaxLiber looks for markup tags that start with an at-sign @, in either a long or a short form. The short form looks like this:@return{The string for the result.}The long form can be convenient for multiple lines of text: @begin{return} The string for the result. @end{return}The two forms are completely interchangeable. Behind the scenes, both produce an XML element with tag name result, <result>The string for the result.</result>. Both forms can take an optional argument, written with brackets, that is used in the following example to pass a hyperlink: @url[http://www.crategus.com/books/liber]{Liber API documentation}The long form is: @begin[http://www.crategus.com/books/liber]{url} Liber API documentation @end{url}These forms gets translated into <a a="http://www.crategus.com/books/liber">Liber API documentation</a>, until the XSLT stylesheets rename the <a> tag into href. A second example with an argument in brackets is: @begin[Title]{section} body @end{section}which gets translated into <section section="Title">body</section>. The at-sign also escapes special characters. For example, closing braces need to be escaped with the at-sign like {n,m@}. Multiple line breaks delimit paragraphs: First paragraph. Writing a documentation stringHere is an example of what the documentation of the gtk:application-active-window accessor looks like using Liber:(setf (liber:alias-for-function 'application-active-window) "Accessor" (documentation 'application-active-window 'function) "@version{2025-07-28} @syntax{(gtk:application-active-window object) => window} @argument[object]{a @class{gtk:application} instance} @argument[window]{a @class{gtk:window} widget} @begin{short} The accessor for the @slot[gtk:application]{active-window} slot of the @class{gtk:application} class returns the active window of the application. @end{short} The active window is the one that was most recently focused within the application. This window may not have the focus at the moment if another application has it - this is just the most recently focused window within this application. @see-class{gtk:application} @see-class{gtk:window}")Note that parts of the documentation strings are just documentation text, which will be included in a section "Details" of the page. Other parts, however, are not part of the actual text, and will be extracted from the documentation string as the first step of processing it. In this case, @argument, @return, and @see-function are the tags that will be removed. All @argument tags will be collected into a section about the function's arguments, all @see-function tags will be collected into a "See also" section. Tags for use only in the docstring of a package itself
The following tags are listed in their short form, but are typically used
in their long form.
Tags that will be extracted into their own sections
Tags for use in the documentation text
The following tags are predefined to emphasize the use of symbols in a
way similar to the Common Lisp Hyperspec. The fonts of these tags are
predefined in a style sheet, which can be overwritten. Furthermore, these fonts are used within other tags like @argument, @return, or @syntax. This way a uniform style can be ensured over the
generated documentation.
Tags for Lists
Use the following tags to generate unordered, ordered, or defintion lists
in the documentation.
Tags that are passed through to HTML
Generating formatted documentationGenerates HTML pages or a single HTML page. Generates HTML documentation for packages. ... Generating unformatted XMLPower users might want to extract docstrings into XML and then send that XML through their own XSLT stylesheets. Extracts docstrings from packages and writes them in XML syntax to .atdoc.xml in the specified directory. ... | Exported Symbol Index
|