Some handy code for this fic I wrote

I posted on Mastodon asking for guidance on doing a thing I was trying to do and got some helpful answers from @senders@tech.lgbt and @theo@soc.webair.xyz. The former linked me some Javascript documentation that I was able to use to almost do the thing, and I’m sure I would have had it eventually… until the latter showed up with a fully working piece of code that just did what I needed super simply.

Here it is, for Future Me’s reference, and also anyone else who might need it:

Azem’s pronouns:



they
are
them
They

<script>
    function changePronouns(subject, subjCap, object, are){
        let els = document.getElementsByClassName("pron-subject");
        for (let i=0; i < els.length; i++){
            els[i].textContent=subject;

        }
        els = document.getElementsByClassName("pron-object");
        for (let i=0; i < els.length; i++){
            els[i].textContent=object;

        }
        els = document.getElementsByClassName("pron-subjCap");
        for (let i=0; i < els.length; i++){
            els[i].textContent=subjCap;

        }
        els = document.getElementsByClassName("pron-are");
        for (let i=0; i < els.length; i++){
            els[i].textContent=are;

        }
    }
</script>

The fic in question is stacked to the heavens where our sins took root, in which I put to paper my own guess of how the Zodiark summoning went.

The one downside to this is I need to add an extra class for every single verb I might use that conjugates differently between singular and plural. Doing that at least makes me pay attention to the words I’m using, though, so it’s not all bad!