File: setup.lisp

package info (click to toggle)
cl-containers 20140211-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,076 kB
  • ctags: 1,386
  • sloc: lisp: 8,330; makefile: 14
file content (164 lines) | stat: -rw-r--r-- 4,723 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
(in-package #:cl-containers-documentation)

(defmethod additional-markdown-extensions-for-system 
    append ((system (eql (asdf:find-system 'lift-documentation))))
  '(clcl))

(defsimple-extension clcl
  "*CL-Containers*")

(defextension (list-classes
	       :arguments ((root :required)
			   (filter :required :whole)))
  (ecase phase
    (:parse
     ;; could syntax check here
     )
    (:render
     (format *output-stream* "~s ~s" root filter))))

#|

(mopu:subclasses 'cl-containers::basic-generator)

(mopu:subclasses 'cl-containers::abstract-container)

(mopu:subclasses 'cl-containers::concrete-container)

(defun build-documentation-report 
    (&optional (document (or *multi-document*
			     (first *documents*))))
  (cl-markdown::build-documentation-report
   (asdf:system-relative-pathname
    'db.agraph.documentation "resources/documentation-report.md")
   (asdf:system-relative-pathname
    'db.agraph.documentation "output/documentation-report.html")
    document
    (list :db.agraph
	  :net.cluster
	  :db.agraph.parser
	  :db.agraph.serializer
	  :db.agraph.sparql) 
   :format :html 
   :excluded-symbols (symbols-explicitly-undocumented-for-agraph)
   :docs-package (find-package :db.agraph)
   :search-locations (agraph-search-locations))) 

(defun build-summary-file (doc-root)
  (cl-markdown:markdown 
   (let ((docs 
	  (sort
	   (loop for info in *documents* 
	      when (typep info 'cons) collect
	      (destructuring-bind (in out doc) info
		(list :in in :out out :doc doc 
		      :title 
		      (let ((cl-markdown:*current-document* doc))
			(cl-markdown:document-property :title)))))
	   #'string-lessp
	   :key (lambda (plist) (getf plist :title)))))
     (db.agraph:string+ 
      "{include resources/header.md}
{set-property html yes}
{set-property author \"Franz Incorporated\"}
{set-property title \"Generated Documents | AllegroGraph {property agraph-version}\"}
{set-property style-sheet styles}

<div id=\"main-content\">

# AllegroGraph Documentation 
"
      (apply #'db.agraph:string+
	     (loop for info in docs 
		for index from 1 collect
		(db.agraph:string+
		 "* [" (getf info :title) "][" index "]
")))
      "
" 
      (apply #'db.agraph:string+
	     (loop for info in docs 
		for index from 1 collect
		(db.agraph:string+  
		 " [" index "]: " 
		 (enough-namestring (getf info :out) doc-root) "
")))
      "</div>

{comment include resources/footer.md}
"
))
   :format :html
   :stream (make-pathname 
	    :name "summary" :type "html" 
	    :defaults doc-root)))

(defun agraph-search-locations ()
  (list 
   (asdf:system-relative-pathname 'db.agraph.documentation
				  "")
   (asdf:system-relative-pathname 'db.agraph.documentation
				  "resources/")))

(defun markdown-extensions-for-agraph ()
  '(cl-markdown::docs cl-markdown::docs-index
    cl-markdown::glossary cl-markdown::links-list
    cl-markdown::comment cl-markdown::ifdef
    cl-markdown::abbrev cl-markdown-user:docs-group
   
    cl-markdown::ag-eval-freetext-stop-words
    cl-markdown::ag-eval-freetext-example-phrase
    cl-markdown::ag-eval-java-agraph-cfg-file))
  
(defun cl-markdown-for-agraph (filter in out 
			       &rest args &key &allow-other-keys)
  (remf args :root)
  (push (cons :|Content-Type| "text/html; charset=UTF-8")
	(getf args :properties))
  (push (list filter t)
	(getf args :properties))
  (push (cons :search-locations 
	      (agraph-search-locations))
	(getf args :properties))
  (let* ((md (apply #'markdown:markdown 
		    in
		    :stream out
		    :format :html
		    :additional-extensions (markdown-extensions-for-agraph)
		    args)))
    (push (list in out md) *documents*)
    md))

(defun cl-markdown-many-for-agraph (filter docs &rest args)
  (remf args :root)
  (push (cons :|Content-Type| "text/html; charset=UTF-8")
	(getf args :properties))
  (push (list filter t) (getf args :properties))
  (push (cons :search-locations 
	      (agraph-search-locations))
	(getf args :properties))
  (let ((*package* (find-package :cl-markdown)))
    (multiple-value-bind (main outputs)
	(apply #'markdown:markdown-many
	       docs
	       :format :html
	       :additional-extensions (markdown-extensions-for-agraph)
	       args)
      (loop for (in nil) in docs
	  for (md dest) in outputs do (push (list in dest md) *documents*))
      main)))

(cl-markdown:add-documentation-strategy 
 'thing-names-property-p 'property 'property)

(defun thing-names-property-p (thing)
  (and (symbolp thing)
       (db.agraph::ag-property-definition thing)))

(defmethod cl-markdown:find-documentation (thing (strategy (eql :property)))
   (db.agraph::property-documentation 
    (db.agraph::ag-property-definition 
     (intern (symbol-name thing) :db.agraph))))


|#