Commits

Anonymous committed f4ba384

Added same thing for tag libraries; that is, the ability to customize the directory in a package containing tag libraries.

  • Participants
  • Parent commits 35516cf

Comments (0)

Files changed (5)

File doctemplates/doc_index.lisp

 
 (page 
  (+title "Documentation for hh-web-tags")
- (p "Documentation forthcoming"))
+ (h1 "Overview")
+ (p "Countless libraries exist to generate HTML.  What differentiates hh-web-tags from other generation libraries
+    is it's ability to generate not just HTML, but also CSS, Javascript, and other elements of a web-page all while
+    providing a modular framework for content."))

File documentation.lisp

 (deftemplates :tag-library-packages ( "hh-web-tags" )
   :template-packages ( "hh-web-tags")
   :templates ((doc-index "doc_index.lisp"))
-  :folder "doctemplates")
+  :template-folder "doctemplates"
+  :tag-library-folder "doctaglibraries")
 
 (defun generate-package-documentation ()
   (flet ((report (&rest args)

File package-hh-web-tags.lisp

   #:*tag-library*
   #:*tag-library-provider-registry*
   #:*package-template-folder*
+  #:*package-tag-library-folder*
   #:*template*
   #:*minimum-template-stale-time*
   #:create-folder-tag-library-provider

File taglibraries.lisp

   "Minimum time in seconds for which a tag library must remain stale (e.g. not expire)
    before reloading from its source")
 
+(defvar *package-tag-library-folder* "taglibraries"
+  "Default folder within a package that contains the package's tag libraries")
+
 ;;;------------------------------------------------------------------------------------
 ;;; Conditions
 ;;;------------------------------------------------------------------------------------
 (defun create-folder-tag-library-provider (folder)
   (make-instance 'folder-tag-library-provider :folder folder))
 
-(defun create-asdf-system-tag-library-provider (system)
+(defun create-asdf-system-tag-library-provider (system &key ((:folder *package)))
   (make-instance 'folder-tag-library-provider 
 		 :folder (asdf:system-relative-pathname 
 					(asdf:find-system system) 
-					(make-pathname :directory `(:relative "taglibraries")))))
+					(make-pathname :directory `(:relative ,*package-tag-library-folder*)))))
 
 
 ; -- Implementation of base tag-library-provider functions

File templates.lisp

 			((:tag-library-packages tag-library-packages) nil)
 			((:template-packages template-packages) nil)
 			((:templates templates) nil)
-			((:folder default-folder) '*package-template-folder*))
+			((:template-folder default-template-folder) '*package-template-folder*)
+			((:tag-library-folder default-tag-library-folder) '*package-tag-library-folder*))
   (let ((template-provider-registry (local-template-provider-registry-symbol) )
 	(tag-library-provider-registry (local-tag-library-provider-registry-symbol) ))
     `(progn
        (defparameter ,template-provider-registry
 	 (list ,@(append (mapcar (lambda (template-package-spec)
-				   (destructuring-bind (template-package template-directory)
+				   (destructuring-bind (template-package template-folder)
 					   (if (listp template-package-spec)
 					       template-package-spec
-					       (list template-package-spec default-folder))
-					 `(create-asdf-system-template-provider (quote ,template-package) :folder ,template-directory)))
+					       (list template-package-spec default-template-folder))
+					 `(create-asdf-system-template-provider (quote ,template-package) :folder ,template-folder)))
 				 template-packages)
 			 ;; always here by default
 			 (list `(create-asdf-system-template-provider 'hh-web-tags)))))
 
        (defparameter ,tag-library-provider-registry
-	 (list ,@(append (mapcar (lambda (tag-library-package)
-				   `(create-asdf-system-tag-library-provider (quote ,tag-library-package)))
+	 (list ,@(append (mapcar (lambda (tag-library-package-spec)
+				   (destructuring-bind (tag-library-package tag-library-folder)
+				       (if (listp tag-library-package-spec)
+					   tag-library-package-spec
+					   (list tag-library-package-spec default-tag-library-folder))
+				     `(create-asdf-system-tag-library-provider (quote ,tag-library-package) :folder ,tag-library-folder)))
 				 tag-library-packages)
 			 ;; always here by default
 			 (list `(create-asdf-system-tag-library-provider 'hh-web-tags )))))