From 6624f5f69b688741f31a8e8e5d0579853db6071a Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Sat, 4 Nov 2017 16:05:47 -0700 Subject: A woman is not dead while her name is still spoken. --- src/pronouns/web.clj | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pronouns') diff --git a/src/pronouns/web.clj b/src/pronouns/web.clj index e57d7ec..bbbce82 100644 --- a/src/pronouns/web.clj +++ b/src/pronouns/web.clj @@ -47,6 +47,11 @@ (ANY "*" [] (route/not-found (slurp (io/resource "404.html"))))) +(defn wrap-gnu-natalie-nguyen [handler] + (fn [req] + (when-let [resp (handler req)] + (assoc-in resp [:headers "X-Clacks-Overhead"] "GNU Natalie Nguyen")))) + (defn wrap-error-page [handler] (fn [req] (try (handler req) @@ -60,6 +65,7 @@ (-> app-routes logger/wrap-with-logger wrap-error-page + wrap-gnu-natalie-nguyen trace/wrap-stacktrace params/wrap-params)) -- cgit From 61b41e10f9e7205b078b0c8f41eca41e533c8a03 Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Sat, 4 Nov 2017 16:11:30 -0700 Subject: remove defunct patreon link --- src/pronouns/pages.clj | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/pronouns') diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index a9301e3..ea3d6b3 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -102,10 +102,6 @@ (twitter-name "morganastra") ", whose " (href "http://pronoun.is/ze/zir?or=she" "pronoun.is/ze/zir?or=she")] - [:p "Want to support this and similar websites? " - "Join us on " - (href "https://www.patreon.com/user?u=5238484" "Patreon") - "!"] [:p "pronoun.is is free software under the " (href "https://www.gnu.org/licenses/agpl.html" "AGPLv3") "! visit the project on " -- cgit From 864746273d868f7477e1f84898e989bff905737b Mon Sep 17 00:00:00 2001 From: Mat Schaffer Date: Sat, 11 Aug 2018 22:18:15 +0900 Subject: Fix spacing on not-found message Not familiar with hiccup, but I see similar spacing on https://github.com/witch-house/pronoun.is/blob/master/src/pronouns/pages.clj#L78 so figured I'd roll with it. --- src/pronouns/pages.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pronouns') diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index ea3d6b3..62007bc 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -167,7 +167,7 @@ [:body (header-block title) [:div {:class "section examples"} - [:p [:h2 (str "We couldn't find those pronouns in our database." + [:p [:h2 (str "We couldn't find those pronouns in our database. " "If you think we should have them, please reach out!")]]] (footer-block)]]))) -- cgit From 05a2d8fcff181a09ca7f79ad7590dab24575ab0d Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 12:48:47 -0800 Subject: Fix docstrings --- src/pronouns/util.clj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/pronouns') diff --git a/src/pronouns/util.clj b/src/pronouns/util.clj index 3db3c35..01571b6 100644 --- a/src/pronouns/util.clj +++ b/src/pronouns/util.clj @@ -19,8 +19,9 @@ (defn print-and-return "for debugging" [x] (println x) x) -(defn slurp-tabfile [path] - "read a tabfile from a filesystem as a table" +(defn slurp-tabfile + "Read a tabfile from a filesystem as a table" + [path] (let [lines (s/split (slurp path) #"\n")] (map #(s/split % #"\t") lines))) @@ -98,10 +99,11 @@ [table] (map (partial shortest-unambiguous-path table) table)) -(defn vec-coerce [x] +(defn vec-coerce "wrap a value in a vector if it is not already in one. note that if is already in a sequence for which vector? is false, this will add another layer of nesting." + [x] (if (vector? x) x [x])) (defn strip-markup [form] -- cgit From 4321ec5e39bdb817fbcc61cc40a42b5a23a0a1ce Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 12:49:17 -0800 Subject: Update deps to modern versions and remove midje --- project.clj | 14 ++++++-------- src/pronouns/web.clj | 6 +++--- test/pronouns/pages_test.clj | 16 +++++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/pronouns') diff --git a/project.clj b/project.clj index b14ac4e..bcb1454 100644 --- a/project.clj +++ b/project.clj @@ -2,18 +2,16 @@ :description "Pronoun.is is a website for personal pronoun usage examples" :url "http://pronoun.is" :license "GNU Affero General Public License 3.0" - :dependencies [[org.clojure/clojure "1.6.0"] - [compojure "1.1.8"] - [ring/ring-jetty-adapter "1.2.2"] - [ring.middleware.logger "0.5.0"] - [ring/ring-devel "1.2.2"] - [environ "0.5.0"] + :dependencies [[org.clojure/clojure "1.9.0"] + [compojure "1.6.1"] + [ring/ring-jetty-adapter "1.7.1"] + [ring/ring-devel "1.7.1"] + [environ "1.1.0"] [hiccup "1.0.5"]] :min-lein-version "2.0.0" :plugins [[environ/environ.lein "0.2.1"] [lein-ring "0.9.7"]] :hooks [environ.leiningen.hooks] :uberjar-name "pronouns-standalone.jar" - :profiles {:production {:env {:production true}} - :dev {:dependencies [[midje "1.6.3"]]}} + :profiles {:production {:env {:production true}}} :ring {:handler pronouns.web/app}) diff --git a/src/pronouns/web.clj b/src/pronouns/web.clj index 69ad6ae..872a6aa 100644 --- a/src/pronouns/web.clj +++ b/src/pronouns/web.clj @@ -20,13 +20,13 @@ [compojure.route :as route] [clojure.string :as s] [clojure.java.io :as io] - [ring.middleware.logger :as logger] + [ring.adapter.jetty :as jetty] + ;[ring.middleware.logger :as logger] [ring.middleware.stacktrace :as trace] [ring.middleware.params :as params] [ring.middleware.resource :refer [wrap-resource]] [ring.middleware.content-type :refer [wrap-content-type]] [ring.middleware.not-modified :refer [wrap-not-modified]] - [ring.adapter.jetty :as jetty] [environ.core :refer [env]] [pronouns.util :as u] [pronouns.pages :as pages])) @@ -64,7 +64,7 @@ (wrap-resource "images") wrap-content-type wrap-not-modified - logger/wrap-with-logger + ;logger/wrap-with-logger wrap-error-page trace/wrap-stacktrace params/wrap-params)) diff --git a/test/pronouns/pages_test.clj b/test/pronouns/pages_test.clj index 04c14ce..e32a2ee 100644 --- a/test/pronouns/pages_test.clj +++ b/test/pronouns/pages_test.clj @@ -1,10 +1,12 @@ (ns pronouns.pages-test (:require [pronouns.pages :as pages] - [midje.sweet :refer :all])) + [clojure.test :refer [deftest testing is are]])) -(fact "prose-comma-list turns a list of strings into a prose list with commas" - (pages/prose-comma-list ["foo"]) => "foo" - (pages/prose-comma-list ["foo" "bar"]) => "foo and bar" - (pages/prose-comma-list ["foo" "bar" "baz"]) => "foo, bar, and baz" - (pages/prose-comma-list ["foo" "bar" "baz" "bobble"]) => "foo, bar, baz, and bobble" - (pages/prose-comma-list []) => "") +(deftest prose-comma-list + (testing "prose-comma-list turns a list of strings into a prose list" + (are [call result] (= call result) + (pages/prose-comma-list ["foo"]) "foo" + (pages/prose-comma-list ["foo" "bar"]) "foo and bar" + (pages/prose-comma-list ["foo" "bar" "baz"]) "foo, bar, and baz" + (pages/prose-comma-list ["foo" "bar" "baz" "bobble"]) "foo, bar, baz, and bobble" + (pages/prose-comma-list []) ""))) -- cgit From 80e1c5eb26a0d0d2a732f7634a51e94bdcd9029a Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 13:00:58 -0800 Subject: Update copyright year --- README.md | 2 +- resources/images/purple-flag.svg | 112 ------------------------------------- resources/images/purple-flag64.png | Bin 3717 -> 0 bytes src/pronouns/config.clj | 2 +- src/pronouns/pages.clj | 4 +- src/pronouns/util.clj | 2 +- src/pronouns/web.clj | 2 +- 7 files changed, 6 insertions(+), 118 deletions(-) delete mode 100644 resources/images/purple-flag.svg delete mode 100644 resources/images/purple-flag64.png (limited to 'src/pronouns') diff --git a/README.md b/README.md index a037e48..2d3cf06 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ It is possible to use these example sentences to demonstrate the usage of words ## License -Copyright © 2014-2017 Morgan Astra +Copyright © 2014-2018 Morgan Astra This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/resources/images/purple-flag.svg b/resources/images/purple-flag.svg deleted file mode 100644 index c8e231c..0000000 --- a/resources/images/purple-flag.svg +++ /dev/null @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - Openclipart - - - - - - - - - - - - diff --git a/resources/images/purple-flag64.png b/resources/images/purple-flag64.png deleted file mode 100644 index ba63aee..0000000 Binary files a/resources/images/purple-flag64.png and /dev/null differ diff --git a/src/pronouns/config.clj b/src/pronouns/config.clj index 19e20f1..ecde59f 100644 --- a/src/pronouns/config.clj +++ b/src/pronouns/config.clj @@ -1,5 +1,5 @@ ;; pronoun.is - a website for pronoun usage examples -;; Copyright (C) 2014 - 2017 Morgan Astra +;; Copyright (C) 2014 - 2018 Morgan Astra ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU Affero General Public License as diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 56830d0..d4051ac 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -1,5 +1,5 @@ ;; pronoun.is - a website for pronoun usage examples -;; Copyright (C) 2014 - 2017 Morgan Astra +;; Copyright (C) 2014 - 2018 Morgan Astra ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU Affero General Public License as @@ -71,7 +71,7 @@ (defn header-block [header] [:div {:class "section title"} - (href "/" [:h1 (e/image "/purple-flag64.png" "flag logo") header])]) + (href "/" [:h1 header])]) (defn examples-block [subject object possessive-determiner possessive-pronoun reflexive] diff --git a/src/pronouns/util.clj b/src/pronouns/util.clj index 01571b6..fa14698 100644 --- a/src/pronouns/util.clj +++ b/src/pronouns/util.clj @@ -1,5 +1,5 @@ ;; pronoun.is - a website for pronoun usage examples -;; Copyright (C) 2014 - 2017 Morgan Astra +;; Copyright (C) 2014 - 2018 Morgan Astra ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU Affero General Public License as diff --git a/src/pronouns/web.clj b/src/pronouns/web.clj index ab4bbb6..2e8184a 100644 --- a/src/pronouns/web.clj +++ b/src/pronouns/web.clj @@ -1,5 +1,5 @@ ;; pronoun.is - a website for pronoun usage examples -;; Copyright (C) 2014 - 2017 Morgan Astra +;; Copyright (C) 2014 - 2018 Morgan Astra ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU Affero General Public License as -- cgit From 2083d66ddb7d34d18eb18b4917265f7d8dfe4a4e Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 14:11:18 -0800 Subject: Add tests for table lookup functions --- src/pronouns/util.clj | 2 -- test/pronouns/util_test.clj | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 test/pronouns/util_test.clj (limited to 'src/pronouns') diff --git a/src/pronouns/util.clj b/src/pronouns/util.clj index fa14698..424e0f1 100644 --- a/src/pronouns/util.clj +++ b/src/pronouns/util.clj @@ -17,8 +17,6 @@ (ns pronouns.util (:require [clojure.string :as s])) -(defn print-and-return "for debugging" [x] (println x) x) - (defn slurp-tabfile "Read a tabfile from a filesystem as a table" [path] diff --git a/test/pronouns/util_test.clj b/test/pronouns/util_test.clj new file mode 100644 index 0000000..031f0f9 --- /dev/null +++ b/test/pronouns/util_test.clj @@ -0,0 +1,33 @@ +(ns pronouns.util-test + (:require [pronouns.util :as util] + [clojure.test :refer [deftest testing is]])) + +(def test-table [ + ["ze" "hir" "hir" "hirs" "hirself"] + ["ze" "zir" "zir" "zirs" "zirself"] + ["she" "her" "her" "hers" "herself"] + ["he" "him" "his" "his" "himself"] + ["they" "them" "their" "theirs" "themselves"] + ["they" "them" "their" "theirs" "themself"]]) + +(deftest table-filters + (testing "table-front-filter" + (are [arg return] (= (table-front-filter arg test-table) return) + ["she"] [["she" "her" "her" "hers" "herself"]] + ["ze"] [["ze" "hir" "hir" "hirs" "hirself"] + ["ze" "zir" "zir" "zirs" "zirself"]] + ["ze" "zir"] [["ze" "zir" "zir" "zirs" "zirself"]])) + + (testing "table-end-filter" + (are [arg return] (= (table-end-filter arg test-table) return) + ["themself"] [["they" "them" "their" "theirs" "themself"]] + ["themselves" [["they" "them" "their" "theirs" "themselves"]]]))) + +(deftest table-lookup + (are [arg return] (= (table-lookup arg test-table) return) + ["she"] ["she" "her" "her" "hers" "herself"] + ["ze"] ["ze" "hir" "hir" "hirs" "hirself"] + ["ze" "zir"] ["ze" "zir" "zir" "zirs" "zirself"] + ["they"] ["they" "them" "their" "theirs" "themselves"] + ["they" "..." "themself"] ["they" "them" "their" "theirs" "themself"])) + -- cgit From fde31a129a1f2c0dac15ab3f16053465930225cb Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 14:16:18 -0800 Subject: Fix all remaining http self-links to https --- project.clj | 2 +- src/pronouns/pages.clj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pronouns') diff --git a/project.clj b/project.clj index 1cc3d8d..a3d6bcf 100644 --- a/project.clj +++ b/project.clj @@ -1,6 +1,6 @@ (defproject witch-house/pronouns "1.12.0-SNAPSHOT" :description "Pronoun.is is a website for personal pronoun usage examples" - :url "http://pronoun.is" + :url "https://pronoun.is" :license "GNU Affero General Public License 3.0" :dependencies [[org.clojure/clojure "1.9.0"] [compojure "1.6.1"] diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index d4051ac..6f7321a 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -90,7 +90,7 @@ (defn usage-block [] [:div {:class "section usage"} [:p "Full usage: " - [:tt "http://pronoun.is/subject-pronoun/object-pronoun/possessive-determiner/possessive-pronoun/reflexive"] + [:tt "https://pronoun.is/subject-pronoun/object-pronoun/possessive-determiner/possessive-pronoun/reflexive"] " displays examples of your pronouns."] [:p "This is a bit unwieldy. If we have a good guess we'll let you use" " just the first one or two."]]) @@ -102,7 +102,7 @@ [:p "Written by " (twitter-name "morganastra") ", whose " - (href "http://pronoun.is/ze/zir?or=she" "pronoun.is/ze/zir?or=she")] + (href "https://pronoun.is/she" "pronoun.is/she")] [:p "pronoun.is is free software under the " (href "https://www.gnu.org/licenses/agpl.html" "AGPLv3") "! visit the project on " -- cgit From b507619c7c676dbf1fde09994b48a2211b4f61ee Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 14:17:47 -0800 Subject: Move license links to https --- COPYING | 2 +- src/pronouns/config.clj | 2 +- src/pronouns/pages.clj | 2 +- src/pronouns/util.clj | 2 +- src/pronouns/web.clj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pronouns') diff --git a/COPYING b/COPYING index 29c3097..84592c6 100644 --- a/COPYING +++ b/COPYING @@ -2,7 +2,7 @@ Version 3, 19 November 2007 -Copyright © 2007 Free Software Foundation, Inc. Everyone is +Copyright © 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble diff --git a/src/pronouns/config.clj b/src/pronouns/config.clj index ecde59f..3a07c36 100644 --- a/src/pronouns/config.clj +++ b/src/pronouns/config.clj @@ -12,7 +12,7 @@ ;; GNU Affero General Public License for more details. ;; You should have received a copy of the GNU Affero General Public License -;; along with this program. If not, see +;; along with this program. If not, see (ns pronouns.config (:require [pronouns.util :as u])) diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 6f7321a..5782df4 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -12,7 +12,7 @@ ;; GNU Affero General Public License for more details. ;; You should have received a copy of the GNU Affero General Public License -;; along with this program. If not, see +;; along with this program. If not, see (ns pronouns.pages (:require [clojure.string :as s] diff --git a/src/pronouns/util.clj b/src/pronouns/util.clj index 424e0f1..7469dcf 100644 --- a/src/pronouns/util.clj +++ b/src/pronouns/util.clj @@ -12,7 +12,7 @@ ;; GNU Affero General Public License for more details. ;; You should have received a copy of the GNU Affero General Public License -;; along with this program. If not, see +;; along with this program. If not, see (ns pronouns.util (:require [clojure.string :as s])) diff --git a/src/pronouns/web.clj b/src/pronouns/web.clj index 2e8184a..83a184d 100644 --- a/src/pronouns/web.clj +++ b/src/pronouns/web.clj @@ -12,7 +12,7 @@ ;; GNU Affero General Public License for more details. ;; You should have received a copy of the GNU Affero General Public License -;; along with this program. If not, see +;; along with this program. If not, see (ns pronouns.web (:require [compojure.core :refer [defroutes GET PUT POST DELETE ANY]] -- cgit From 41a9133d3d02c2d2948fbfe7599c10bfbd2aed2d Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 14:28:15 -0800 Subject: Add fixme notes --- src/pronouns/pages.clj | 4 ++++ src/pronouns/web.clj | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/pronouns') diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 5782df4..2ae6b4e 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -34,6 +34,8 @@ [url text] [:a {:href url} text]) +;; FIXME morgan.astra <2018-11-14 Wed> +;; use a div for this instead of a plain bold tag (defn wrap-pronoun [pronoun] [:b pronoun]) @@ -90,6 +92,8 @@ (defn usage-block [] [:div {:class "section usage"} [:p "Full usage: " + ;; FIXME morgan.astra <2018-11-14 Wed> + ;; This looks really ugly in the browser [:tt "https://pronoun.is/subject-pronoun/object-pronoun/possessive-determiner/possessive-pronoun/reflexive"] " displays examples of your pronouns."] [:p "This is a bit unwieldy. If we have a good guess we'll let you use" diff --git a/src/pronouns/web.clj b/src/pronouns/web.clj index 83a184d..15057c2 100644 --- a/src/pronouns/web.clj +++ b/src/pronouns/web.clj @@ -21,7 +21,9 @@ [clojure.string :as s] [clojure.java.io :as io] [ring.adapter.jetty :as jetty] - ;[ring.middleware.logger :as logger] + ;; FIXME morgan.astra <2018-11-14 Wed> + ;; make this logger work or use another one + ;; [ring.middleware.logger :as logger] [ring.middleware.stacktrace :as trace] [ring.middleware.params :as params] [ring.middleware.resource :refer [wrap-resource]] @@ -66,9 +68,13 @@ (def app (-> app-routes - (wrap-resource "images") + ;; FIXME morgan.astra <2018-11-14 Wed> + ;; use this resource or delete it + ;; (wrap-resource "images") wrap-content-type wrap-not-modified + ;; FIXME morgan.astra <2018-11-14 Wed> + ;; make this logger work or use another one ;logger/wrap-with-logger wrap-error-page wrap-gnu-natalie-nguyen -- cgit From c45042893905d3ffd227f37a24ad135d766063e1 Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 14:39:46 -0800 Subject: Make front page shorter Since this was currently the only place with a full list of all pronouns in the database, we should add a new page to serve that purpose (perhaps formatted into multiple columns so it isn't so incredibly long) --- src/pronouns/pages.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pronouns') diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 2ae6b4e..218caab 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -156,7 +156,7 @@ [:li (href link label)])) (defn front [] - (let [abbreviations (u/abbreviate *pronouns-table*) + (let [abbreviations (take 10 (u/abbreviate *pronouns-table*)) links (map make-link abbreviations) title "Pronoun Island"] (html -- cgit From 8628d9705526e91664886e6b2588d4972716a8a5 Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 22:12:23 -0800 Subject: Highly top five pronoun sets on the front page --- resources/pronouns.tab | 50 +++++++++++++++++++++++++------------------------- src/pronouns/pages.clj | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) (limited to 'src/pronouns') diff --git a/resources/pronouns.tab b/resources/pronouns.tab index 492f63c..03c521b 100644 --- a/resources/pronouns.tab +++ b/resources/pronouns.tab @@ -1,40 +1,40 @@ -ze hir hir hirs hirself -ze zir zir zirs zirself she her her hers herself he him his his himself they them their theirs themselves -they them their theirs themself +ze hir hir hirs hirself xey xem xyr xyrs xemself -xey xem xeir xeirs xemself -sie hir hir hirs hirself -it it its its itself -ey em eir eirs eirself +ae aer aer aers aerself e em eir eirs emself +ey em eir eirs eirself +fae faer faer faers faerself +fey fem feir feirs feirself hu hum hus hus humself +it it its its itself +jee jem jeir jeirs jemself +kit kit kits kits kitself +ne nem nir nirs nemself peh pehm peh's peh's pehself per per per pers perself +sie hir hir hirs hirself +se sim ser sers serself +shi hir hir hirs hirself +si hyr hyr hyrs hyrself +they them their theirs themself thon thon thons thons thonself -jee jem jeir jeirs jemself ve ver vis vis verself -xe xem xyr xyrs xemself -zie zir zir zirs zirself -ze zem zes zes zirself -zie zem zes zes zirself -ze mer zer zers zemself -se sim ser sers serself -zme zmyr zmyr zmyrs zmyrself ve vem vir virs vemself -zee zed zeta zetas zedself -fae faer faer faers faerself -zie hir hir hirs hirself -si hyr hyr hyrs hyrself -kit kit kits kits kitself -ne nem nir nirs nemself -fey fem feir feirs feirself -xie xer xer xers xerself vi ver ver vers verself vi vim vir virs vimself vi vim vim vims vimself +xie xer xer xers xerself +xe xem xyr xyrs xemself +xey xem xeir xeirs xemself yo yo yos yos yosself -shi hir hir hirs hirself -ae aer aer aers aerself +ze zir zir zirs zirself +ze zem zes zes zirself +ze mer zer zers zemself +zee zed zeta zetas zedself +zie zir zir zirs zirself +zie zem zes zes zirself +zie hir hir hirs hirself +zme zmyr zmyr zmyrs zmyrself diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 218caab..6d08519 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -156,7 +156,7 @@ [:li (href link label)])) (defn front [] - (let [abbreviations (take 10 (u/abbreviate *pronouns-table*)) + (let [abbreviations (take 5 (u/abbreviate *pronouns-table*)) links (map make-link abbreviations) title "Pronoun Island"] (html -- cgit From 8238eb6e0cbf71db6f2efe86ed4942253ebab9b6 Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 22:22:15 -0800 Subject: Add all-pronouns page --- src/pronouns/pages.clj | 24 +++++++++++++++++++++--- src/pronouns/web.clj | 6 ++++++ 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'src/pronouns') diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 6d08519..3b808fb 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -168,9 +168,27 @@ [:body (header-block title) [:div {:class "section table"} - [:p "pronoun.is is a website for personal pronoun usage examples"] - [:p "here are some pronouns the site knows about:"] - [:ul links]]] + [:p "pronoun.is is a website for personal pronoun usage examples"] + [:p "here are some pronouns the site knows about:"] + [:ul links] + [:p [:small (href "all-pronouns" "see all pronouns in the database")]]]] + (footer-block)]))) + +(defn all-pronouns [] + (let [abbreviations (u/abbreviate *pronouns-table*) + links (map make-link abbreviations) + title "Pronoun Island"] + (html + [:html + [:head + [:title title] + [:meta {:name "viewport" :content "width=device-width"}] + [:link {:rel "stylesheet" :href "/pronouns.css"}]] + [:body + (header-block title) + [:div {:class "section table"} + [:p "All pronouns the site knows about:"] + [:ul links]]] (footer-block)]))) (defn not-found [] diff --git a/src/pronouns/web.clj b/src/pronouns/web.clj index 15057c2..ab887d0 100644 --- a/src/pronouns/web.clj +++ b/src/pronouns/web.clj @@ -39,6 +39,12 @@ :headers {"Content-Type" "text/html"} :body (pages/front)}) + (GET "/all-pronouns" [] + {:status 200 + :headers {"Content-Type" "text/html"} + :body (pages/all-pronouns)}) + + (GET "/pronouns.css" [] {:status 200 :headers {"Content-Type" "text/css"} -- cgit From 6550a2e413d6b0c83d462c3f11dc0358679e5c89 Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 23:09:06 -0800 Subject: Make front page include ze/zir also Per feedback from Tavy, ze/zir is at least as common as ze/hir in modern usage, so it should be visible on the first page as well. --- resources/pronouns.tab | 2 +- src/pronouns/pages.clj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pronouns') diff --git a/resources/pronouns.tab b/resources/pronouns.tab index 03c521b..7f788b2 100644 --- a/resources/pronouns.tab +++ b/resources/pronouns.tab @@ -2,6 +2,7 @@ she her her hers herself he him his his himself they them their theirs themselves ze hir hir hirs hirself +ze zir zir zirs zirself xey xem xyr xyrs xemself ae aer aer aers aerself e em eir eirs emself @@ -30,7 +31,6 @@ xie xer xer xers xerself xe xem xyr xyrs xemself xey xem xeir xeirs xemself yo yo yos yos yosself -ze zir zir zirs zirself ze zem zes zes zirself ze mer zer zers zemself zee zed zeta zetas zedself diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 3b808fb..7fcbcbe 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -156,7 +156,7 @@ [:li (href link label)])) (defn front [] - (let [abbreviations (take 5 (u/abbreviate *pronouns-table*)) + (let [abbreviations (take 6 (u/abbreviate *pronouns-table*)) links (map make-link abbreviations) title "Pronoun Island"] (html -- cgit From f00ebc56b582bea2cfd1911403c342dca9247890 Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Wed, 14 Nov 2018 23:33:39 -0800 Subject: Remove superfluous comments --- src/pronouns/pages.clj | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/pronouns') diff --git a/src/pronouns/pages.clj b/src/pronouns/pages.clj index 7fcbcbe..1226ea9 100644 --- a/src/pronouns/pages.clj +++ b/src/pronouns/pages.clj @@ -116,13 +116,6 @@ (defn footer-block [] [:footer (usage-block) (contact-block)]) -;; -;; -;; -;; -;; -;; not all of these are required! - (defn format-pronoun-examples [pronoun-declensions] (let [sub-objs (map #(s/join "/" (take 2 %)) pronoun-declensions) -- cgit From d8eaeb2eb9b2dbb679a280f2e5ec92ce1f5a7c5e Mon Sep 17 00:00:00 2001 From: Morgan Astra Date: Thu, 15 Nov 2018 01:01:43 -0800 Subject: Make logger middleware work again --- project.clj | 1 + src/pronouns/web.clj | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src/pronouns') diff --git a/project.clj b/project.clj index 02f53f4..dcd42d5 100644 --- a/project.clj +++ b/project.clj @@ -5,6 +5,7 @@ :dependencies [[compojure "1.6.1"] [environ "1.1.0"] [hiccup "1.0.5"] + [lambdaisland/ring.middleware.logger "0.5.1"] [org.clojure/clojure "1.9.0"] [ring/ring-devel "1.7.1"] [ring/ring-jetty-adapter "1.7.1"]] diff --git a/src/pronouns/web.clj b/src/pronouns/web.clj index ab887d0..25f8a78 100644 --- a/src/pronouns/web.clj +++ b/src/pronouns/web.clj @@ -21,9 +21,7 @@ [clojure.string :as s] [clojure.java.io :as io] [ring.adapter.jetty :as jetty] - ;; FIXME morgan.astra <2018-11-14 Wed> - ;; make this logger work or use another one - ;; [ring.middleware.logger :as logger] + [ring.middleware.logger :as logger] [ring.middleware.stacktrace :as trace] [ring.middleware.params :as params] [ring.middleware.resource :refer [wrap-resource]] @@ -79,9 +77,7 @@ ;; (wrap-resource "images") wrap-content-type wrap-not-modified - ;; FIXME morgan.astra <2018-11-14 Wed> - ;; make this logger work or use another one - ;logger/wrap-with-logger + logger/wrap-with-logger wrap-error-page wrap-gnu-natalie-nguyen trace/wrap-stacktrace -- cgit