about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThel Seraphim <thel.seraphim@gmail.com>2015-03-13 19:34:43 -0700
committerThel Seraphim <thel.seraphim@gmail.com>2015-03-13 19:34:43 -0700
commitec62e36ee31ffd6a0ee2370451448b8967f4d10a (patch)
tree1763d61a4840d954f9b1fec8dc94f1a7fac8293e
parent04402da472a3dd7698453a1561e332682c0b5c7e (diff)
include hiccup library and small functioning example, don't merge until it looks nice.
-rw-r--r--README.md4
-rw-r--r--project.clj1
-rwxr-xr-xquickstart.sh3
-rw-r--r--src/pronouns/pages.clj9
4 files changed, 13 insertions, 4 deletions
diff --git a/README.md b/README.md
index c13301a..38f9fbd 100644
--- a/README.md
+++ b/README.md
@@ -42,8 +42,8 @@ $ java -cp target/pronouns-standalone.jar clojure.main -m pronouns.web
 
 Then browse to localhost:5000
 
-You can also just run quickstart.sh which will do all of these things for you. Do it like this
+You can also just run quickstart.sh which will do all of these things for you. Do it like this to get an example running on port 666
 
 ```
-$ ./quickstart.sh
+$ ./quickstart.sh 666
 ```
diff --git a/project.clj b/project.clj
index ea671fd..961c733 100644
--- a/project.clj
+++ b/project.clj
@@ -10,6 +10,7 @@
                  [ring/ring-devel "1.2.2"]
                  [ring-basic-authentication "1.0.5"]
                  [environ "0.5.0"]
+                 [hiccup "1.0.5"]
                  [com.cemerick/drawbridge "0.0.6"]]
   :min-lein-version "2.0.0"
   :plugins [[environ/environ.lein "0.2.1"]]
diff --git a/quickstart.sh b/quickstart.sh
index 9525b0c..ce6d3b4 100755
--- a/quickstart.sh
+++ b/quickstart.sh
@@ -1,5 +1,6 @@
 #!/bin/sh
 
+export port=$1
 lein uberjar
 java -cp target/pronouns-standalone.jar clojure.main -m pronouns.web
-open http://localhost:5000/ze/zir
+open http://localhost:"$port"/ze/zir
diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj
index f1f8b67..16c92b4 100644
--- a/src/pronouns/pages.clj
+++ b/src/pronouns/pages.clj
@@ -1,16 +1,23 @@
 (ns pronouns.pages
   (:require [clojure.string :as s]
-            [pronouns.util :as u]))
+            [pronouns.util :as u]
+            [hiccup.core :refer :all]))
+
+(defn subject-example
+  [subject]
+  [:span#blah [:b subject] " went to the park."])
 
 (defn format-pronoun-examples
   [subject object possessive-determiner possessive-pronoun reflexive]
   (s/join "\n"
           [(str subject " went to the park")
+           (html (subject-example subject))
            (str "I went with " object)
            (str subject " brought " possessive-determiner " frisbee")
            (str "at least I think it was " possessive-pronoun)
            (str subject " threw it to " reflexive)]))
 
+
 (defn parse-pronouns-with-lookup [pronouns-string pronouns-table]
   (let [inputs (s/split pronouns-string #"/")
         n (count inputs)]