rename preprocessordirective to directive

Reasons include:
- easier to type
- might want postprocessor directives again sometime, and listdirectives
  can then use the directive/* files for either
- that it's done as a preprocessor step is an internal detail (and not a
  very accurate one, really :-)
master
Joey Hess 2008-08-25 14:19:39 -04:00
parent 9867806c13
commit d6fd1f1cc8
37 changed files with 78 additions and 58 deletions

View File

@ -13,7 +13,7 @@ It currently includes these pages:
* [[ikiwiki/markdown]]
* [[ikiwiki/openid]]
* [[ikiwiki/pagespec]]
* [[ikiwiki/PreprocessorDirective]]
* [[ikiwiki/directive]]
* [[ikiwiki/subpage]]
* [[ikiwiki/wikilink]]

View File

@ -16,7 +16,7 @@ reported in [[index/discussion#index11h1]].
> want multiple words.
>
> This was a decision I made a long time ago due to the ambiguity between a
> WikiLink and a [[ikiwiki/PreProcessorDirective]]. Is "\[[foo bar|baz]]" a wikilink to
> WikiLink and a [[ikiwiki/Directive]]. Is "\[[foo bar|baz]]" a wikilink to
> baz with a link text of "foo bar", or an instance of preprocessor
> directive "foo" with a parameter of "bar|baz"? If it's interpreted as a
> wikilink today, that could change tomorrow if a new preprocessor directive

View File

@ -1,6 +1,6 @@
In [[ikiwiki/markdown]] syntax, none of the other special characters get processed
inside a code block. However, in ikiwiki, [[wiki_links|ikiwiki/wikilink]] and
[[preprocessor_directives|ikiwiki/preprocessordirective]] still get processed
[[preprocessor_directives|ikiwiki/directive]] still get processed
inside a code block, requiring additional escaping. For example, `[links
don't work](#here)`, but `a [[ikiwiki/wikilink]] becomes HTML`. --[[JoshTriplett]]

View File

@ -32,7 +32,7 @@ Any page with a filename ending in ".mdwn" is converted from markdown to html
by ikiwiki. Markdown understands text formatted as it would be in an email,
and is quite smart about converting it to html. The only additional markup
provided by ikiwiki on top of regular markdown is the [[ikiwiki/WikiLink]] and
[[ikiwiki/PreprocessorDirective]].
the [[ikiwiki/directive]].
If you prefer to use some other markup language, ikiwiki allows others to
easily be added by [[plugins]]. For example it also supports traditional
@ -74,7 +74,7 @@ can change the look and layout of all pages in any way you would like.
Plugins can be used to add additional features to ikiwiki. The interface
is quite flexible, allowing plugins to implement additional markup
languages, register [[ikiwiki/PreProcessorDirective]]s, hook into [[CGI]] mode,
languages, register [[directives|ikiwiki/directive]], hook into [[CGI]] mode,
and more. Most of ikiwiki's features are actually provided by plugins.
Ikiwiki's backend RCS support is also pluggable, so support for new
revision control systems can be added to ikiwiki.

View File

@ -9,7 +9,7 @@ Some documentation on using ikiwiki:
* [[ikiwiki/formatting]]
* [[ikiwiki/blog]]
* [[ikiwiki/pagespec]]
* [[ikiwiki/PreprocessorDirective]]
* [[ikiwiki/directive]]
* [[ikiwiki/wikilink]]
* [[ikiwiki/markdown]]
* [[ikiwiki/subpage]]

View File

@ -7,7 +7,7 @@
then="You can"
else="If this wiki had the inline plugin enabled, you could"]]
turn any page on this wiki into a weblog by using the `inline`
[[PreProcessorDirective]]. For example:
[[directive]]. For example:
\[[!inline pages="blog/* and !*/Discussion" show="10" rootpage="blog"]]
@ -17,9 +17,9 @@ of them will appear in the page. Note that if files that are not pages
match the [[PageSpec]], they will be included in the feed using RSS
enclosures, which is useful for podcasting.
The optional `rootpage` parameter tells the wiki that new posts to this blog
should default to being [[SubPage]]s of "blog", and enables a form at the
top of the blog that can be used to add new items.
The optional `rootpage` parameter tells the wiki that new posts to this
blog should default to being [[SubPages|SubPage]] of "blog", and enables a
form at the top of the blog that can be used to add new items.
If you want your blog to have an archive page listing every post ever made
to it, you can accomplish that like this:

View File

@ -1,5 +1,5 @@
[[!meta robots="noindex, follow"]]
Preprocessor directives are similar to a [[WikiLink]] in form, except they
Directives are similar to a [[WikiLink]] in form, except they
begin with `!` and may contain parameters. The general form is:
\[[!directive param="value" param="value"]]
@ -12,7 +12,7 @@ Also, some directives may use parameters without values, for example:
\[[!tag foo]]
A preprocessor directive does not need to all be on one line, it can be
A directive does not need to all be on one line, it can be
wrapped to multiple lines if you like:
\[[!directive foo="baldersnatch"
@ -28,7 +28,7 @@ of text with triple-quotes:
3. "baz"
"""]]
ikiwiki also has an older syntax for preprocessor directives, which requires a
ikiwiki also has an older syntax for directives, which requires a
space in directives to distinguish them from [[wikilinks|wikilink]]. This
syntax has several disadvantages: it requires a space after directives with no
parameters (such as `\[[pagecount ]]`), and it prohibits spaces in

View File

@ -8,6 +8,6 @@ For documentation about the markdown syntax, see [[formatting]] and
[markdown mode](http://jblevins.org/projects/markdown-mode/) for
emacs can help in editing.
Note that [[WikiLink]]s and [[PreProcessorDirective]]s are not part of the
markdown syntax, and are the only bit of markup that this wiki handles
internally.
Note that [[WikiLinks|WikiLink]] and [[directives|directive]] are not part
of the markdown syntax, and are the only bit of markup that this wiki
handles internally.

View File

@ -23,11 +23,11 @@ page, but the link will appear like this: [[foo_bar|SandBox]].
To link to an anchor inside a page, you can use something like
`\[[WikiLink#foo]]`
## Preprocessor directives and wikilinks
## Directives and WikiLinks
ikiwiki has two syntaxes for
[[preprocessor_directives|PreprocessorDirective]]. The older syntax
used spaces to distinguish between preprocessor directives and
[[directives|directive]]. The older syntax
used spaces to distinguish between directives and
wikilinks; as a result, with that syntax in use, you cannot use spaces
in WikiLinks, and must replace spaces with underscores. The newer
syntax, enabled with the `prefix_directives` option in an ikiwiki

View File

@ -14,7 +14,7 @@ BTW, ikiwiki doesn't displays the #foo anchor in the example
--[[Paweł|ptecza]]
> No such syntax exists in markdown. ikiwiki could certainly have a
> [[preprocessor_directive|preprocessordirective]] for it, though.
> [[preprocessor_directive|directive]] for it, though.
> --[[JoshTriplett]]
>> [[!tag wishlist]]

View File

@ -12,5 +12,5 @@ wiki markup formats, so should be fairly easy to guess at. There is also a
[CheatSheet](http://www.wikicreole.org/wiki/CheatSheet).
Links are standard [[WikiLinks|ikiwiki/WikiLink]]. Links and
[[ikiwiki/PreProcessorDirectives]] inside `{{{ }}}` blocks are still expanded,
[[ikiwiki/directives]] inside `{{{ }}}` blocks are still expanded,
since this happens before the creole format is processed.

View File

@ -3,7 +3,7 @@
This plugin allows registering template pages, that provide default
content for new pages created using the web frontend. To register a
template, insert a [[Preprocessor_Directive|/ikiwiki/preprocessordirective]] on some other page.
template, insert a [[ikiwiki/directive]] on some other page.
\[[!edittemplate template="bugtemplate" match="bugs/*"]]

View File

@ -1,6 +1,6 @@
[[!template id=plugin name=inline core=1 author="[[Joey]]"]]
This is a [[ikiwiki/PreProcessorDirective]] that allows including one wiki page
This is a [[ikiwiki/directive]] that allows including one wiki page
inside another. For example:
\[[!inline pages="blog/*"]]

View File

@ -0,0 +1,11 @@
[[!template id=plugin name=listdirectives author="Will"]]
[[!tag type/meta]]
This plugin generates a list of available
[[directives|ikiwiki/directive]].
\[[!listdirectives]]
Each directive links to a wiki page with the same name. The location of the
pages in the wiki can be controlled via the `directive_description_dir`
setting in the setup file.

View File

@ -11,7 +11,7 @@ Now I've work-arounded it using apostrophes in another way
--[[Paweł|ptecza]]
> As with any other parameter in a [[ikiwiki/preprocessordirective]], you can
> As with any other parameter in a [[ikiwiki/directive]], you can
> triple-quote, and then include quotation marks inside. --[[Joey]]
>> Thanks for the hint! Toggle plugin is probably my favourite ikiwiki

View File

@ -1,7 +1,7 @@
[[!template id=plugin name=pagecount author="[[Joey]]"]]
[[!tag type/meta]]
Provides a \\[[!pagecount ]] [[ikiwiki/PreProcessorDirective]] that is
Provides a \\[[!pagecount ]] [[ikiwiki/directive]] that is
replaced with the total number of pages currently in the wiki.
The optional parameter "pages" can be a [[ikiwiki/PageSpec]] specifying the

View File

@ -11,7 +11,7 @@ ikiwiki. Limitations include:
* There are issues with inserting raw html into documents, as ikiwiki
does with [[WikiLinks|ikiwiki/WikiLink]] and many
[[PreprocessorDirectives|ikiwiki/PreprocessorDirective]].
preprocessor [[directives|ikiwiki/directive]].
So while you may find this useful for importing old files into your wiki,
using this as your main markup language in ikiwiki isn't recommended at

View File

@ -9,6 +9,6 @@ txt files is done; the file contents is displayed to the user as-is,
with html markup characters such as ">" escaped.
The only exceptions are that [[WikiLinks|WikiLink]] and
[[PreprocessorDirectives|PreprocessorDirective]] are still expanded by
[[directives|directive]] are still expanded by
ikiwiki, and that, if the [[!cpan URI::Find]] perl module is installed, URLs
in the txt file are converted to hyperlinks.

View File

@ -123,7 +123,7 @@ make arbitrary changes. The function is passed named parameters "page",
### preprocess
Adding a [[ikiwiki/PreProcessorDirective]] is probably the most common use
Adding a preprocessor [[ikiwiki/directive]] is probably the most common use
of a plugin.
hook(type => "preprocess", id => "foo", call => \&preprocess);
@ -158,7 +158,7 @@ can assume it's being run in scan mode, and avoid doing expensive things at
that point.)
Note that if the [[htmlscrubber]] is enabled, html in
[[ikiwiki/PreProcessorDirective]] output is sanitised, which may limit what
preprocessor [[ikiwiki/directive]] output is sanitised, which may limit what
your plugin can do. Also, the rest of the page content is not in html
format at preprocessor time. Text output by a preprocessor directive will
be linkified and passed through markdown (or whatever engine is used to
@ -500,7 +500,7 @@ function that is called after the error message is printed, to do any final
cleanup.
If called inside a preprocess hook, error() does not abort the entire
wiki build, but instead replaces the [[ikiwiki/PreProcessorDirective]] with
wiki build, but instead replaces the preprocessor [[ikiwiki/directive]] with
a version containing the error message.
In other hooks, error() is a fatal error, so use with care. Try to avoid

View File

@ -5,9 +5,9 @@ What should the plugin do? Let's make it calculate and output the Fibonacci
sequence. To output the next number in the sequence, all a user has to do
is write this on a wiki page:
[[!fib ]]
[[!fib]]
When the page is built, the [[ikiwiki/PreProcessorDirective]] will be
When the page is built, the [[ikiwiki/directive]] will be
replaced by the next number in the sequence.
Most of ikiwiki's plugins are written in Perl, and it's currently easiest
@ -39,16 +39,16 @@ register hooks that ikiwiki will call later.
}
This has hooked our plugin into the preprocess hook, which ikiwiki uses to
expand [[PreprocessorDirectives|ikiwiki/preprocessordirective]]. Notice
expand preprocessor [[directives|ikiwiki/directive]]. Notice
that "fib" has shown up again. It doesn't actually have to match the module
name this time, but it generally will. This "fib" is telling ikiwiki what
kind of PreprocessorDirective to handle, namely one that looks like this:
kind of preprocessor directive to handle, namely one that looks like this:
[[!fib ]]
Notice the `\&preprocess`? This is how you pass a reference to a function,
and the `preprocess` function is the one that ikiwiki will call to expand
the PreprocessorDirective. So, time to write that function:
the preprocessor directive. So, time to write that function:
sub preprocess {
my %params=@_;

View File

@ -61,13 +61,13 @@ This page controls what shortcut links the wiki supports.
* [[!shortcut name=ohloh url="http://www.ohloh.net/projects/%s"]]
To add a new shortcut, use the `shortcut`
[[ikiwiki/PreprocessorDirective]]. In the url, "%s" is replaced with the
[[ikiwiki/directive]]. In the url, "%s" is replaced with the
text passed to the named shortcut, after url-encoding it, and '%S' is
replaced with the raw, non-encoded text. The optional `desc` parameter
controls the description of the link.
Remember that the `name` you give the shortcut will become a new
[[ikiwiki/PreprocessorDirective]]. Avoid using a `name` that conflicts
[[ikiwiki/directive]]. Avoid using a `name` that conflicts
with an existing directive. These directives also accept a `desc`
parameter that will override the one provided at definition time.

View File

@ -412,3 +412,5 @@ This is what I was using for `preprocessor-description.tmpl`:
The <TMPL_VAR plugin> preprocessor command currently has no description.
Maybe you should edit this page to add one.
[[tag done]]

View File

@ -25,7 +25,7 @@ include an `else` clause; if so, you could label the text used if true as
`then`.
Syntax could vary greatly here, both for the
[[ikiwiki/PreprocessorDirective]] and for the condition itself.
[[ikiwiki/Directive]] and for the condition itself.
> I think this is a good thing to consider, although conditionals tend to
> make everything a lot more complicated, so I also want to KISS, and not
@ -57,7 +57,7 @@ Syntax could vary greatly here, both for the
> --[[Joey]]
>> [[ikiwiki/PageSpec]] syntax seems perfect, and your proposed syntax for the `if`
>> [[ikiwiki/PreprocessorDirective]] looks fine to me.
>> [[ikiwiki/Directive]] looks fine to me.
>>
>> [[ikiwiki/PageSpec]]s don't give you `none` for free, since `!foo/*` as a boolean
>> would mean "does any page not matching `foo/*` exist", not "does `foo/*`

View File

@ -219,7 +219,7 @@ Index: doc/plugins/rst.mdwn
-* reStructuredText does not allow raw html to be inserted into
- documents, but ikiwiki does so in many cases, including
- [[WikiLinks|ikiwiki/WikiLink]] and many
- [[PreprocessorDirectives|ikiwiki/PreprocessorDirective]].
- [[Directives|ikiwiki/Directive]].
+* Some bits of ikiwiki may still assume that markdown is used or embed html
+ in ways that break reStructuredText. (Report bugs if you find any.)
* It's slow; it forks a copy of python for each page. While there is a

View File

@ -1,5 +1,5 @@
How about a plugin providing a
[[preprocessor_directive|ikiwiki/preprocessordirective]] to render a
[[preprocessor_directive|ikiwiki/directive]] to render a
[[!debpkg graphviz]] file as an image via one of the graphviz programs
("dot" by default) and include the resulting image on the page, using the
"cmapx" image map format? graphviz files themselves could also render the

View File

@ -31,8 +31,8 @@
Because [ [inlinepage] ] isn't separated by a blank line it gets treated as a block-level element. Hmm, will this stop all formatting, including *'s to em-tags? --[[JeroenSchot]]
Ah didn't realize you meant it fixed it at the markdown level. I'll
think about making postprocessordirectives into
[[ikiwiki/preprocessordirective]]s instead, then I could use that fix (but I'm not
think about making postprocessor directives into
preprocessor directives instead, then I could use that fix (but I'm not
sure how feasible it is to do that). --[[Joey]]
Done.. inlining is now a preprocessor directive, happens before

View File

@ -1,5 +1,5 @@
How about a plugin adding a
[[preprocessor_directive|ikiwiki/preprocessordirective]] to render some given LaTeX
[[preprocessor_directive|ikiwiki/directive]] to render some given LaTeX
and include it in the page? This could either render the LaTeX as a PNG via
[[!debpkg dvipng]] and include the resulting image in the page, or perhaps
render via [HeVeA](http://pauillac.inria.fr/~maranget/hevea/index.html),

View File

@ -2,15 +2,15 @@ Pages could have a `linktitle` (perhaps via [[plugins/meta]]), and
[[wikilinks|ikiwiki/wikilink]] could use that title by default when linking
to the page. That would allow pages to have a simple, easily linkable name
(without spaces, for instance), but use the proper title for links. For
example, [[ikiwiki/PreprocessorDirective]] could use the `linktitle`
example, [[ikiwiki/Directive]] could use the `linktitle`
"preprocessor directive", and pages for [[users]] could have `linktitle`s
that put spaces in their names.
Ideally, perhaps two versions of the title could exist, one for general
use, and an optional one for if the case in the actual link starts with an
uppercase letter. That would allow [[ikiwiki/preprocessordirective]] to
uppercase letter. That would allow [[ikiwiki/directive]] to
use the link text "preprocessor directive", but
[[ikiwiki/PreprocessorDirective]] to use the link text "Preprocessor
[[ikiwiki/Directive]] to use the link text "Preprocessor
Directive", for use at the beginnings of sentences. If the second version
did not exist, the first version would apply to both cases. However, that
also seems like potential overkill, and less important than the basic

View File

@ -1,5 +1,5 @@
Might be nice to support automatically generating an index based on headers
in a page, for long pages. This could be done as a sanitize hook that
parsed the html, with a preprocessordirective that controlled it.
parsed the html, with a directive that controlled it.
[[todo/done]]

View File

@ -7,7 +7,7 @@ which can't be made through the web interface:
Of course in these cases, you can add your request to a discussion page
and wait for someone with the access/confidence to apply them.
Maybe this can be enhanced with a [[ikiwiki/PreprocessorDirective]]:
Maybe this can be enhanced with a [[ikiwiki/Directive]]:
<pre>
\[[!suggest op=merge dstfile=trunk srcfile=branches/jk oldrev=1234 newrev=1342]]

View File

@ -209,7 +209,7 @@ Here is a potential documentation page:
[[!template id=plugin name=progress author="[[Will]]"]]
[[!tag type/meta]]
Provides a \\[[!progress ]] [[ikiwiki/PreProcessorDirective]] that is
Provides a \\[[!progress ]] [[ikiwiki/Directive]] that is
replaced with a progress bar.
There are two possible parameter sets. The first is a single parameter

View File

@ -18,7 +18,7 @@ A few pointers and I might be able to implement this myself. -- JamesWestby
> Now, the description field currently defaults to the wiki name,
> and that could indeed stand to be made configurable. Since the
> current (svn) version of ikiwiki supports long, word-wrapped
> blocks of text as parameters to [[ikiwiki/PreProcessorDirective]]s, seems
> blocks of text as parameters to [[ikiwiki/Directive]]s, seems
> to me the best way would be to simple modify inline.pm to make the
> descripion configurable by such parameter, with a fallback to the
> wiki name. You'll need to modify rsspage.tmpl to use whatever new

View File

@ -1,4 +1,4 @@
[[plugins/shortcut]] creates link shortcut [[ikiwiki/PreprocessorDirective]]s,
[[plugins/shortcut]] creates link shortcut [[ikiwiki/Directive]]s,
which substitute their argument into the specified shortcut URL to generate
the link target, and use the argument as the link text. For example, given
the example [[shortcuts]], `\[[!wikipedia ikiwiki]]` generates a link to

View File

@ -1,11 +1,11 @@
Several [[ikiwiki/PreprocessorDirective]]s take ikiwiki-formatted text as arguments,
Several [[ikiwiki/Directive]]s take ikiwiki-formatted text as arguments,
such as the `then` and `else` arguments of the new `if` directive, or the
`desc` argument of the `shortcut` directive. However, smileys do not work in
these arguments.
Since the arguments to [[ikiwiki/PreprocessorDirective]]s might use the same syntax as
Since the arguments to [[ikiwiki/Directive]]s might use the same syntax as
smileys for a different meaning, smiley substitution should not happen until
after [[ikiwiki/PreprocessorDirective]]s.
after [[ikiwiki/Directive]]s.
--[[JoshTriplett]]

View File

@ -0,0 +1 @@
../../../doc/ikiwiki/directive.mdwn

View File

@ -1 +0,0 @@
../../../doc/ikiwiki/preprocessordirective.mdwn

View File

@ -0,0 +1,7 @@
[[!meta redir=ikiwiki/directive delay=10]]
[[!meta robots="noindex, follow"]]
This page has moved to
[[ikiwiki/directive|ikiwiki/directive]]. Please
update your links, as this redirection page will be removed in a future
ikiwiki release.

View File

@ -1,7 +1,7 @@
[[!meta redir=ikiwiki/preprocessordirective delay=10]]
[[!meta redir=ikiwiki/directive delay=10]]
[[!meta robots="noindex, follow"]]
This page has moved to
[[ikiwiki/preprocessordirective|ikiwiki/preprocessordirective]]. Please
[[ikiwiki/directive|ikiwiki/directive]]. Please
update your links, as this redirection page will be removed in a future
ikiwiki release.