Edgewall Software

Changes between Version 64 and Version 65 of MacroBazaar


Ignore:
Timestamp:
Mar 13, 2005, 2:34:39 AM (19 years ago)
Author:
Matthew Good <trac matt-good net>
Comment:

start organizing macros into categories

Legend:

Unmodified
Added
Removed
Modified
  • MacroBazaar

    v64 v65  
    55
    66'''Note:''' ''Please state your name, email, and version of Trac your macro is developed for.''
     7
     8== Categories ==
     9
     10 * [wiki:MacroBazaar#Examples Examples]
     11 * [wiki:MacroBazaar#Includes Includes]
     12 * [wiki:MacroBazaar#SiteNavigation Site Navigation]
     13 * [wiki:MacroBazaar#TimeDate Time & Date]
     14 * [wiki:MacroBazaar#Miscellaneous Miscellaneous]
     15 * [wiki:MacroBazaar#Uncategorized Uncategorized]
     16
     17== Examples ==
    718
    819=== HelloWorld ===
     
    1122[[BR]]''By:'' TracTeam   --    ''Ver:'' >0.5.2
    1223
    13 === Timestamp ===
    14 Inserts current date and time. Distributed with Trac.
    15 [[BR]]''Download:'' source:trunk/trac/wikimacros/Timestamp.py
    16 [[BR]]''By:'' TracTeam   --    ''Ver:'' >0.5.2
     24----
     25
     26== Includes ==
    1727
    1828=== include ===
     
    6373''By:'' Toni Brkic  toni.brkic at switchcore.com --    ''Required ver'' patch for #801 must be implemented
    6474
     75----
     76
     77== Site Navigation ==
     78
     79=== BackLinks ===
     80First stab at a macro that displays all wiki pages linking to a specified page name.
     81
     82Usage:
     83
     84{{{
     85[[BackLinks(pagename)]]
     86}}}
     87
     88I'd really like it to default to displaying backlinks to the current page when a page name isn't supplied, but, um, I have no idea how to do that. Suggestions greatly appreciated.
     89[[BR]]
     90''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/BackLinks.py
     91[[BR]]''By:'' Dan Hon <danhon+trac@gmail.com> -- ''Ver.'' >= 0.7.1
     92
     93Dan, here's an idea.
     94{{{
     95thispage = hdf.getValue('wiki.page_name', '')
     96}}}
     97
     98''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/BackLinks.2.py patches the wikimacro to default to display backlinks to the current page if a page name is not specified.
     99[[BR]]''By:'' Muness Alrubaie <muness@gmail.com> -- ''Ver.'' >= 0.8
     100
     101Well, both those seem to have a bug: they will list pages for which at least one version linked to thispage, rather than just the latest version. So here's a fixed macro.
     102
     103''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/BackLinks3.py patches the wikimacro to display only pages where the latest version links to the specified or current page.
     104[[BR]]
     105''By:'' Andrew Durdin <adurdin at gmail.com> -- ''Ver.'' >= 0.8
     106[[BR]]
     107''Notes:'' An outstanding issue with these macros is that it incorrectly registers links from pages where their titles appear like !CamelCase (i.e. not a link) or where the name (not a TracLink-style name) is used legitimately in a different context (e.g. a page named 'History' would show backlinks to any other pages with the word 'History' in them).
     108
     109=== SubWiki ===
     110
     111Derived from TitleIndex.  Returns a list of sub-wiki entries.  A sub-wiki page is a page that is is deeper in the hierarchy than the current page.  e.g. if the current page is People, this will return a list of all wiki entries that start with "People/"
     112
     113''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/SubWiki.py
     114[[BR]]''Version:'' >= 0.8
     115[[BR]]''By:'' Muness Alrubaie <muness@gmail.com>
     116
     117A different version that lists the contents of the line specified in the second parameter next to the the link.
     118
     119[[BR]]''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/SubWiki.2.py
     120[[BR]]''By:'' csawyer@yumaed.org   --    ''Ver:'' 0.8
     121
     122A different version that lists the contents of the first heading element next to the link.  The second parameter specifies the number of levels to display.  Based on the version by csawyer@yumaed.org.
     123
     124[[BR]]''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/SubWiki.3.py
     125[[BR]]''By:'' muness@gmail.com   --    ''Ver:'' 0.8
     126
     127
     128=== ParentWiki ===
     129
     130Inserts a link to the "parent" wiki entry.  This only applies to wikis that have a "/" in their name indicating hierarchy.  e.g. an entry named Java/Introduction will have a parent of Java.  All other wiki entries have a parent of WikiStart.
     131
     132''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/ParentWiki.py
     133[[BR]]''Version:'' >= 0.8
     134[[BR]]''By:'' Muness Alrubaie <muness@gmail.com>
     135
     136=== ShowPath ===
     137
     138Show the path to the specified wiki or the current wiki if none is specified.  This is similar to the directory names at the top of the TracBrowser.  This applies mainly to hierarchical wiki entries.  e.g. the path to a {{{Book/Chapter/Section/Subsection}}} would be {{{WikiStart/Book/Chapter/Section/Subsection}}} (all but the current would be linked).
     139
     140''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/ShowPath.py
     141[[BR]]''Version:'' >= 0.8
     142[[BR]]''By:'' Muness Alrubaie <muness@gmail.com>
     143
     144----
     145
     146== Time & Date ==
     147
     148=== Timestamp ===
     149Inserts current date and time. Distributed with Trac.
     150[[BR]]''Download:'' source:trunk/trac/wikimacros/Timestamp.py
     151[[BR]]''By:'' TracTeam   --    ''Ver:'' >0.5.2
     152
     153=== DateOffset ===
     154
     155Returns the date referred to as follows:
     156 * First arg is the offset, i.e. the date to start from
     157 * Second arg is the multiplier to multiply the count by (e.g. 7 for a week)
     158 * Third arg is the count (i.e. the number of additions to make).
     159
     160So, for example:
     161 * {{{ [[DateOffset(2005/01/05,7,0)]] }}} returns Wed Jan 05
     162 * {{{ [[DateOffset(2005/01/05,7,4)]] }}} returns Wed Feb 02
     163
     164You can also configure the input and output date formats. (See http://python.org/doc/2.3.4/lib/module-time.html).  e.g.:
     165 * {{{ [[DateOffset(01/05/2005,7,0,%m/%d/%Y,%A %B %d)]] }}} returns Wednesday January 05
     166
     167Please email me fixes and excuse any obvious errors: I've never written any python before this.
     168
     169''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/DateOffset.py
     170[[BR]]''Version:'' >= 0.8
     171[[BR]]''By:'' Muness Alrubaie <muness@gmail.com>
     172
     173----
     174
     175== Miscellaneous ==
    65176
    66177=== Javadoc ===
    67 Creates links to Javadoc pages based on a package or fully-qualified class name. 
     178Creates links to Javadoc pages based on a package or fully-qualified class name.
    68179
    69180Example usage:
     
    78189''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/javadoc.py
    79190[[BR]]''By:'' Matthew Good <matt-good.net>   --    ''Ver:'' >=0.7.1
     191
     192----
     193
     194== Uncategorized ==
    80195
    81196=== UserChanges ===
     
    91206[[BR]]''By:'' David Mohr <datrac@mcbf.net> -- ''Ver.'' >= 0.7.1
    92207
    93 === BackLinks ===
    94 First stab at a macro that displays all wiki pages linking to a specified page name.
    95 
    96 Usage:
    97 
    98 {{{
    99 [[BackLinks(pagename)]]
    100 }}}
    101 
    102 I'd really like it to default to displaying backlinks to the current page when a page name isn't supplied, but, um, I have no idea how to do that. Suggestions greatly appreciated.
    103 [[BR]]
    104 ''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/BackLinks.py
    105 [[BR]]''By:'' Dan Hon <danhon+trac@gmail.com> -- ''Ver.'' >= 0.7.1
    106 
    107 Dan, here's an idea.
    108 {{{
    109 thispage = hdf.getValue('wiki.page_name', '')
    110 }}}
    111 
    112 ''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/BackLinks.2.py patches the wikimacro to default to display backlinks to the current page if a page name is not specified.
    113 [[BR]]''By:'' Muness Alrubaie <muness@gmail.com> -- ''Ver.'' >= 0.8
    114 
    115 Well, both those seem to have a bug: they will list pages for which at least one version linked to thispage, rather than just the latest version. So here's a fixed macro.
    116 
    117 ''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/BackLinks3.py patches the wikimacro to display only pages where the latest version links to the specified or current page.
    118 [[BR]]
    119 ''By:'' Andrew Durdin <adurdin at gmail.com> -- ''Ver.'' >= 0.8
    120 [[BR]]
    121 ''Notes:'' An outstanding issue with these macros is that it incorrectly registers links from pages where their titles appear like !CamelCase (i.e. not a link) or where the name (not a TracLink-style name) is used legitimately in a different context (e.g. a page named 'History' would show backlinks to any other pages with the word 'History' in them).
    122 
    123 
    124208=== TracPoll ===
    125209
     
    231315''By:'' Simon Stapleton <simon@tufty.co.uk>
    232316
    233 === DateOffset ===
    234 
    235 Returns the date referred to as follows:
    236  * First arg is the offset, i.e. the date to start from
    237  * Second arg is the multiplier to multiply the count by (e.g. 7 for a week)
    238  * Third arg is the count (i.e. the number of additions to make).
    239 
    240 So, for example:
    241  * {{{ [[DateOffset(2005/01/05,7,0)]] }}} returns Wed Jan 05
    242  * {{{ [[DateOffset(2005/01/05,7,4)]] }}} returns Wed Feb 02
    243 
    244 You can also configure the input and output date formats. (See http://python.org/doc/2.3.4/lib/module-time.html).  e.g.:
    245  * {{{ [[DateOffset(01/05/2005,7,0,%m/%d/%Y,%A %B %d)]] }}} returns Wednesday January 05
    246 
    247 Please email me fixes and excuse any obvious errors: I've never written any python before this.
    248 
    249 ''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/DateOffset.py
    250 [[BR]]''Version:'' >= 0.8
    251 [[BR]]''By:'' Muness Alrubaie <muness@gmail.com>
    252 
    253 
    254 === SubWiki ===
    255 
    256 Derived from TitleIndex.  Returns a list of sub-wiki entries.  A sub-wiki page is a page that is is deeper in the hierarchy than the current page.  e.g. if the current page is People, this will return a list of all wiki entries that start with "People/"
    257 
    258 ''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/SubWiki.py
    259 [[BR]]''Version:'' >= 0.8
    260 [[BR]]''By:'' Muness Alrubaie <muness@gmail.com>
    261 
    262 A different version that lists the contents of the line specified in the second parameter next to the the link.
    263 
    264 [[BR]]''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/SubWiki.2.py
    265 [[BR]]''By:'' csawyer@yumaed.org   --    ''Ver:'' 0.8
    266 
    267 A different version that lists the contents of the first heading element next to the link.  The second parameter specifies the number of levels to display.  Based on the version by csawyer@yumaed.org.
    268 
    269 [[BR]]''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/SubWiki.3.py
    270 [[BR]]''By:'' muness@gmail.com   --    ''Ver:'' 0.8
    271 
    272 
    273 === ParentWiki ===
    274 
    275 Inserts a link to the "parent" wiki entry.  This only applies to wikis that have a "/" in their name indicating hierarchy.  e.g. an entry named Java/Introduction will have a parent of Java.  All other wiki entries have a parent of WikiStart.
    276 
    277 ''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/ParentWiki.py
    278 [[BR]]''Version:'' >= 0.8
    279 [[BR]]''By:'' Muness Alrubaie <muness@gmail.com>
    280 
    281 === ShowPath ===
    282 
    283 Show the path to the specified wiki or the current wiki if none is specified.  This is similar to the directory names at the top of the TracBrowser.  This applies mainly to hierarchical wiki entries.  e.g. the path to a {{{Book/Chapter/Section/Subsection}}} would be {{{WikiStart/Book/Chapter/Section/Subsection}}} (all but the current would be linked).
    284 
    285 ''Download:'' http://projects.edgewall.com/trac/attachment/wiki/MacroBazaar/ShowPath.py
    286 [[BR]]''Version:'' >= 0.8
    287 [[BR]]''By:'' Muness Alrubaie <muness@gmail.com>
    288 
    289317
    290318=== Search ===