= !TopMacro =
TopMacro is exceedingly simple, like all good software ;-). In a nutshell, it
does exactly what you'd expect, 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. This
defaults to a single circumflex "!^" character (more commonly known as a caret),
surrounded by square brackets. The anchor element returned includes a "Top of Page"
title attribute so the user knows its purpose, and a "topofpage" class so the
Wiki author may apply their preferred style rules.
You could of course achieve the same effect by doing this:
Resulting in this:
But who wants to do all that typing?
That's what [http://en.wikipedia.org/wiki/Macro_(computer_science) macros] are for
after all. Note that the brackets do not form part of the anchor itself. That is a
personal preference. If you pass a string to the macro they are omitted.
== Styling ==
If you like the caret, but prefer to omit the brackets and style the link yourself
with CSS, try something like this:
font-family: 'BitStream Vera Sans',Verdana,Arial,Helvetica,sans-serif;
padding: 1px 2px 2px;
border: 1px solid #c6c7db;
Note that if you're going to style the anchor like this you should really pass an argument
to the macro or you'll end up with the default brackets in addition to the styling.
== Installation ==
Download the zipped source from [/raw-attachment/wiki/TopMacro/topmacro.zip here] or on
[http://trac-hacks.org/attachment/wiki/TopMacro/topmacro.zip?format=raw Trac Hacks]. Unzip
the archive to a temporary location, visit the 0.11 directory and run:
python setup.py bdist_egg
cp dist/*.egg /trac/env/Project/plugins
== Configuration ==
Enable the macro in:
top.* = enabled
You may need to restart your Web server.
== Examples ==
[[Top(Top of page)]]
== Source ==
* Browse the source at: [http://github.com/dwclifton/tractopmacro/tree/master/0.11 GitHub].
* Public clone URL:
git clone email@example.com:dwclifton/tractopmacro.git