Skip to content

Conversation

7o7omootsqwn
Copy link

@7o7omootsqwn 7o7omootsqwn commented Aug 26, 2025

@cysouw if you could please review and provide feedback whenever you have a moment. This commit adds functionality to output HTML's abbr tag in the glossing line with the abbreviation's full gloss displayed upon hover when a glossing abbreviation is recognized.

Users may specify custom abbreviations as a YAML map in the document metadata, under the option pandocLingAbbreviations, which will override any default glossing abbreviations. Abbreviations must be specified in ALL CAPS. No defaults are currently provided.

After some consideration, I decided to output the gloss as a Pandoc SmallCaps node containing a RawInline, as opposed to bare RawInline with the smallcaps class baked into the HTML. While this results in more verbose and less semantic HTML output, I ultimately settled on this option as it preserves more information in the Pandoc AST itself, which downstream filters might eventually want to use.

As stated above, no default glossing abbreviations are provided in this commit. I can add these if there's any interest in this feature. Suggestions for where to find a comprehensive list are also welcome.

This commit only implements the functionality for HTML output, but it provides a small scaffold for implementing similar functionality for latex output as well, which I believe could be implemented quite straightforwardly using the pdfcomment package. Again, if there is interest, I could look into doing this.

When outputting to HTML, if a glossing abbreviation formatted
in SmallCaps is recognized, it will be output as HTML's abbr tag
with the gloss displayed upon hover.

Users may specify custom abbreviations as a YAML map in the
document metadata, under the option pandocLingAbbreviations, which
will override any default glossing abbreviations. Abbreviations
must be specified in ALL CAPS. No defaults are currently provided.
@7o7omootsqwn 7o7omootsqwn marked this pull request as draft August 26, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant