Abbreviation Parser
This parser is an extension of the standard Moin wiki parser and adds some abbreviation support there. This extension is mainly written for AccessibleMoin since it is one criteria for accessible sites, that abbrevations or acronyms should be marked with the <abbr title=.. lang=..> html markup.
Since the <acronym> tag won't be probably part of future (X)HTML standards and since Moin patches the missing <abbr> support of Internet Explorer, only <abbr> is used in AccessibleMoin to mark acronyms and abbreviations.
Usage
^WAI^
Marks the word WAI as an abbreviation and tries to retrieve the explanation from the standard abbreviation definitions page "AbbrDict" or the page specified with "#pragma abbreviation-definitions PageName" in the header of the page.
^WAI|OtherPage^
Marks the word WAI as an abbreviation and tries to retrieve the explanation from the specified page "OtherPage". You can use this to overwrite the default settings "AbbrDict" or "#pragma abbreviation-definitions PageName"
^WAI:Web Accessibility Initiative^
Marks the word WAI as an abbreviation and uses the given explanation.
^WAI|language=de^ ^WAI|OtherPage|language=de^ ^WAI:Web Accessibility Initiative|language=de^
Marks the word WAI as an foreign language abbreviation (compared to the language default of the wiki and the page)
Please note:
The explanation pages for abbreviations must be in WikiDict format (for more on WikiDicts see also HelpOnLanguages).
If the abbreviation is in another language than the default page language, please mark this with "|language=LanguageShortcut"
Don't forget the caching mechanism of Moin: To get a page updated with a changed abbreviation explanation (e.g. from AbbrDict) you have to delete the cache of the page or reedit the page again.
- For correct display of abbreviations also in IE please put this line in your screen.css "abbr[title] {border-bottom: 1px dotted; cursor: help}"
Installation
Download abbr.py and drop it in your wiki's parser directory. By the processing instruction #format abbr at the beginning of a page, you can tell Moin to use the AbbreviationParser instead of the normal parser. You can also set AbbreviationParser as new default parser in wikiconfig.py by default_markup= 'abbr'
Discussion
One problem remains unsolved: How to deal with the caching mechanism? It would be fine that after changing the AbbrDictPages the cache of the pages taking the abbreviation explanations from these AbbrDictPages is invalidated so that the explanations are correctly updated. But I don't know how to do that.. Maybe it wouldn't be such a problem with an AbbreviationMacro instead of an AbbreviationParser. On the other hand parser markup is much shorter so the chance is higher that people do use that...
Would be nice to have a Dict for all that things like IMAO, OTOH, IMHO, AFAIK and so on - at least for me...
Since ^ is already used for superscripts (i.e., x^2^ produces x2) perhaps it is better to use a different delimiter. --JohnCarlson 2008-01-06 02:35:21