Changes between Version 1 and Version 2 of TopMacro
- Timestamp:
- Dec 21, 2008, 9:02:57 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TopMacro
v1 v2 3 3 == Description == 4 4 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. 5 TopMacro is exceedingly simple, like all good software ;-). In a nutshell, it 6 does exactly what you think it would, inserts a "top of page" link in your Wiki 7 page. The only option is a string that is inserted into the content of the markup. 8 This defaults to a single circumflex "!^" character (more commonly known as a caret), 9 surrounded by square brackets. The anchor element returned includes a "Top of Page" 10 title attribute so the user knows its purpose, and a "topofpage" class so the Wiki 11 author may style it in any way they please. 6 12 7 == Bugs/Feature Requests == 13 {{{ 14 [[Top]] becomes: 8 15 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 }}} 11 18 12 If you have any issues, create a 13 [http://trac-hacks.org/newticket?component=TopMacro&owner=dwclifton new ticket]. 19 You could of course achieve the same effect by doing this: 14 20 15 == Download == 21 {{{ 22 {{{ 23 #!html 24 [<a href="#" title="Top of page">^</a>] 25 }}} 26 }}} 16 27 17 Download the zipped source from [download:topmacro here]. 28 Resulting in this: 18 29 19 == Source == 30 {{{ 31 #!html 32 [<a href="#" title="Top of page">^</a>] 33 }}} 20 34 21 You can check out TopMacro from [http://trac-hacks.org/svn/topmacro here] using Subversion, or [source:topmacro browse the source] with Trac. 35 But who wants to do all that typing? 22 36 23 == Example == 37 That's what [http://en.wikipedia.org/wiki/Macro_(computer_science) macros] are for 38 after all. Note that the brackets do not form part of the anchor itself. That is a 39 personal preference. If you pass a string to the macro they are omitted. 24 40 41 == Styling == 42 43 If you like the caret, but prefer to omit the brackets and style the link yourself 44 with 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 59 Note that if you're going to style the anchor like this you should really pass an argument 60 to the macro or you'll end up with the default brackets in addition to the styling. 61 62 == Installation == 63 64 Download 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 66 the archive to a temporary location, visit the 0.11 directory and run: 67 68 {{{ 69 python setup.py bdist_egg 70 cp dist/*.egg /trac/env/Project/plugins 71 }}} 72 73 == Configuration == 74 75 Enable the macros in: 76 77 /trac/env/Project/conf/trac.ini: 78 79 {{{ 80 [components] 81 top.* = enabled 82 }}} 83 84 You may need to restart your Web server. 85 86 == Examples == 87 88 {{{ 25 89 [[Top]] 26 90 [[Top(^)]] 27 91 [[Top(top)]] 28 92 [[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 {{{ 100 git clone git@github.com:dwclifton/tractopmacro.git 101 }}} 102 103 == Bugs/Feature Requests == 104 105 Existing bugs and feature requests for TopMacro are [report:9?COMPONENT=TopMacro here]. 106 107 If you have any issues, create a [http://trac-hacks.org/newticket?component=TopMacro&owner=dwclifton new ticket]. 29 108 30 109 == Recent Changes == … … 35 114 36 115 '''Author:''' [wiki:dwclifton] [[BR]] 37 '''Contributors:''' 116 '''Contributors:''' The Python/Trac development community.