+CLOD is a tool for creating documentation for Common Lisp programs."))
-(defvar *heading-level* 0)
-(defvar *heading-char* #\*)
-(defvar *line-width* 80)
-(defvar *left-margin* 0)
-(deftype =entity= () `(member :slot :generic-function :function :macro
- :constant :variable :class
- :slot-accessor :slot-writer :slot-reader))
+Global variable that is bound to the output stream used by CLOD
+when writing documentation.")
+(defvar *heading-level* 0
+Number of levels 'deep' within the outline.")
+(defvar *heading-char* #\*
+Character used at the beginning of lines to signify headings and
+Width to which paragraphs are wrapped.")
+Number of spaces to which text is currently being indented.")
+ `(member :slot :generic-function :function :macro
+ :constant :variable :class
+ :slot-accessor :slot-writer :slot-reader))
-(defgeneric document (sym doctype))
+(defgeneric document (sym doctype)
+- DOCTYPE: an [[=ENTITY=]].
+Write a section documenting the entity named SYM which is of entity type
;; todo still unclear how to tell if a symbol is bound to a type.
;; eg (deftype =foo= () `(integer 0 10))
(defun entity->tag (entity)
+- ENTITY: An [[=ENTITY=]].
+Given an entity, returns a string that can be used as a tag in org mode."
- (collect (list term (make-link (class-name spec) :linktype :class)))
+ (collect (list term (make-link (if (typep spec 'class)
+ (class-name (class-of spec)))
(defun write-heading (title)
- (format *out* "~
+ (format *out* "~~A ~A~%~%"
(make-string *heading-level* :initial-element *heading-char*)