Changes between Version 1 and Version 2 of TopMacro


Ignore:
Timestamp:
Dec 21, 2008 10:02:57 PM (6 years ago)
Author:
dwclifton
Comment:

Rewrote page

Legend:

Unmodified
Added
Removed
Modified
  • TopMacro

    v1 v2  
    33== Description == 
    44 
    5 TopMacro is exceedingly simple. In a nutshell, it does exactly what you think it would, inserts a "top of page" link in your Wiki page. The only option is a string that is inserted into the content of the markup. 
     5TopMacro is exceedingly simple, like all good software ;-). In a nutshell, it 
     6does exactly what you think it would, inserts a "top of page" link in your Wiki 
     7page. The only option is a string that is inserted into the content of the markup. 
     8This defaults to a single circumflex "!^" character (more commonly known as a caret), 
     9surrounded by square brackets. The anchor element returned includes a "Top of Page" 
     10title attribute so the user knows its purpose, and a "topofpage" class so the Wiki 
     11author may style it in any way they please. 
    612 
    7 == Bugs/Feature Requests ==  
     13{{{ 
     14[[Top]] becomes: 
    815 
    9 Existing bugs and feature requests for TopMacro are  
    10 [report:9?COMPONENT=TopMacro here]. 
     16[<span class="topofpage"><a href="#" title="Top of page">^</a></span>] 
     17}}} 
    1118 
    12 If you have any issues, create a  
    13 [http://trac-hacks.org/newticket?component=TopMacro&owner=dwclifton new ticket]. 
     19You could of course achieve the same effect by doing this: 
    1420 
    15 == Download == 
     21{{{ 
     22{{{ 
     23#!html 
     24[<a href="#" title="Top of page">^</a>] 
     25}}} 
     26}}} 
    1627 
    17 Download the zipped source from [download:topmacro here]. 
     28Resulting in this: 
    1829 
    19 == Source == 
     30{{{ 
     31#!html 
     32[<a href="#" title="Top of page">^</a>] 
     33}}} 
    2034 
    21 You can check out TopMacro from [http://trac-hacks.org/svn/topmacro here] using Subversion, or [source:topmacro browse the source] with Trac. 
     35But who wants to do all that typing? 
    2236 
    23 == Example == 
     37That's what [http://en.wikipedia.org/wiki/Macro_(computer_science) macros] are for 
     38after all. Note that the brackets do not form part of the anchor itself. That is a 
     39personal preference. If you pass a string to the macro they are omitted. 
    2440 
     41== Styling == 
     42 
     43If you like the caret, but prefer to omit the brackets and style the link yourself 
     44with CSS, try this: 
     45 
     46{{{ 
     47[[Top(^)]] 
     48}}} 
     49 
     50{{{ 
     51.topofpage { 
     52  background-color: #eaeaea; 
     53  color: #eff5f16; 
     54  padding: 2px 4px 0; 
     55  border: 1px solid #c6c7db; 
     56} 
     57}}} 
     58 
     59Note that if you're going to style the anchor like this you should really pass an argument 
     60to the macro or you'll end up with the default brackets in addition to the styling. 
     61 
     62== Installation == 
     63 
     64Download the zipped source from [/raw-attachment/wiki/TopMacro/topmacro.zip here] or on 
     65[http://trac-hacks.org/attachment/wiki/TopMacro/topmacro.zip?format=raw Trac Hacks]. Unzip 
     66the archive to a temporary location, visit the 0.11 directory and run: 
     67 
     68{{{ 
     69python setup.py bdist_egg 
     70cp dist/*.egg /trac/env/Project/plugins 
     71}}} 
     72 
     73== Configuration == 
     74 
     75Enable the macros in: 
     76 
     77/trac/env/Project/conf/trac.ini: 
     78 
     79{{{ 
     80[components] 
     81top.* = enabled 
     82}}} 
     83 
     84You may need to restart your Web server. 
     85 
     86== Examples == 
     87 
     88{{{ 
    2589[[Top]] 
    2690[[Top(^)]] 
    2791[[Top(top)]] 
    2892[[Top(Top of page)]] 
     93}}} 
     94 
     95== Source == 
     96 
     97 * Browse the source at: [http://github.com/dwclifton/tractopmacro/tree/master/0.11 GitHub] 
     98 * Public clone URL: 
     99{{{ 
     100git clone git@github.com:dwclifton/tractopmacro.git 
     101}}} 
     102 
     103== Bugs/Feature Requests ==  
     104 
     105Existing bugs and feature requests for TopMacro are [report:9?COMPONENT=TopMacro here]. 
     106 
     107If you have any issues, create a [http://trac-hacks.org/newticket?component=TopMacro&owner=dwclifton new ticket]. 
    29108 
    30109== Recent Changes == 
     
    35114 
    36115'''Author:''' [wiki:dwclifton] [[BR]] 
    37 '''Contributors:''' 
     116'''Contributors:''' The Python/Trac development community.