Commits

Anonymous committed 208c075

Sort symbols in documentation

  • Participants
  • Parent commits aefe3e1

Comments (0)

Files changed (2)

doctaglibraries/docs.lisp

        (not (is-function-p symbol))
        (not (is-variable-p symbol))))
 
+(defun sorted-package-symbols (package-designator predicate)
+  (sort (loop for sym being the external-symbols of package-designator
+	   when (funcall predicate sym) 
+	   collect sym)
+	#'(lambda (left right)
+	  (string-lessp (symbol-name left) (symbol-name right)))))
+
 (defhtmltag package-reference
     :content (em "hh-web-tags"))
 
     :noendtag t)
 
 (defhtmltag macro-docs
-    :content (loop for sym being the external-symbols of :hh-web-tags
-		  when (is-macro-p sym)
-		  collect (list (p (package-symbol {:sym sym :type "macro" }))
-				(p (documentation sym 'function)))))
+    :content (loop for sym in (sorted-package-symbols :hh-web-tags #'is-macro-p)
+		collect (list (p (package-symbol {:sym sym :type "macro" }))
+			      (p (documentation sym 'function)))))
 
 (defhtmltag function-docs
-    :content (loop for sym being the external-symbols of :hh-web-tags
-		when (is-function-p sym) 
+    :content (loop for sym in (sorted-package-symbols :hh-web-tags #'is-function-p)
 		collect (list (p (package-symbol {:sym sym :type "function" }))
 			      (p (documentation sym 'function)))))
 
 (defhtmltag variable-docs
-    :content (loop for sym being the external-symbols of :hh-web-tags
-		when (is-variable-p sym) 
+    :content (loop for sym  in (sorted-package-symbols :hh-web-tags #'is-variable-p)
 		collect (list (p (package-symbol { :sym sym :type "variable"} ))
 			      (p (documentation sym 'variable)))))
 
 (defhtmltag other-docs
-    :content (loop for sym being the external-symbols of :hh-web-tags
-		when (is-other-symbol-p sym) 
+    :content (loop for sym in (sorted-package-symbols :hh-web-tags #'is-other-symbol-p)
 		collect (list (p (let* ((name (string-downcase (symbol-name sym))))
 				   (strong {:style "font-family:monospace" } name))))))

doctemplates/doc_index.lisp

  (p "Countless libraries exist to generate HTML, and so does $(package-reference). But the latter generates not only HTML but CSS, 
      Javascript, and even some page metadata. And it generates it all in a modular fashion.")
  (p "A fundamental insight differentiates $(package-reference) from other such libraries: in Lisp terms, most libraries regard
-    HTML generation as a function with a single return value (the HTML).  Instead, hh-web-tags regards content generation
+    HTML generation as a function with a single return value (the HTML).  Instead, $(package-reference) content generation
     as a function returning multiple values $+mdash+ a not unusual situation in Lisp, but uncommon (or unnatural) in
     other languages.")
  (p "Specifically, the central HTML generation facility of $(package-reference) (the $(html:a { :href \"#_macro_html\"} \"html\") macro) returns many values, of which the first is the HTML but also several