40ants / doc

Flexible documentation generator for Common Lisp projects.
https://40ants.com/doc/
Other
17 stars 6 forks source link

Updated transform-locative-symbols to process entries with multiple s… #7

Closed rainthree closed 2 years ago

rainthree commented 2 years ago

Updated transform-locative-symbols to process entries with multiple symbols.

Updated the docstring of defsection to also show the multipe symbols form: '(symbol locative) or ((symbol1 symbol2 ... symboln) locative)'

Added symbol-macro locative.

Example usage:


;;; on sbcl it is needed to define the specialized method first:
(defmethod documentation ((symbol symbol) (kind (eql :symbol-macro))) (getf symbol 'symbol-macro-documentation))
(defmethod (setf documentation) (new-doc (symbol symbol) (kind (eql :symbol-macro))) (setf (getf symbol 'symbol-macro-documentation) new-doc))
(defmethod documentation ((symbol symbol) (kind (eql :symbol-macro))) (get symbol 'symbol-macro-documentation))
(defmethod (setf documentation) (new-doc (symbol symbol) (kind (eql :symbol-macro))) (setf (get symbol 'symbol-macro-documentation) new-doc))
;;; (setf (documentation 'foo :symbol-macro) "bla bla")
;;; (documentation 'foo :symbol-macro) #| --> "bla bla" |#
;;; <pjb> of course, you have to choose where to store that documentation.  Also, when and how to store it and retrieve it from a fasl file.

;;; example begins
(defsection @doc (:title "my documentation")
  ((f1 f2) function)
  (*this-pathname* symbol-macro))

(defun f1 ()
  "Returns 1."
  1)

(defun f2 ()
  "Returns 2."
  2)

(define-symbol-macro *this-pathname*
    (or *compile-file-pathname* *load-pathname*
    (error "COMPILE-FILE or LOAD this file.")))

(setf (documentation '*this-pathname* :symbol-macro)
      "expands to code that returns the name of the current sourcefile that is being loaded or compiled. Usually used with #. (sharp-dot)")```
svetlyak40wt commented 2 years ago

I need to figure out, why CI pipeline was broken.

svetlyak40wt commented 2 years ago

I've fixed tests in the "master" branch. Could you please rebase or merge it into your branch?

svetlyak40wt commented 2 years ago

Also, not CI pipeline will check if documentation is able to build without any warnings.

svetlyak40wt commented 2 years ago

Merged. Thank you!