An interactive documentation viewer using Staple
Table of Contents
About Staple-Server
This is a live browser variant of Staple, giving you an immediate way of viewing documentation for all currently loaded systems.
How To
Load staple-server
and start it up:
(staple-server:start)
It should print the address of the server to your REPL. Simply paste it into your browser and you should be greeted with a systems index. The documentation for each system is generated on demand, so the first time you click on a system, it might take a bit to load it.
When you're done and want to stop the server, you can simply run
(staple-server:stop)
The server keeps a cache of generated documentation in the system's temporary directory, so the cache will be automatically deleted once you reboot. If you would like to delete the cache immediately, you can run clear-cache
.
Assumptions About Generated Documentation
The server makes some assumptions about how the documentation of a system is generated. If the system does not customise staple, this is no problem. However, for systems that might customise it a lot, these assumptions might matter. The assumptions are as follows:
- The documentation output is HTML files.
- The links within the HTML are either relative or
file://
URLs. - All files generated by the documentation are within the
:output-directory
. - There is an
index.html
file directly within the:output-directory
that shows the entry page for the system's documentation.
System Information
Definition Index
-
STAPLE-SERVER
- ORG.SHIRAKUMO.STAPLE.SERVER
No documentation provided.-
EXTERNAL SPECIAL-VARIABLE *TMPDIR*
Pathname to the temporary file directory the server uses to store documentation output. By default a subdirectory called "staple-server" in UIOP:TEMPORARY-DIRECTORY. See SYSTEM-PATH
-
EXTERNAL FUNCTION CACHE-SYSTEM
- SYSTEM
- &OPTIONAL
- DIR
- &REST
Creates the cache for the given system. Unless otherwise specified, the output is placed in the directory returned by SYSTEM-PATH. The system is generated normally otherwise, but supplying :if-exists :supersede. After generation, each HTML file in the output directory is modified such that links to file:// urls are replaced by ones that the server can handle, and each page gets the nav.ctml contents injected at the bottom of its body. This should ensure that the documentation can be customised heavily by the owner of the projects, but still work within a server setting. See SYSTEM-PATH See STAPLE:GENERATE
-
EXTERNAL FUNCTION CLEAR-CACHE
- &OPTIONAL
- SYSTEM
- &REST
Clears the cache by deleting all files in *TMPDIR* See *TMPDIR*
-
EXTERNAL FUNCTION START
- &KEY
- PORT
- &REST
Starts the Staple server. If *ACCEPTOR* is already set, an error is signalled. Otherwise, a new ACCEPTOR instance is created and started. See *ACCEPTOR* See ACCEPTOR
-
EXTERNAL FUNCTION STOP
Stops the Staple server. If *ACCEPTOR* is not set, an error is signalled. Otherwise the server is stopped and unbound. See *ACCEPTOR*