From 2a78ab1eb05c5aa7203df769a7a696c2ce987bb7 Mon Sep 17 00:00:00 2001 From: Thel Seraphim Date: Fri, 13 Mar 2015 23:41:38 -0700 Subject: [PATCH] light refactoring, putting pieces in order --- src/pronouns/pages.clj | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 66f65a9..f380542 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -31,15 +31,15 @@ [subject reflexive] (render-sentence (wrap-pronoun (s/capitalize subject)) " threw the frisbee 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!"]]]) - +(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"} @@ -51,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