aboutsummaryrefslogtreecommitdiff
path: root/doc/ikiwiki
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ikiwiki')
-rw-r--r--doc/ikiwiki/directive/calendar.mdwn21
-rw-r--r--doc/ikiwiki/directive/comment.mdwn17
-rw-r--r--doc/ikiwiki/directive/edittemplate.mdwn12
-rw-r--r--doc/ikiwiki/directive/inline.mdwn4
-rw-r--r--doc/ikiwiki/directive/meta/discussion.mdwn4
-rw-r--r--doc/ikiwiki/directive/template.mdwn20
-rw-r--r--doc/ikiwiki/directive/templatebody.mdwn28
7 files changed, 90 insertions, 16 deletions
diff --git a/doc/ikiwiki/directive/calendar.mdwn b/doc/ikiwiki/directive/calendar.mdwn
index cb40f884e..4c2b99ccb 100644
--- a/doc/ikiwiki/directive/calendar.mdwn
+++ b/doc/ikiwiki/directive/calendar.mdwn
@@ -25,14 +25,23 @@ in the sidebar, you'll also need to create these archive pages. They
typically use this directive to display a calendar, and also use [[inline]]
to display or list pages created in the given time frame.
-The `ikiwiki-calendar` command can be used to automatically generate the
-archive pages. It also refreshes the wiki, updating the calendars to
-highlight the current day. This command is typically run at midnight from
-cron.
+## Generating archive pages
+
+If [[!iki plugins/calendar desc=option]] `calendar_autocreate` is not set, the
+[[!iki ikiwiki-calendar]] command can be used to automatically generate the archive
+pages. It also refreshes the wiki, updating the calendars to highlight the
+current day. This command is typically run at midnight from cron.
An example crontab:
- 0 0 * * * ikiwiki-calendar ~/ikiwiki.setup "posts/* and !*/Discussion"
+ 0 0 * * * ikiwiki-calendar ~/ikiwiki.setup "posts/* and !*/Discussion"
+
+
+With [[!iki plugins/calendar desc="setup option"]] `calendar_autocreate`,
+all this work is done by `ikiwiki` itself. Thus, the crontab command can be
+replaced by:
+
+ 0 0 * * * ikiwiki --setup ~/ikiwiki.setup --refresh
## usage
@@ -45,7 +54,7 @@ An example crontab:
for the whole wiki by setting `archivebase` in ikiwiki's setup file.
Calendars link to pages under here, with names like "2010/04" and
"2010". These pages can be automatically created using the
- `ikiwiki-calendar` program.
+ `calendar_autocreate` [[!iki plugins/calendar desc="setup option"]].
* `year` - The year for which the calendar is requested. Defaults to the
current year. Can also use -1 to refer to last year, and so on.
* `month` - The numeric month for which the calendar is requested, in the
diff --git a/doc/ikiwiki/directive/comment.mdwn b/doc/ikiwiki/directive/comment.mdwn
index 398130e2e..590ad5c6b 100644
--- a/doc/ikiwiki/directive/comment.mdwn
+++ b/doc/ikiwiki/directive/comment.mdwn
@@ -1,7 +1,15 @@
The `comment` directive is supplied by the
-[[!iki plugins/comments desc=comments]] plugin, and is used to add a comment
-to a page. Typically, the directive is the only thing on a comment page,
-and is filled out by the comment plugin when a user posts a comment.
+[[!iki plugins/comments desc=comments]] plugin. There should
+be one comment directive in each source file with extension
+`._comment` or `._comment_pending`, and the directive should not
+appear anywhere else. Comments are normally created via the web,
+in which case ikiwiki automatically creates a suitable
+`._comment` file.
+
+Wiki administrators can also commit comment files to the version
+control system directly: they should be named starting with
+the *comments\_pagename* config option (usually `comment_`)
+and ending with `._comment`, for instance `comment_42._comment`.
Example:
@@ -17,7 +25,8 @@ Example:
## usage
The only required parameter is `content`, the others just add or override
-metadata of the comment.
+metadata for the comment. Many parameters are shortcuts for [[meta]]
+directives.
* `content` - Text to display for the comment.
Note that [[directives|ikiwiki/directive]]
diff --git a/doc/ikiwiki/directive/edittemplate.mdwn b/doc/ikiwiki/directive/edittemplate.mdwn
index 6269f5dd8..70bd2ad25 100644
--- a/doc/ikiwiki/directive/edittemplate.mdwn
+++ b/doc/ikiwiki/directive/edittemplate.mdwn
@@ -18,13 +18,15 @@ the directive displaying a note about the template being registered, add
"silent=yes".
Often the template page contains a simple skeleton for a particular type of
-page. For the bug report pages in the above example, it might look
-something like:
+page, wrapped in a [[templatebody]] directive. For the bug report pages in
+the above example, it might look something like:
+ \[[!templatebody <<ENDBODY
Package:
Version:
Reproducible: y/n
Details:
+ ENDBODY]]
The template page can also contain [[!cpan HTML::Template]] directives,
like other ikiwiki [[templates]].
@@ -43,4 +45,10 @@ These variables might be set:
suitable for use in `\[[!meta date="<TMPL_VAR time>"]]`
(see [[meta]]) or `\[[!date "<TMPL_VAR time>"]]` (see [[date]]).
+Text outside the [[templatebody]] directive is not part of the template,
+and can be used to document it.
+
+If the template does not contain a [[templatebody]] directive, the entire
+source of the page is used for the template. This is deprecated.
+
[[!meta robots="noindex, follow"]]
diff --git a/doc/ikiwiki/directive/inline.mdwn b/doc/ikiwiki/directive/inline.mdwn
index dfe3e171f..da759fc19 100644
--- a/doc/ikiwiki/directive/inline.mdwn
+++ b/doc/ikiwiki/directive/inline.mdwn
@@ -96,7 +96,9 @@ Here are some less often needed parameters:
markup around it, as if it were a literal part of the source of the
inlining page.
* `sort` - Controls how inlined pages are [[sorted|pagespec/sorting]].
- The default is to sort the newest created pages first.
+ The default is to sort the newest created pages first, and if pages
+ were created in the same commit, sort them by the name of the page
+ (equivalent to `sort="age title"`).
* `reverse` - If set to "yes", causes the sort order to be reversed.
* `feedlimit` - Specify the maximum number of matching pages to include in
the rss/atom feeds. The default is the same as the `limit` value above.
diff --git a/doc/ikiwiki/directive/meta/discussion.mdwn b/doc/ikiwiki/directive/meta/discussion.mdwn
index 428f454ab..5461d2e8e 100644
--- a/doc/ikiwiki/directive/meta/discussion.mdwn
+++ b/doc/ikiwiki/directive/meta/discussion.mdwn
@@ -78,3 +78,7 @@ I guess patching [[/ikiwiki/directive/meta]] to document the fact this attribute
The problem is that it does not generate the lang attribute in `<html>` and that's what's required for [hyphenation](https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens) so this would be welcome too!
Also, being able to use the language variable in templates would be very useful for various css tweaks. — [Hugo](https://hroy.eu)
+
+----
+
+When `title` is set, is there a way to get the real `pagename` in templates (so that I can use `title_overridden` to render the pagename, as the last part of the page URL, in breadcrumbs) ? -- [[BBB]]
diff --git a/doc/ikiwiki/directive/template.mdwn b/doc/ikiwiki/directive/template.mdwn
index 9e3ae54df..dd1ca3d52 100644
--- a/doc/ikiwiki/directive/template.mdwn
+++ b/doc/ikiwiki/directive/template.mdwn
@@ -31,16 +31,25 @@ large chunks of marked up text to be embedded into a template:
## Creating a template
-The template is a regular wiki page, located in the `templates/`
+The template is in a regular wiki page, located in the `templates/`
subdirectory inside the source directory of the wiki.
+The contents of the [[templatebody]] directive are used as the
+template. Anything outside that directive is not included in the template,
+and is usually used as documentation describing the template.
+
+If the template does not contain a [[templatebody]] directive, the entire
+source of the page is used for the template. This is deprecated, because
+it leads to the template markup being interpreted as ordinary
+page source when the page is built, as well as being used as the template.
Alternatively, templates can be stored in a directory outside the wiki,
as files with the extension ".tmpl".
By default, these are searched for in `/usr/share/ikiwiki/templates`,
the `templatedir` setting can be used to make another directory be searched
first. When referring to templates outside the wiki source directory, the "id"
-parameter is not interpreted as a pagespec, and you must include the full filename
-of the template page, including the ".tmpl" extension. E.g.:
+parameter is not interpreted as a pagespec, you must include the full filename
+of the template page including the ".tmpl" extension,
+and the templatebody directive is not used. E.g.:
\[[!template id=blogpost.tmpl]]
@@ -63,6 +72,7 @@ few things:
Here's a sample template:
+ \[[!templatebody <<ENDBODY
<span class="infobox">
Name: \[[<TMPL_VAR raw_name>]]<br />
Age: <TMPL_VAR age><br />
@@ -76,6 +86,10 @@ Here's a sample template:
<TMPL_VAR notes>
</TMPL_IF>
</span>
+ ENDBODY]]
+
+ This template describes a person. Parameters: name, age,
+ color (favorite color, optional), notes (optional).
The filled out template will be formatted the same as the rest of the page
that contains it, so you can include WikiLinks and all other forms of wiki
diff --git a/doc/ikiwiki/directive/templatebody.mdwn b/doc/ikiwiki/directive/templatebody.mdwn
new file mode 100644
index 000000000..36b5af172
--- /dev/null
+++ b/doc/ikiwiki/directive/templatebody.mdwn
@@ -0,0 +1,28 @@
+The `templatebody` directive is supplied by the
+[[!iki plugins/templatebody desc=templatebody]] plugin.
+
+This directive allows wiki pages to be used as templates
+for the [[template]] or [[edittemplate]] directive, without having
+[[!cpan HTML::Template]] markup interpreted as wiki markup when that
+page is built.
+
+This directive does not produce any output in the wiki page that
+defines the template; the rest of that page can be used to to document
+how to use the template.
+
+The first, un-named parameter is the content of the template.
+Because templates often contain [[directives|ikiwiki/directive]], it's
+convenient to use the "here-document" syntax for it:
+
+ \[[!templatebody <<ENDBODY
+ [[!meta title="<TMPL_VAR name>"]]
+ \[[!tag person]]
+ <dl>
+ <dt>Name:</dt><dd><TMPL_VAR name></dd>
+ <dt>Age:</dt><dd><TMPL_VAR age></dd>
+ </dl>
+
+ <TMPL_VAR description>
+ ENDBODY]]
+
+[[!meta robots="noindex, follow"]]