Automate Table of Abbreviations and Acronyms
Related #698.
Currently usedinfodb is used to extract acronyms to print.
https://github.com/JacquesCarette/Drasil/blob/f43b3c189ac90af4681e5f1250077817a0f2e86a/code/drasil-docLang/Drasil/DocumentLanguage.hs#L275-L276
And the items pulled from the usedinfodb are manually populated in the examples.
What are the steps to automate this?
- Use the
shortconstructor to construct abbreviations (in the examples) as opposed togetA. Theshortsmart constructor maintains chunk information of what is being abbreviated. - Write a plate extension for
sentencePlatehttps://github.com/JacquesCarette/Drasil/blob/f43b3c189ac90af4681e5f1250077817a0f2e86a/code/drasil-docLang/Drasil/ExtractDocDesc.hs#L180 to extract the abbreviations fromSentenceconstructors. - Expand
renderReffrom using raw strings toSentence(makes reference pretty names more flexible too). EnsurerenderRefembeds the chunk of the abbreviation (and not just the string).ConceptInstancealready does this forrenderRefwithDeferred. https://github.com/JacquesCarette/Drasil/blob/f43b3c189ac90af4681e5f1250077817a0f2e86a/code/drasil-theory/Theory/Drasil/Theory.hs#L65 - Extend the mapping from
sentencePlatedone in step 2, to extract abbreviations from references. - Lower Table of Abbreviation and Acronym (and really all subsections in RefSec) to a later pass. (As things like Traceability Matrices are generated from the
DocDesc, there will likely be references to likely changes section, which wouldn't be present prior to generation of the Traceability Matrix section. - Finally, enable expansion to only lookup terms which have been gathered. https://github.com/JacquesCarette/Drasil/blob/f43b3c189ac90af4681e5f1250077817a0f2e86a/code/drasil-docLang/Drasil/DocumentLanguage.hs#L275-L276
This was discussed in the Dec 20th meeting (starting at approximately 6:30).
As of right now, _usedinfodb is left as a hack for the Table of Abbreviations and Acronyms, where the terms are manually populated into the _usedinfodb. We decided that we would hold off on working on this until a bit later when #2873 or similar is finished. The ideal solution is scanning the chunk database for chunks that are used in the softifacts (without scanning the generated contents), and then pulling the abbreviations and acronyms automatically.