Changes between Version 11 and Version 12 of AbbrMacro
- Timestamp:
- Sep 16, 2015, 6:36:55 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AbbrMacro
v11 v12 15 15 }}} 16 16 17 Where `key` is the element content, `title` is required, and the `tag` keyword is optional. The element type (tag) will default to `acronym` if omitted. Why is acronym the default? For several reasons. First, most users are after acronyms (and as far as I know there are no plans for an `initialism` element). Second, Internet Explorer before version 7.0 does not support the `<abbr>` element. It won't do any harm to use them 18 with IE 6 and below, but these browsers do not allow you to style the element with CSS and they don't display the title attribute as a tooltip. 17 Where `key` is the element content, `title` is required, and the `tag` keyword is optional. The element type (tag) will default to `acronym` if omitted. Why is acronym the default? For several reasons. First, most users are after acronyms (and as far as I know there are no plans for an `initialism` element). Second, Internet Explorer before version 7.0 does not support the `<abbr>` element. It won't do any harm to use them with IE 6 and below, but these browsers do not allow you to style the element with CSS and they don't display the title attribute as a tooltip. 19 18 20 Many HTML authors mistakenly refer to elements as "tags." For a review of the syntax and nomenclature of WWW markup elements, visit the Wikipedia [http://en.wikipedia.org/wiki/HTML_element Element] article, or this quick synopsis will help. 21 22 Syntactically, HTML elements are constructed with: 19 Many HTML authors mistakenly refer to elements as "tags." For a review of the syntax and nomenclature of WWW markup elements, visit the Wikipedia [http://en.wikipedia.org/wiki/HTML_element Element] article, or this quick synopsis will help. Syntactically, HTML elements are constructed with: 23 20 * A `start tag` marking the beginning of an element. 24 21 * Any number of valid `attributes` (and their associated values in quotes). … … 34 31 There has been a long and sometimes heated discussion on the `<abbr>` and `<acronym>` elements around the Web. A good article at Juicy Studios was written by my friend Pamela Berman: [http://juicystudio.com/article/abbreviations-acronyms.php Abbreviations are a Breeze]. 35 32 36 == Dictionary File33 === Dictionary File 37 34 38 `AbbrMacro` is designed to be rolled out in phases. The first and simplest use case I've already described. But even that can become tedious, especially if you use the same acronyms over and over. The second phase introduces a user-defined plain text dictionary file of key=value (content=title) pairs, which permits the omission of the title keyword. Assuming, that is, there is a matching abbreviation in the dictionary file.35 `AbbrMacro` is designed to be rolled out in phases. The first and simplest use case is described above. But even that can become tedious, especially if you use the same acronyms over and over. The second phase introduces a user-defined plain text dictionary file of key=value (content=title) pairs, which permits the omission of the title keyword. Assuming, that is, there is a matching abbreviation in the dictionary file. 39 36 40 37 You may also include the title attribute using the macro even if the element is defined in the dictionary file, the macro title keyword will take precedence. If you omit the title and the element is ''not'' defined in the dictionary, the macro will issue a error message and exit. 41 38 42 To configure the location of the dictionary file, add the following 39 To configure the location of the dictionary file, add the following entry to your project `trac.ini`: 43 40 44 41 {{{#!ini … … 47 44 }}} 48 45 49 The file must be readable (and eventually writable, see below) by your Web server in orderfor this feature to work.46 The file must be readable (and eventually writable, see below) by your Web server for this feature to work. 50 47 51 48 The format of the dictionary file couldn't be simpler: … … 62 59 }}} 63 60 64 Where leading and trailing whitespace are removed. Notice that there is a uncanny similarity between the dictionary file and trac.ini? This is no accident of course, each onehas sections followed by name=value pairs. Sections other than `[abbr]` and `[acronym]` in the dictionary file are ignored, and there is no rule you must have both. I tend to only use acronyms for this sort of thing, and to help get you started here is an example [AbbrMacro/AbbrMap AbbrMap]. Like all Python/Trac files, strings beginning with a `#` (pound) character are treated as comments and are ignored. If you're going to use Unicode characters in your dictionary (typically in the title attribute), open the file, as always, with:61 Where leading and trailing whitespace are removed. Notice that there is a similarity between the dictionary file and `trac.ini`. Each has sections followed by name=value pairs. Sections other than `[abbr]` and `[acronym]` in the dictionary file are ignored, and there is no rule you must have both. I tend to only use acronyms for this sort of thing, and to help get you started here is an example [AbbrMacro/AbbrMap AbbrMap]. Like all Python/Trac files, strings beginning with a `#` (pound) character are treated as comments and are ignored. If you're going to use Unicode characters in your dictionary (typically in the title attribute), open the file, as always, with: 65 62 66 63 {{{#!python … … 77 74 }}} 78 75 76 === !AbbrMapTxt 77 78 A third and final phase will allow the user to edit this file from within the wiki, similar to the InterMapTxt page for InterWiki links. 79 79 80 == Bugs/Feature Requests 80 81 … … 90 91 * Browse the source at: [http://github.com/dwclifton/tracabbrmacro/tree/master GitHub]. 91 92 * Public clone URL: 92 {{{ 93 #!sh 93 {{{#!sh 94 94 git clone git://github.com/dwclifton/tracabbrmacro.git 95 95 }}} 96 97 == !AbbrMapTxt98 99 A third and final phase will allow the user to edit this file from within the wiki, similar to the InterMapTxt page for InterWiki links.100 96 101 97 == Installation