diff options
-rw-r--r-- | src/pronouns/pages.clj | 54 |
1 files changed, 22 insertions, 32 deletions
diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index f9e6073..b3ad43a 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -7,44 +7,39 @@ [pronoun] [:b pronoun]) -(defn wrap-para - [whatever] - [:p whatever]) +(defn render-sentence [& content] + [:p [:span.sentence content]] +) (defn subject-example [subject] - (wrap-para - [:span#sentence (wrap-pronoun subject) " went to the park."])) + (render-sentence (wrap-pronoun (s/capitalize subject)) " went to the park.")) (defn object-example [object] - (wrap-para - [:span#sentence "I went with " (wrap-pronoun object) "."])) + (render-sentence "I went with " (wrap-pronoun object) ".")) (defn posessive-determiner-example [subject possessive-determiner] - (wrap-para - [:span#sentence (wrap-pronoun subject) " brought " (wrap-pronoun possessive-determiner) " frisbee."])) + (render-sentence (wrap-pronoun (s/capitalize subject)) " brought " (wrap-pronoun possessive-determiner) " frisbee.")) (defn possessive-pronoun-example [possessive-pronoun] - (wrap-para - [:span#sentence "At least I think it was " (wrap-pronoun possessive-pronoun) "."])) + (render-sentence "At least I think it was " (wrap-pronoun possessive-pronoun) ".")) (defn reflexive-example [subject reflexive] - (wrap-para - [:span#sentence (wrap-pronoun subject) " threw it to " (wrap-pronoun reflexive)])) - - -(defn twitter-name [name] - [:a {:href (str "https://www.twitter.com/" name)} (str "@" name)]) - -(defn contact-block [] - [:div {:class "contact"} - [:p "Written by " (twitter-name "morganastra") " and " (twitter-name "thelseraphim") ". " - "Visit the project on " [:a {:href "https://github.com/witch-house/pronoun.is"} "github!"]]]) + (render-sentence (wrap-pronoun (s/capitalize subject)) " threw the frisbee to " (wrap-pronoun reflexive) ".")) +(defn examples-block + [subject object possessive-determiner possessive-pronoun reflexive] + [:div {:class "examples"} + [:p [:h1 "Here are some usage examples for my pronouns:"]] + (subject-example subject) + (object-example object) + (posessive-determiner-example subject possessive-determiner) + (possessive-pronoun-example possessive-pronoun) + (reflexive-example subject reflexive)]) (defn about-block [] [:div {:class "about"} @@ -56,18 +51,13 @@ [:p "My name is Thel Seraphim, my " [:a {:href "http://pronoun.is/she"} "pronoun.is/she"] "."] [:p "My name is Morgan, my " [:a {:href "http://pronoun.is/ze/zir"} "pronoun.is/ze/zir"] "."]]) +(defn contact-block [] + (let [twitter-name (fn [handle] [:a {:href (str "https://www.twitter.com/" handle)} (str "@" handle)])] + [:div {:class "contact"} + [:p "Written by " (twitter-name "morganastra") " and " (twitter-name "thelseraphim") ". " + "Visit the project on " [:a {:href "https://github.com/witch-house/pronoun.is"} "github!"]]])) -(defn examples-block - [subject object possessive-determiner possessive-pronoun reflexive] - [:div {:class "examples"} - [:p [:h1 "Here are some usage examples for my pronouns:"]] - (subject-example subject) - (object-example object) - (posessive-determiner-example subject possessive-determiner) - (possessive-pronoun-example possessive-pronoun) - (reflexive-example subject reflexive)]) - (defn format-pronoun-examples [subject object possessive-determiner possessive-pronoun reflexive] (html |