kprussing / pandoc-acro

Pandoc filter for managing acronyms
BSD 2-Clause "Simplified" License
9 stars 3 forks source link

Support long-plural-form and NewAcroCommand #8

Open UFOMelkor opened 1 year ago

UFOMelkor commented 1 year ago

Currently, the filter supports a short and a long form and their plural suffixes. For a language like English, I guess that is all you need. For other languages like German, you unfortunately need more forms, which cannot be accomplished by simply adding a suffix:

Apfel (nom. sg.) → Äpfel (nom. pl.) Bundesamt für Stahlenschutz (nom. sg.) → Bundesamtes für Strahlenschutz (gen. sg.)

If I read and understand correctly, the acro package supports this with long-plural-form and NewAcroCommand (for defining other cases). I think about a syntax like the following one:

acronyms:
  Apple:
    short: AP
    long: Apfel
    long-plural-form: Äpfel
  BfS:
    short: BfS
    long: "Bundesamt für Strahlenschutz"
    long-genitive-form: "Bundesamtes für Strahlenschutz"
Das englische Wort für [+Apple]{.plural} ist apples.
[+Apple]{.plural} werden von den Mitarbeitern des [+BfS]{.genitive} untersucht.
Das englische Wort für Äpfel (AP) ist apples.
APs werden von den Mitarbeitern des Bundesamtes für Strahlenschutz (BfS) untersucht.

Would you be fine if I give a try implementing this, or would you consider this out-of-scope for this filter?

UFOMelkor commented 1 year ago

Although not documented, it looks like short-plural-form and long-plural-form are already supported :-)

kprussing commented 1 year ago

Well that means we have a bug in the documentation ;-).

Adding features similar to what acro does to the non-LaTeX output is not necessarily out of scope for the filter. My original goal was to have a direct mapping to the acro macros and supporting some of the functionality where I could/wanted it (proper acronym expansion, list of acronyms, etc.). If you see something you'd like to try to implement, go for it.

kprussing commented 1 year ago

The long and short forms are dealt with in #9