Documente Academic
Documente Profesional
Documente Cultură
1.1.0
A tool to generate documentation about Lisp projects through an HTML tem-
plate.
About Staple
How To
1
for the package index, but you may specify your package/s directly too if they
differ using the :PACKAGES argument.
Staple automatically searches your source directory for documentation files (like
README.md) to include into the finished file. You may however specify your
own file or a string directly with the :DOCUMENTATION argument. Staple currently
only parses Markdown files to HTML, but you may extend it with other formats
by adding a parse-documentation-file method.
The template used to generate everything is a Clip document. Understanding
how it works and throwing together your custom layout to use should not be
hard. For a full understanding of the system however please read the Clip
documentation.
Extending Staple
2
docs is
(ql:quickload ’(staple my-system))
(staple:generate :my-system)
and Staple will figure out everything automatically.
Documentation Browser
Staple includes a server so that you can view the documentation and symbol
index of all available ASDF systems on the fly.
(ql:quickload :staple-server)
(staple-server:start)
Depending on how many systems you have loaded, starting the server may take
a while as it produces a cache of all documentation pages. Once it’s done, visit
the url in the message. If you change the systems and want to view the updated
documentation, use staple-server:recache.
Copyright
Package Index
STAPLE (ORG.TYMOONNEXT.STAPLE)
– special
*DEFAULT-TEMPLATE*
Pathname to the default template to use in GENERATE.
special
3
*DOCUMENTATION-NAMES*
– A list of strings denoting common file names (without extension) for documentation
If you have your own file name, push it onto this list.
See *DOCUMENTATION-TYPES*
See FIND-DOCUMENTATION-FILE
– special
*DOCUMENTATION-TYPES*
A list of strings denoting common file types/extensions for documentation files.
If you have your own file type, push it onto this list.
See *DOCUMENTATION-NAMES*
See FIND-DOCUMENTATION-FILE
special
*EXTENSION-FILE*
– Pathname describing the filename for Staple extension files.
– special
*LEGACY-TEMPLATE*
Pathname to a rather plain and simple preset template that was used before the mode
special
*LOGO-NAMES*
– A list of strings denoting commong file names (without extension) for logos.
If you have your own file name, push it onto this list.
See *LOGO-TYPES*
See FIND-LOGO-FILE
– special
*LOGO-TYPES*
A list of strings denoting commong image types/extensions for logos.
If you have your own file type, push it onto this list.
See *LOGO-NAMES*
4
See FIND-LOGO-FILE
special
*MODERN-TEMPLATE*
– Pathname to a simple, yet modern preset template.
– class
SYMB-ACCESSOR
Object representing an accessor.
class
SYMB-CLASS
– Object representing a class.
– class
SYMB-CONDITION
Object representing a condition.
class
SYMB-CONSTANT
– Object representing a constant.
– class
SYMB-FUNCTION
Object representing a function.
class
SYMB-GENERIC
– Object representing a generic function.
– class
5
SYMB-MACRO
Object representing a macro.
class
SYMB-METHOD
– Object representing a generic function method.
– class
SYMB-OBJECT
Base class for symbol representation.
class
SYMB-SPECIAL
– Object representing a special variable.
– class
SYMB-STRUCTURE
Object representing a structure.
class
SYMB-TYPE
– Object representing a type.
– class
SYMB-VARIABLE
Object representing a variable.
accessor (
CONVERTER
NAME)
– Accessor to the converter function associated with the name.
Each converter function takes two arguments, a symbol and a package,
and must return a list of symb-object instances.
6
– accessor (
SYMB-METHOD
OBJECT)
No docstring provided.
– accessor (
SYMB-PACKAGE
SYMB-OBJECT)
Returns the symbol-package of the symbol.
accessor (
SYMB-SYMBOL
OBJECT)
– Returns the actual symbol backed by the symbol object.
– accessor (
SYSTEM-PACKAGES
SYSTEM)
Accessor to the list of packages associated to the system.
If the loading process of the system happened before staple was loaded, a
heuristic is used where a package name is returned that corresponds to the
system’s name. If the system was loaded after staple, this should return
the precise list of packages that the system defined.
See *SYSTEM-PACKAGES*
function (
ANCHOR
OBJECT)
– Returns a href-anchor.
– function (
7
DAY
)
Return the current day of the month
function (
FIND-DOCUMENTATION-FILE
ASDF)
– Attempts to find a documentation file in the given asdf system’s source directory.
This relies on *DOCUMENTATION-NAMES* and *DOCUMENTATION-TYPES* to find an appropria
See *DOCUMENTATION-NAMES*
See *DOCUMENTATION-TYPES*
– function (
FIND-LOGO-FILE
ASDF)
Attempts to find a logo file in the given asdf system’s source directory.
See *LOGO-NAMES* and *LOGO-TYPES*. The system will also try to find files by
prepending or appending the system name to the logo names.
See *LOGO-NAMES*
See *LOGO-TYPES*
function (
GENERATE
ASDF-SYSTEM &REST ARGS &KEY COMPACT DOCUMENTATION
EXTENSION LOGO NAME OUT PACKAGES TEMPLATE IF-EXISTS
&ALLOW-OTHER-KEYS)
– Generates documentation for the given asdf-system.
8
location for their extension files.
See SYSTEM-OPTIONS
See *EXTENSION-FILE*
– function (
LICENSELINK
LICENSE)
Returns an A tag linked to a TLDRLegal.com search on the license name.
function (
MONTH
)
– Return the current month
– function (
PACKAGE-SYMBOL-OBJECTS
PACKAGE)
Gathers all possible symbol-objects of the given package.
function (
PACKAGE-SYMBOLS
PACKAGE)
– Gets all symbols within a package.
– function (
PREPARE-DOCUMENTATION
SYSTEM DOC)
9
Attempts to prepare the documentation for the given system.
In the case of a pathname, PARSE-DOCUMENTATION-FILE is called.
If the doc is NIL, a matching documentation file is attempted to be found through
FIND-DOCUMENTATION-FILE. If nothing is foudn for that as well, an empty string is
returned instead.
function (
REMOVE-CONVERTER
NAME)
– Remove the named converter.
See CONVERTER
– function (
RENDER-DOCSTRING-MARKDOWN
STRING)
Renders the docstring as a markdown highlighted string.
function (
RENDER-DOCSTRING-SEE-ALSO
STRING)
– Renders the docstring plainly, turning ’See X’ lines into links.
– function (
RESOLVE-SYMBOL-DOCUMENTATION
SYMBOL)
Attempts to resolve the (string) symbol to either an URL or an anchor.
This works by first testing against the package. If it is known (such as the
sb-*, mop, cl and *current-packages*) a link/anchor is returned. If nothing
can be found, NIL is returned instead. If no package designator is given,
the symbol is attempted to be automatically found in either the
*current-packages* or in CL.
function (
10
STAPLE
IN &KEY (OUT (TO-OUT IN)) (IF-EXISTS :SUPERSEDE) CLIP-ARGS
(COMPACT T))
– Performs stapling actions/clip processing on the IN document.
STEXT
NODE OBJECT)
Same as lQuery’s TEXT, but calls PRINC-TO-STRING on the object or uses an empty str
function (
SYMB-TYPE<
A B)
– Used to sort symbols alphabetically, grouped by their type.
– function (
SYMBOL-CLASS-P
SYMBOL)
Returns T if the symbol is a class.
function (
SYMBOL-CONDITION-P
SYMBOL)
– Returns T if the symbol is a condition.
– function (
SYMBOL-CONSTANT-P
SYMBOL)
Returns T if the symbol is a constant.
function (
11
SYMBOL-FUNCTION-P
SYMBOL)
– Returns T if the symbol is a pure function.
– function (
SYMBOL-GENERIC-P
SYMBOL)
Returns T if the symbol is a generic function.
function (
SYMBOL-OBJECTS
SYMBOLS &OPTIONAL PACKAGE)
– Gathers all possible symbol-objects out of the list of passed symbols.
– function (
SYMBOL-SETF-FUNCTION-P
SYMBOL)
Returns T if the symbol is a setf function.
function (
SYMBOL-STRUCTURE-P
SYMBOL)
– Returns T if the symbol is a structure.
– function (
TO-OUT
PATHNAME)
Returns a pathname whose file-name (not extension) is postfixed by .out .
function (
12
YEAR
)
– Return the current year
– generic (
PARSE-DOCUMENTATION-FILE
TYPE STREAM)
Used to perform special parsing on certain documentation files (such as Markdown).
The type should be an EQL-specializer to a keyword of the file-type/extension.
By default only .md files are specially handled, everything else is simply read as
generic (
RENDER-DOCSTRING
STRING SYSTEM)
– Render the docstring appropriately for the given system.
See RENDER-DOCSTRING-SEE-ALSO
See RENDER-DOCSTRING-MARKDOWN
– generic (
SYMB-ARGUMENTS
SYMB-OBJECT)
Returns the arguments of the function or NIL.
generic (
SYMB-DOCUMENTATION
SYMB-OBJECT)
– Returns the documentation-string.
– generic (
13
SYMB-FUNCTION
SYMB-OBJECT)
Returns the symbol-function of the symbol.
generic (
SYMB-ID
SYMB-OBJECT)
– Returns a string representing the symbol uniquely.
– generic (
SYMB-NAME
SYMB-OBJECT)
Returns the symbol-name of the symbol.
generic (
SYMB-QUALIFIERS
SYMB-OBJECT)
– Returns the qualifiers of the method or NIL.
– generic (
SYMB-SCOPE
SYMB-OBJECT)
Returns whether the symbol is :INHERITED, :EXTERNAL or :INTERNAL.
generic (
SYMB-TRUE-SYMBOL
SYMB-OBJECT)
– Returns the the true symbol of the symbol.
Preferable over SYMB-SYMBOL as it takes SETF-function names into account.
– generic (
14
SYMB-TYPE
SYMB-OBJECT)
Returns the string-name of the kind of object it represents.
generic (
SYMB-TYPE-ORDER
SYMB)
– For a given symbol type name, returns an integer representing the priority of the t
– generic (
SYMB<
A B)
Used to sort symbols alphabetically.
Special treatment is done so that generic functions should
always appear before their methods.
generic (
SYSTEM-OPTIONS
SYSTEM)
– Returns options to use when stapling the given system.
15
directory of the system.
:name --- The name to use for the system.
Defaults to ASDF:COMPONENT-NAME
:out --- The pathname for the generated file.
Defaults to "about.html" relative to the source
directory of the system.
:packages --- The list of packages to output to the symbol index
in the generated file.
Defaults to SYSTEM-PACKAGES
:template --- The Clip template file to use to generate the
documentation file with.
Defaults to *DEFAULT-TEMPLATE*
:if-exists --- What to do if the generated file already exists on
the file system.
Defaults to :ERROR
The methods are combined by APPEND, with the most specific method coming
first. This means that you can override certain options by creating a
method for your system and outputting a plist with the option you want
to override.
You may specify additional arguments that are not shown above. They will
all be passed to Clip’s template generation, and may thus be accessed
from within the template.
See GENERATE
See FIND-DOCUMENTATION-FILE
See FIND-LOGO-FILE
See ASDF:COMPONENT-NAME
See ASDF:SYSTEM-SOURCE-DIRECTORY
See SYSTEM-PACKAGES
See *DEFAULT-TEMPLATE*
See CL:OPEN
– macro (
16
DEFINE-CONVERTER
NAME ARGS &BODY BODY)
Shorthand to easily define a converter function.
See CONVERTER
macro (
DEFINE-SIMPLE-CONVERTER
OBJECT-CLASS TEST)
– Shorthand for the most common definitions.
If TEST function passes, a single symbol object constructed from OBJECT-CLASS
is returned as a list.
17