summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-05-17 22:07:37 +0200
committerGravatar Tom Willemse2013-05-17 22:07:37 +0200
commit170f7e9c2ee3c31a525da18c5ab9dacaefe5557b (patch)
treebd903a1b304b32ffd41231be697ad3a2de53b765
parent03f74924f169803e0304fdea3314905808333c5d (diff)
downloadeliss-170f7e9c2ee3c31a525da18c5ab9dacaefe5557b.tar.gz
eliss-170f7e9c2ee3c31a525da18c5ab9dacaefe5557b.zip
Add some docstrings
-rw-r--r--eliss.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/eliss.el b/eliss.el
index 2338631..cdc039e 100644
--- a/eliss.el
+++ b/eliss.el
@@ -15,10 +15,15 @@
(defvar eliss-data-directory "~/projects/eliss/projects")
(defun project-row (project)
+ "Print a table row for PROJECT."
(let ((pname (substring project 0 -4)))
`(tr (td (a (@ (href ,(concat "/" pname "/"))) ,pname)))))
(defun eliss-page (title &rest body)
+ "Create a page with some default necessities.
+
+Set the page's title and brand to TITLE and add BODY in the
+container div."
(concat
"<!DOCTYPE html>"
(sxml-to-xml
@@ -34,6 +39,7 @@
,@body))))))
(defun eliss-project-list (httpcon)
+ "Send a list of known projects over HTTPCON."
(elnode-http-start httpcon 200 '("Content-Type" . "text/html"))
(elnode-http-return
httpcon
@@ -45,6 +51,11 @@
"\\.org$"))))))
(defun eliss-control-group (name label &optional placeholder default)
+ "Return an often-used common HTML structure.
+
+Set the name and id attributes of the input to NAME, give it the
+label LABEL, optionally add a placeholder PLACEHOLDER and
+optionally a value DEFAULT."
`(div (@ (class "control-group"))
(label (@ (class "control-label")
(for ,name)) ,label)
@@ -60,6 +71,7 @@
nil))))))
(defun eliss-project-page (httpcon)
+ "Send a list of issues and an issue-creation form over HTTPCON."
(let* ((project (match-string 1 (elnode-http-mapping httpcon)))
(filename (concat eliss-data-directory "/" project ".org"))
(buffer (find-file-noselect filename)))
@@ -109,6 +121,7 @@
(rows "15")) "")))))))))
(defun eliss-issue-page (httpcon)
+ "Send an issue-detail page over HTTPCON."
(let* ((project (match-string 1 (elnode-http-mapping httpcon)))
(issue (match-string 2 (elnode-http-mapping httpcon)))
(filename (concat eliss-data-directory "/" project ".org"))
@@ -174,6 +187,7 @@
(rows "15")) ""))))))))))
(defun eliss-new-issue (httpcon)
+ "Parse data from HTTPCON and write a new issue using it."
(elnode-method httpcon
(POST
(let* ((project (match-string 1 (elnode-http-mapping httpcon)))
@@ -202,6 +216,7 @@
(elnode-send-redirect httpcon (concat "/" project "/"))))))
(defun eliss-new-comment (httpcon)
+ "Parse data from HTTPCON and write a new issue comment using it."
(elnode-method httpcon
(POST
(let* ((project (match-string 1 (elnode-http-mapping httpcon)))
@@ -229,6 +244,7 @@
(elnode-send-redirect httpcon (concat "/" project "/" issue "/"))))))
(defun eliss-handler (httpcon)
+ "Send the right requests in HTTPCON to the right functions."
(elnode-dispatcher
httpcon
'(("^/$" . eliss-project-list)