digitallinguistics / dlx2html

A JavaScript library for converting linguistic data to HTML
MIT License
2 stars 0 forks source link

Clarify default formatting of abbreviations in documentation #68

Open dwhieb opened 6 months ago

dwhieb commented 6 months ago

By default, the library won't do anything special with your glosses. For example, the following interlinear gloss in Swahili:

ninakupenda
ni-na-ku-pend-a
1SG.SUBJ-PRES-2SG.OBJ-love-IND
I love you

Produces this HTML:

<div class="igl">
  <p class="txn" data-ortho="default">ninakupenda</p>
  <ol class="words">
    <li class="word">
      <span class="m" data-ortho="default">ni‑na‑ku‑pend‑a</span>
      <span class="glosses">1SG.SUBJ‑PRES‑2SG.OBJ‑love‑IND</span>
    </li>
  </ol>
  <p class="tln">I love you</p>
</div>

However, if you set the glosses​ option to true​, any glosses written in capital letters will be surrounded with an ​ tag that you can use to style them, like so:

<div class="igl">
  <p class="txn" data-ortho="default">ninakupenda</p>
  <ol class="words">
    <li class="word">
      <span class="m" data-ortho="default">ni‑na‑ku‑pend‑a</span>
      <span class="glosses"><abbr>1</abbr><abbr>sg</abbr>.<abbr>subj</abbr>‑<abbr>pres</abbr>‑<abbr>2</abbr><abbr>sg</abbr>.<abbr>obj</abbr>‑love‑<abbr>ind</abbr></span>
    </li>
  </ol>
  <p class="tln">I love you</p>
</div>

The abbreviations​ option is just for adding a title​ attribute to the ​ tags for accessibility purposes, like this:

<abbr title="animate intransitive verb">VAI</abbr>​