darcs get http://common-lisp.net/project/editor-hints/darcs/hyperdoc/
URL to that symbol's documentation.
-- although we'll try to avoid them, such changes may -- this means that the LOOKUP on key press. Notice that it may return multiple URLs, LOOKUP with the current buffer -- except if the symbol is explicitly qualified.
ASDF system should depend on Hyperdoc weakly by means of the :WEAKLY-DEPENDS-ON option DEFSYSTEM. A weak dependency will only be loaded if the depended system is actually REGISTER-DOCUMENTATION (reader-conditionalized on the :HYPERDOC
#+hyperdoc (hyperdoc:register-documentation :foo ...)
REGISTER-DOCUMENTATION, you have to specify the base (or root) URL that all URL.
(defvar *ediware*
'(:capi-overview
:chunga
:cl-dongle
:cl-fad
;; ...
))
(dolist (package *ediware*)
(register-documentation package
:base-uri (format nil "http://weitz.de/~(~A~)/" package)
:relative-uri-function (formatter "#~(~A~)")))
Notice how first an output string stream, then the symbol being looked up, and then the -- as you can see, this makes FORMATTER in trivial cases.
REGISTER-DOCUMENTATION provides additional means to customize the lookup process. The next two :FUNCTION and :GENERIC-FUNCTION even though your documentation tool may *DOCUMENTATION-TYPES*)
(register-documentation :foo
:base-uri "http://foo.com/"
:relative-uri-function
#'(lambda (stream symbol type)
(format stream "#~(~A~):~(~A~)"
(case type
((:function :generic-function) :function)
;; ...
)
symbol)))
As that case may be quite common, you can actually write
(register-documentation :foo
:base-uri "http://foo.com/"
:relative-uri-function (formatter "#~(~*~A~):~(~@*~A~)")
:normalize-types-function
#'(lambda (type)
(case type
((:function :generic-function) :function)
;; ...
)))
Of course, the elegance of the FORMAT noise is in the eye of the beholder.
NIL for a type, the relative-uri-function LOOKUP function determines all valid documentation types for the passed symbol before it *DOCUMENTATION-TYPES*)
ASSEM which includes symbols that denote
(register-documentation :assem
:base-uri "http://asmreference.invalid/"
:relative-uri-function (formatter "instructions.php&op=~A")
:extra-types-function
#'(lambda (symbol) (and (member symbol *ops*) '(:instruction)))
:normalize-types-function
#'(lambda (type) (and (eq type :instruction) :instruction))) ; filter
If the instruction symbols are not exported from ASSEM, you'd have to add an :ALL-SYMBOLS T.
[Special variable]
*documentation-types*
Initial Value:
(:SYMBOL-MACRO :MACRO :CONDITION :METHOD :GENERIC-FUNCTION :CLASS :TYPE
:FUNCTION :COMPILER-MACRO :SETF :METHOD-COMBINATION :TYPE :STRUCTURE :PACKAGE
:VARIABLE :CONSTANT)
Documentation types used by Hyperdoc. These correspond to whatuses with a fewDOCUMENTATION
additions.
[Function]
lookup package-designator symbol-name &optional doc-types => result
Argument and Values:
package-designator: (OR
PACKAGE
SYMBOL
(VECTOR
CHARACTER)
(VECTOR
NIL)
BASE-STRING)
symbol-name: STRING
doc-types: (OR
SYMBOL
CONS)
result: LIST Description:
Looks up documentation for symbol named by symbol-name in the package designated by
package-designator, or any package in itsPACKAGE-USE-LIST.
doc-types may either be a symbol, or a list of symbols. If doc-types are given, the
lookup is restricted to documentation of the entities associated with the given doc-types.
doc-types default to*DOCUMENTATION-TYPES*.
returns a list of applicableLOOKUP(DOC-TYPE.URI-STRING)pairs.
If the designated package does not exist, or if no the designated symbol does not exist, or if no
documentation for the designated symbol is found,NILis returned.
[Function]
register-documentation packages &rest keys &key base-uri relative-uri-function extra-types-function normalize-types-function all-symbols &allow-other-keys => result
Argument and Values:
packages: (OR
SYMBOL
PACKAGE
CONS)
keys: T
base-uri: STRING
relative-uri-function: (OR
(AND
(NOT
NULL)
SYMBOL)
FUNCTION)
extra-types-function: (OR
SYMBOL
FUNCTION)
normalize-types-function: (OR
SYMBOL
FUNCTION)
all-symbols: BOOLEAN
result: (MEMBER
T) Description:
packages ::= package-designator | (package-designators+)
keys ::= { :BASE-URI string
:RELATIVE-URI-FUNCTION function-designator
[ :EXTRA-TYPES-FUNCTION function-designator ]
[ :NORMALIZE-TYPES-FUNCTION function-designator ]
[ :ALL-SYMBOLS boolean ] }+
This documentation was generated on 2009-12-3 from a Lisp image using some home-brewn,
duct-taped,
evolutionary hacked extension of Edi Weitz'
DOCUMENTATION-TEMPLATE.