Format HTML glosses using abbr tag #25
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@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 aRawInline
, as opposed to bareRawInline
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.