Commit e074a50d authored by ioa's avatar ioa

Added graphing from a selection of forms

parent 483f28e3
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
(defun local (rel-path) (defun local (rel-path)
(concatenate 'string *local-directory* rel-path)) (concatenate 'string *local-directory* rel-path))
(setq hunchentoot:*dispatch-table* (load-nodes-html)
(setq hunchentoot:*dispatch-table* ; dispatches folders, files, and pages
(list (hunchentoot:create-static-file-dispatcher-and-handler (list (hunchentoot:create-static-file-dispatcher-and-handler
"/logo.jpg" (local "www/logo.jpg")) "/logo.jpg" (local "www/logo.jpg"))
(hunchentoot:create-folder-dispatcher-and-handler (hunchentoot:create-folder-dispatcher-and-handler
...@@ -25,8 +27,16 @@ ...@@ -25,8 +27,16 @@
"/diagram" 'diagram) "/diagram" 'diagram)
(hunchentoot:create-prefix-dispatcher (hunchentoot:create-prefix-dispatcher
"/random-diagram" 'random-diagram) "/random-diagram" 'random-diagram)
(hunchentoot:create-prefix-dispatcher
"/selection-diagram" 'selection-diagram)
(hunchentoot:create-prefix-dispatcher (hunchentoot:create-prefix-dispatcher
"/examples" 'examples) "/examples" 'examples)
(hunchentoot:create-folder-dispatcher-and-handler
"/math-snippets/" (local "math-snippets/"))
(hunchentoot:create-prefix-dispatcher
"/names-and-statements" 'names-and-statements)
(hunchentoot:create-prefix-dispatcher
"/selected-diagram" 'selected-diagram)
(hunchentoot:create-prefix-dispatcher (hunchentoot:create-prefix-dispatcher
"/" 'generate-index-page))) "/" 'generate-index-page)))
...@@ -40,7 +50,7 @@ ...@@ -40,7 +50,7 @@
;; but the below does transmit the website fine at ;; but the below does transmit the website fine at
;; http://127.0.0.1:8080/ ;; http://127.0.0.1:8080/
(defun start-website?? (&key (port "8080")) (defun start-website?? (&key (port 8080))
(setq *server* (hunchentoot:start (setq *server* (hunchentoot:start
(make-instance 'easy-acceptor (make-instance 'easy-acceptor
:port port)))) :port port))))
...@@ -71,6 +81,14 @@ ...@@ -71,6 +81,14 @@
#P"examples.tmpl" '() #P"examples.tmpl" '()
:stream stream))) :stream stream)))
;; ## names-and-statements page
(defun names-and-statements ()
(with-output-to-string (stream)
(html-template:fill-and-print-template
#P"forms-statements.tmpl" '()
:stream stream)))
;; ## Diagrams pages ;; ## Diagrams pages
;; ### Encoding filenames ;; ### Encoding filenames
...@@ -126,7 +144,7 @@ ...@@ -126,7 +144,7 @@
:direction :output :direction :output
:if-exists :error :if-exists :error
:if-does-not-exist :create) :if-does-not-exist :create)
(declare (ignore out)))) (format out "")))
(defun delete-temp (names label-style) (defun delete-temp (names label-style)
(delete-file (local (names->temp names label-style)))) (delete-file (local (names->temp names label-style))))
...@@ -180,6 +198,16 @@ ...@@ -180,6 +198,16 @@
(get-graph names "fancy") (get-graph names "fancy")
(fill-template names "fancy" nil :kind "random"))) (fill-template names "fancy" nil :kind "random")))
(defun selection-diagram ()
(let ((names (loop for name being the hash-keys of jeffrey.graph:*graph*
for string-name = (format nil "~a" name)
when (parameter string-name)
collect name)))
(web-graph names "fancy")
(get-graph names "fancy")
(fill-template names "fancy" nil :kind "standard")))
;;; debugging ;;; debugging
(defun debug-mode-on () (defun debug-mode-on ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment