Common Lisp Package: DOCBROWSER

Runs a webserver that allows the user to browse and search information about the packages in the Lisp runtime, including functions, classes and variables.

README:

Docbrowser - Web-based Common Lisp documentation browser

Author information

Elias MÃ¥rtenson

  • Email: lokedhs@gmail.com
  • Google+ profile: http://profiles.google.com/lokedhs

Source code repository location

The latest version of Docbrowser can be found at Google Code project hosting site:

http://code.google.com/p/docbrowser/

Compatibility

The application has been tested on SBCL, CCL and CLISP. Please let me know of any issues on other Common Lisp implementations.

Starting the server

After loading the package, run the following command from the REPL:

(docbrowser:start-docserver)

This will start the docserver on port 8080. A different port number can also be given as an optional argument.

To access the docbrowser, point a web browser to http://localhost:8080/

FUNCTION

Public

START-DOCSERVER (&OPTIONAL (PORT 8080))

Start the documentation server with a HTTP listener on port PORT.

Private

%ANNOTATE-FUNCTION-INFO (FN-INFO CLASSES)

Append :ACCESSORP tag if the function is present as an accessor function.

ASSOC-CDR (KEY DATA &KEY ERROR-P)

Return (CDR (ASSOC KEY DATA)). If ERROR-P is non-NIL, signal an error if KEY is not available is DATA.

HUNCHENTOOT-STREAM-AS-TEXT (&KEY (CONTENT-TYPE text/html) (APPEND-CHARSET T))

Sends the appropriate headers to ensure that all data is sent back using the correct encoding and returns a text stream that the result can be written to.

SEARCH-COMMAND-SCREEN

Handler for AJAX-calls to perform a search operation

SYMBOL-EXTERNAL-P (SYMBOL &OPTIONAL (PACKAGE (SYMBOL-PACKAGE SYMBOL)))

Return non-NIL if SYMBOL is external in PACKAGE. SYMBOL may be either a symbol, or a SETF form, in which case the check will be performed on the CADR of the list.

Undocumented

%ENSURE-EXTERNAL (SYMBOL)

%MAKE-DEFINE-HANDLER-FN-FORM (DOCSTRING NAME BODY)

%SHOW-PACKAGE-SCREEN-SHOW (OUT PACKAGE)

ASSOC-NAME (V)

ESCAPE-CHAR (CH)

FIND-MATCHING-SYMBOLS (STRING)

FIND-METHOD-INFO (SYMBOL)

FIND-SUPERCLASSES (CLASS)

FORMAT-ARGUMENT-TO-STRING (ARG)

FORMAT-SOURCE (SOURCE-DESCRIPTOR)

LOAD-ACCESSOR-INFO (CLASS SLOT)

LOAD-CLASS-INFO (CLASS-NAME)

LOAD-FUNCTION-INFO (SYMBOL)

LOAD-SLOTS (CLASS)

LOAD-SPECIALISATION-INFO (CLASS-NAME)

LOAD-VARIABLE-INFO (SYMBOL)

MAIN-SCREEN

NICE-PRINC-TO-STRING (OBJ)

PACKAGE-LIST-SCREEN

PRIN1-TO-STRING-WITH-PACKAGE (OBJ PACKAGE)

PROCESS-JSON (FN)

PROCESS-SEARCH-RESULT (SYMBOLS)

READ-FILE-CONTENT (FILE)

SAFE-CLASS-FOR-SYMBOL (SYMBOL)

SEARCH-SCREEN

SHOW-PACKAGE-SCREEN

SHOW-TEMPLATE (OUT FILE DATA)

SOURCE-FUNCTION-SCREEN

SPECIALISE->SYMBOL (SPEC)

STYLE-FROM-TYPE (TYPE)

MACRO

Private

Undocumented

DEFINE-HANDLER-FN (NAME URL &BODY BODY)

DEFINE-JSON-HANDLER-FN (NAME URL DATA-SYMBOL &BODY BODY)

WITH-HUNCHENTOOT-STREAM ((OUT &OPTIONAL (CONTENT-TYPE text/html) (APPEND-CHARSET T)) &BODY BODY)

SLOT-ACCESSOR

Private

DOCBROWSER-ACCEPTOR-FILES-DISPATCHER (OBJECT)

List of fallback dispatchers

VARIABLE

Private

*GLOBAL-ACCEPTOR*

The acceptor for the currently running server.

*MAXIMUM-SEARCH-RESULTS*

The maximum number of search results returned.

*URL-HANDLERS*

A hash table keyed on the base URL that maps to the underlying handler function

Undocumented

*COMPILE-DECL*

*FILES-BASE-DIR*

CLASS

Private

DOCBROWSER-ACCEPTOR

Acceptor for the documentation browser