include hiccup library and small functioning example, don't merge until it looks nice.

This commit is contained in:
Thel Seraphim 2015-03-13 19:34:43 -07:00
parent 04402da472
commit ec62e36ee3
4 changed files with 13 additions and 4 deletions

View File

@ -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
```

View File

@ -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"]]

View File

@ -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

View File

@ -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)]