witch-house / pronoun.is

Show people how to use pronouns!
http://pronoun.is
GNU Affero General Public License v3.0
929 stars 103 forks source link

Rainbow Declensions! #137

Closed tacosontitan closed 2 months ago

tacosontitan commented 2 years ago

Fixes Issue #95 Rainbow Declensions!

Important Note

I'm unable to verify the last two bullet points as I have to get my laptop repaired and haven't had time. However, the string replacement is straight forward and can be verified using this online compiler and the following snippet:

(ns tst.demo.core
  (:require
    [clojure.string :as str]
  ))

 (println (str/replace (str/replace (str "." "she   her her her's   herself") "\t" ".") "'" ""))

Note: The table contains a pronoun set with an apostrophe, so I accounted for that in the above snippet.

How it Works

This feature works by taking the pronoun and replacing tab characters (\t in the above snippet) with a period .. Then, to make things safe when pronouns contain apostrophes (such as with peh pehm peh's peh's pehself) an additional replacement is made to replace the apostrophe ' with an empty string "".

The result is assigned as the class to the b element.

Adding New Pronouns

When adding new pronouns, not only will we have to ensure that tabs are used in the table, but the appropriate CSS classes should be added, for example, adding the she/her set:

;; Table
she her her hers    herself

;; prounouns.css
.pronouns.she.her.her.hers.herself { color: default; }
tacosontitan commented 2 years ago

@morganastra, I apologize that the last two checkpoints aren't completed. I'm not able to complete them in a reasonable amount of time because I have to get my laptop repaired. If someone could take over that portion of the pull request I would greatly appreciate it!