This hook is used to inject C code (which it returns) into the `main`
function of the ikiwiki wrapper when it is being generated.
This hook is used to inject C code (which it returns) into the `main`
function of the ikiwiki wrapper when it is being generated.
A plugin can access the wiki's configuration via the `%config`
hash. The best way to understand the contents of the hash is to look at
your ikiwiki setup file, which sets the hash content to configure the wiki.
A plugin can access the wiki's configuration via the `%config`
hash. The best way to understand the contents of the hash is to look at
your ikiwiki setup file, which sets the hash content to configure the wiki.
The `%pagestate` hash can be used by plugins to save state that they will need
next time ikiwiki is run. The hash holds per-page state, so to set a value,
The `%pagestate` hash can be used by plugins to save state that they will need
next time ikiwiki is run. The hash holds per-page state, so to set a value,
The `%wikistate` hash can be used by a plugin to store persistant state
that is not bound to any one page. To set a value, use
The `%wikistate` hash can be used by a plugin to store persistant state
that is not bound to any one page. To set a value, use
"id" parameter passed to `hook()` when registering the plugin, so that the
state can be dropped if the plugin is no longer used.
"id" parameter passed to `hook()` when registering the plugin, so that the
state can be dropped if the plugin is no longer used.
The `%links` hash can be used to look up the names of each page that
a page links to. The name of the page is the key; the value is an array
reference. Do not modify this hash directly; call `add_link()`.
The `%links` hash can be used to look up the names of each page that
a page links to. The name of the page is the key; the value is an array
reference. Do not modify this hash directly; call `add_link()`.
The `%destsources` hash records the name of the source file used to
create each destination file. The key is the output filename (ie,
The `%destsources` hash records the name of the source file used to
create each destination file. The key is the output filename (ie,
from (eg, "foo.mdwn"). Note that a single source file may create multiple
destination files. Do not modify this hash directly; call `will_render()`.
from (eg, "foo.mdwn"). Note that a single source file may create multiple
destination files. Do not modify this hash directly; call `will_render()`.
The `%pagesources` has can be used to look up the source filename
of a page. So the key is the page name, and the value is the source
filename. Do not modify this hash.
The `%pagesources` has can be used to look up the source filename
of a page. So the key is the page name, and the value is the source
filename. Do not modify this hash.
will not override any existing hook with the same id. This is useful if
the id can be controled by the user.
will not override any existing hook with the same id. This is useful if
the id can be controled by the user.
Aborts with an error message. If the second parameter is passed, it is a
function that is called after the error message is printed, to do any final
Aborts with an error message. If the second parameter is passed, it is a
function that is called after the error message is printed, to do any final
dying on bad input when building a page, as that will halt
the entire wiki build and make the wiki unusable.
dying on bad input when building a page, as that will halt
the entire wiki build and make the wiki unusable.
Creates and returns a [[!cpan HTML::Template]] object. The first parameter
is the name of the file in the template directory. The optional remaining
parameters are passed to `HTML::Template->new`.
Creates and returns a [[!cpan HTML::Template]] object. The first parameter
is the name of the file in the template directory. The optional remaining
parameters are passed to `HTML::Template->new`.
Passed a page name, returns the base name that will be used for a the html
page created from it. (Ie, it appends ".html".)
Passed a page name, returns the base name that will be used for a the html
page created from it. (Ie, it appends ".html".)
Use this when constructing the filename of a html file. Use `urlto` when
generating a link to a page.
Use this when constructing the filename of a html file. Use `urlto` when
generating a link to a page.
Passed a page name, and [[ikiwiki/PageSpec]], returns a list of pages
in the wiki that match the [[ikiwiki/PageSpec]].
Passed a page name, and [[ikiwiki/PageSpec]], returns a list of pages
in the wiki that match the [[ikiwiki/PageSpec]].
PageSpec should match against. If not passed, relative PageSpecs will match
relative to the top of the wiki.
PageSpec should match against. If not passed, relative PageSpecs will match
relative to the top of the wiki.
Use this function to generate ikiwiki's internal representation of a
dependency type from one or more of these keywords:
Use this function to generate ikiwiki's internal representation of a
dependency type from one or more of these keywords:
Given a filename, a directory to put it in, and the file's content,
writes a file.
Given a filename, a directory to put it in, and the file's content,
writes a file.
Given a page name and a destination file name (not including the base
destination directory), register that the page will result in that file
Given a page name and a destination file name (not including the base
destination directory), register that the page will result in that file
the page that rendered them goes away or is changed to no longer render
them. will_render also does a few important security checks.
the page that rendered them goes away or is changed to no longer render
them. will_render also does a few important security checks.
Given the name of a source file, returns the type of page it is, if it's
a type that ikiwiki knowns how to htmlize. Otherwise, returns undef.
Given the name of a source file, returns the type of page it is, if it's
a type that ikiwiki knowns how to htmlize. Otherwise, returns undef.
Given the name of a source file, returns the name of the wiki page
that corresponds to that file.
Given the name of a source file, returns the name of the wiki page
that corresponds to that file.
Give the name of a wiki page, returns a version suitable to be displayed as
the page's title. This is accomplished by de-escaping escaped characters in
the page name. "_" is replaced with a space, and '__NN__' is replaced by
the UTF character with code NN.
Give the name of a wiki page, returns a version suitable to be displayed as
the page's title. This is accomplished by de-escaping escaped characters in
the page name. "_" is replaced with a space, and '__NN__' is replaced by
the UTF character with code NN.
This converts text that could have been entered by the user as a
[[ikiwiki/WikiLink]] into a wiki page name.
This converts text that could have been entered by the user as a
[[ikiwiki/WikiLink]] into a wiki page name.
Given the name of a source file in the wiki, searches for the file in
the source directory and the underlay directories (most recently added
Given the name of a source file in the wiki, searches for the file in
the source directory and the underlay directories (most recently added
If the directory name is not absolute, ikiwiki will assume it is in
the parent directory of the configured underlaydir.
If the directory name is not absolute, ikiwiki will assume it is in
the parent directory of the configured underlaydir.
Given a time, formats it for display.
The optional second parameter is a strftime format to use to format the
time.
Given a time, formats it for display.
The optional second parameter is a strftime format to use to format the
time.
Construct a relative url to the first parameter from the page named by the
second. The first parameter can be either a page name, or some other
Construct a relative url to the first parameter from the page named by the
second. The first parameter can be either a page name, or some other
If the third parameter is passed and is true, an absolute url will be
constructed instead of the default relative url.
If the third parameter is passed and is true, an absolute url will be
constructed instead of the default relative url.
This can be called when creating a new page, to determine what filename
to save the page to. It's passed a page name, and its type, and returns
the name of the file to create, relative to the srcdir.
This can be called when creating a new page, to determine what filename
to save the page to. It's passed a page name, and its type, and returns
the name of the file to create, relative to the srcdir.
filename of the page. For example, `targetpage("foo", "rss", "feed")`
will yield something like `foo/feed.rss`.
filename of the page. For example, `targetpage("foo", "rss", "feed")`
will yield something like `foo/feed.rss`.
This adds a link to `%links`, ensuring that duplicate links are not
added. Pass it the page that contains the link, and the link text.
This adds a link to `%links`, ensuring that duplicate links are not
added. Pass it the page that contains the link, and the link text.