CGI-Wiki-Formatter-UseMod
view release on metacpan or search on metacpan
0.04 14 May 2003
->node_name_to_node_param method now takes notice of the
force_ucfirst_nodes attribute.
0.03 28 April 2003
Subs in macros are now called with up to nine arguments. I know this
is a bit arbitrary, but I now need it to support two arguments and I
might as well allow a few more while I'm at it.
0.02 5 April 2003
Macros can now substitute the output of subs as well as plain strings.
0.01 3 March 2003
Initial release.
http://example.com/wiki.cgi?Mailing_List_Managers
rather than
http://example.com/wiki.cgi?Mailing%20List%20Managers
The former behaviour is the actual UseMod behaviour, but
requires a little fiddling about in your code (see
"node_name_to_node_param"), so the default is to not munge URLs.
Macros
Be aware that macros are processed *after* filtering out
disallowed HTML tags and *before* transforming from wiki markup
into HTML. They are also not called in any particular order.
The keys of macros should be either regexes or strings. The
values can be strings, or, if the corresponding key is a regex,
can be coderefs. The coderef will be called with the first nine
substrings captured by the regex as arguments. I would like to
call it with all captured substrings but apparently this is
complicated.
* Pass a true value in the "pass_wiki_to_macros" parameter
when calling "->new".
If you do this, then *all* coderefs will be called with the wiki
object as the first parameter, followed by the first nine
captured substrings as described above. Note therefore that
setting "pass_wiki_to_macros" may cause backwards compatibility
issues.
Macro examples:
# Simple example - substitute a little search box for '@SEARCHBOX'
macros => {
'@SEARCHBOX' =>
qq(<form action="wiki.pl" method="get">
<input type="hidden" name="action" value="search">
<input type="text" size="20" name="terms">
<input type="submit"></form>),
An internal method exposed to make it easy to go from eg
* Foo
* Bar
to
* <a href="index.cgi?Foo">Foo</a>
* <a href="index.cgi?Bar">Bar</a>
See Macro Examples above for why you might find this useful.
"link" should be something that would go inside your extended link
delimiters. "wiki" is optional but should be a CGI::Wiki object. If
you do supply "wiki" then the method will be able to check whether
the node exists yet or not and so will call "->make_edit_link"
instead of "->make_internal_link" where appropriate. If you don't
supply "wiki" then "->make_internal_link" will be called always.
This method used to be private so may do unexpected things if you
use it in a way that I haven't tested yet.
lib/CGI/Wiki/Formatter/UseMod.pm view on Meta::CPAN
http://example.com/wiki.cgi?Mailing_List_Managers
rather than
http://example.com/wiki.cgi?Mailing%20List%20Managers
The former behaviour is the actual UseMod behaviour, but requires a
little fiddling about in your code (see C<node_name_to_node_param>),
so the default is to B<not> munge URLs.
=item B<Macros>
Be aware that macros are processed I<after> filtering out disallowed
HTML tags and I<before> transforming from wiki markup into HTML. They
are also not called in any particular order.
The keys of macros should be either regexes or strings. The values can
be strings, or, if the corresponding key is a regex, can be coderefs.
The coderef will be called with the first nine substrings captured by
the regex as arguments. I would like to call it with all captured
substrings but apparently this is complicated.
lib/CGI/Wiki/Formatter/UseMod.pm view on Meta::CPAN
=back
If you do this, then I<all> coderefs will be called with the wiki object
as the first parameter, followed by the first nine captured substrings
as described above. Note therefore that setting C<pass_wiki_to_macros>
may cause backwards compatibility issues.
=back
Macro examples:
# Simple example - substitute a little search box for '@SEARCHBOX'
macros => {
'@SEARCHBOX' =>
qq(<form action="wiki.pl" method="get">
<input type="hidden" name="action" value="search">
<input type="text" size="20" name="terms">
<input type="submit"></form>),
lib/CGI/Wiki/Formatter/UseMod.pm view on Meta::CPAN
An internal method exposed to make it easy to go from eg
* Foo
* Bar
to
* <a href="index.cgi?Foo">Foo</a>
* <a href="index.cgi?Bar">Bar</a>
See Macro Examples above for why you might find this useful.
C<link> should be something that would go inside your extended link
delimiters. C<wiki> is optional but should be a L<CGI::Wiki> object.
If you do supply C<wiki> then the method will be able to check whether
the node exists yet or not and so will call C<< ->make_edit_link >>
instead of C<< ->make_internal_link >> where appropriate. If you don't
supply C<wiki> then C<< ->make_internal_link >> will be called always.
This method used to be private so may do unexpected things if you use
it in a way that I haven't tested yet.
( run in 0.608 second using v1.01-cache-2.11-cpan-49f99fa48dc )