Changes between Version 10 and Version 11 of AbbrMacro


Ignore:
Timestamp:
Aug 25, 2015, 12:40:48 PM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes, rearranged paragraphs to maintain consistency

Legend:

Unmodified
Added
Removed
Modified
  • AbbrMacro

    v10 v11  
    11[[PageOutline(2-5,Contents,pullout)]]
    22
    3 = Abbr and Acronym Macro =
     3= Abbr and Acronym Macro
    44
    5 == Description ==
     5== Description
    66
    77AbbrMacro returns an <abbr> or <acronym> element with a title attribute.
    88
    9 If you've used InlineMacro to create abbreviations or acronyms in your [WikiFormatting formatted] wiki
    10 pages, you probably quickly realized how tedious it can be. The !AbbrMacro package is designed to
    11 alleviate this issue.
     9If you've used InlineMacro to create abbreviations or acronyms in your [WikiFormatting formatted] wiki pages, you probably quickly realized how tedious it can be. The !AbbrMacro package is designed to alleviate this issue.
    1210
    1311It accepts keyword syntax only:
     
    1715}}}
    1816
    19 Where `key` is the element content, `title` is required, and the `tag` keyword is optional. The element
    20 type (tag) will default to `acronym` if omitted. Why is acronym the default? For several reasons. First,
    21 most users are after acronyms (and as far as I know there are no plans for an `initialism` element). Second,
    22 Internet Explorer before version 7.0 does not support the `<abbr>` element. It won't do any harm to use them
    23 with IE 6 and below, but these browsers do not allow you to style the element with CSS and they don't display
    24 the title attribute as a tooltip.
     17Where `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
     18with 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.
    2519
    26 Many HTML authors mistakenly refer to elements as "tags." For a review of the syntax and nomenclature of WWW
    27 markup elements, visit the Wikipedia [http://en.wikipedia.org/wiki/HTML_element Element] article, or this
    28 quick synopsis will help.
     20Many 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.
    2921
    3022Syntactically, HTML elements are constructed with:
    31 
    3223 * A `start tag` marking the beginning of an element.
    3324 * Any number of valid `attributes` (and their associated values in quotes).
     
    3627
    3728'''Notes''':
    38 
    3929 * In general, empty elements do not have an end tag nor do they contain content.
    4030 * HTML elements that include attributes do so in their start tags; they define additional properties and behavior.
     
    4232 * These rules vary depending on what [http://www.w3.org/QA/Tips/Doctype DOCTYPE] you are serving.
    4333
    44 There has been a long and sometimes heated discussion on the `<abbr>` and `<acronym>` elements around the
    45 Web. A good article at Juicy Studios was written by my friend Pamela Berman:
    46 [http://juicystudio.com/article/abbreviations-acronyms.php Abbreviations are a Breeze].
     34There 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].
    4735
    48 == Dictionary File ==
     36== Dictionary File
    4937
    50 `AbbrMacro` is designed to be rolled out in phases. The first and simplest use case I've already described.
    51 But even that can become tedious, especially if you use the same acronyms over and over. The second phase
    52 introduces a user-defined plain text dictionary file of key=value (content=title) pairs, which permits the
    53 omission of the title keyword. Assuming, that is, there is a matching abbreviation in the dictionary file.
    54 You may also include the title attribute using the macro even if the element is defined in the dictionary
    55 file, the macro title keyword will take precedence. If you omit the title and the element is ''not'' defined
    56 in the dictionary, the macro will issue a error message and exit.
     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.
     39
     40You 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.
    5741
    5842To configure the location of the dictionary file, add the following  entry to your project `trac.ini`:
    5943
    60 {{{
    61 #!ini
     44{{{#!ini
    6245[abbr]
    6346file = /path/to/your/abbreviations/file
    6447}}}
    6548
    66 The file must be readable (and eventually writable, see below) by your Web server in order for this feature
    67 to work.
     49The file must be readable (and eventually writable, see below) by your Web server in order for this feature to work.
    6850
    6951The format of the dictionary file couldn't be simpler:
    7052
    71 {{{
    72 #!ini
     53{{{#!ini
    7354[acronym]
    7455PEP = Python Enhancement Proposal
     
    8162}}}
    8263
    83 Where leading and trailing whitespace are removed. Notice that there is a uncanny similarity between the dictionary file
    84 and trac.ini? This is no accident of course, each one has sections followed by name=value pairs. Sections other than
    85 `[abbr]` and `[acronym]` in the dictionary file are ignored, and there is no rule you must have both. I tend to only use
    86 acronyms for this sort of thing, and to help get you started here is an example [AbbrMacro/AbbrMap AbbrMap]. Like all
    87 Python/Trac files, strings beginning with a `#` (pound) character are treated as comments and are ignored. If you're
    88 going to use Unicode characters in your dictionary (typically in the title attribute), open the file, as always, with:
     64Where 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 one 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:
    8965
    90 {{{
    91 #!python
     66{{{#!python
    9267# -*- coding: utf-8 -*-
    9368}}}
    9469
    95 {{{
    96 #!html
     70{{{#!html
    9771<div class="system-message">
    9872<strong>Warning</strong>: Since abbreviations and acronyms kept in the dictionary file are stored in memory as unique
     
    10377}}}
    10478
    105 == !AbbrMapTxt ==
     79== Bugs/Feature Requests
    10680
    107 A third and final phase will allow the user to edit this file from within the wiki, similar to the InterMapTxt page
    108 for InterWiki links.
     81Existing bugs and feature requests for AbbrMacro are
     82[report:9?COMPONENT=AbbrMacro here].
    10983
    110 == Installation ==
     84If you have any issues, create a [/newticket?component=AbbrMacro new ticket].
    11185
    112 Download the [https://download.github.com/dwclifton-tracabbrmacro-4658023.zip zipfile], unzip the archive to a temporary
    113 location, visit the `0.11` folder and run:
     86[[TicketQuery(component=AbbrMacro&group=type,format=progress)]]
    11487
     88== Source
     89
     90 * Browse the source at: [http://github.com/dwclifton/tracabbrmacro/tree/master GitHub].
     91 * Public clone URL:
    11592{{{
    11693#!sh
     94git clone git://github.com/dwclifton/tracabbrmacro.git
     95}}}
     96
     97== !AbbrMapTxt
     98
     99A 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
     101== Installation
     102
     103Download the [https://download.github.com/dwclifton-tracabbrmacro-4658023.zip zipfile], unzip the archive to a temporary location, visit the `0.11` folder and run:
     104
     105{{{#!sh
    117106python setup.py bdist_egg
    118107cp dist/*.egg /trac/env/Project/plugins
    119108}}}
    120109
    121 == Configuration ==
     110== Configuration
    122111
    123 Enable the macro in:
     112Enable the macro in `/trac/env/Project/conf/trac.ini` as follows:
    124113
    125 /trac/env/Project/conf/trac.ini:
    126 
    127 {{{
    128 #!ini
     114{{{#!ini
    129115[components]
    130116abbr.* = enabled
     
    135121You may have to restart your Web server.
    136122
    137 == Style ==
     123=== Style
    138124
    139125No sense doing it without style, here's mine.
    140126
    141 {{{
    142 #!css
     127{{{#!css
    143128/* acronyms and abbrs */
    144129
     
    155140}}}
    156141
    157 == Example ==
     142== Example
    158143
    159144'''Macro''':
     
    168153}}}
    169154
    170 == Source ==
    171 
    172  * Browse the source at: [http://github.com/dwclifton/tracabbrmacro/tree/master GitHub].
    173  * Public clone URL:
    174 {{{
    175 #!sh
    176 git clone git://github.com/dwclifton/tracabbrmacro.git
    177 }}}
    178 
    179 == Bugs/Feature Requests ==
    180 
    181 Existing bugs and feature requests for AbbrMacro are
    182 [report:9?COMPONENT=AbbrMacro here].
    183 
    184 If you have any issues, create a [http://trac-hacks.org/newticket?component=AbbrMacro&owner=dwclifton new ticket].
    185 
    186 == Recent Changes ==
     155== Recent Changes
    187156
    188157[[ChangeLog(abbrmacro, 3)]]
    189158
    190 == Author/Contributors ==
     159== Author/Contributors
    191160
    192161'''Author:''' [wiki:dwclifton] [[BR]]
    193 '''Maintainer:''' [wiki:dwclifton] [[BR]]
    194 '''Contributors:''' The Trac and Python development community.
     162'''Maintainer:''' [[Maintainer]] [[BR]]
     163'''Contributors:''' the Trac and Python development community.