From 60410369daef9ce990d516f0d538571db4623ceb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Feb 2010 14:48:22 -0500 Subject: [PATCH] add variable value examples --- doc/plugins/write.mdwn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index 07bfd72ac..f2b96b6d9 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -3,7 +3,7 @@ written to extend ikiwiki in many ways. Despite the length of this page, it's not really hard. This page is a complete reference to everything a plugin might want to do. There is also a quick [[tutorial]]. -[[!template type="note" text=""" +[[!template id="note" text=""" Ikiwiki is a compiler One thing to keep in mind when writing a plugin is that ikiwiki is a wiki @@ -569,6 +569,8 @@ 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()`. + $links{"foo"} = ["bar", "baz"]; + ### %destsources The `%destsources` hash records the name of the source file used to @@ -576,6 +578,8 @@ create each destination file. The key is the output filename (ie, "foo/index.html"), and the value is the source filename that it was built from (eg, "foo.mdwn"). Note that a single source file may create multiple destination files. Do not modify this hash directly; call `will_render()`. + + $destsources{"foo/index.html"} = "foo.mdwn"; ### %pagesources @@ -583,6 +587,8 @@ 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. + $pagesources{"foo"} = "foo.mdwn"; + ## Library functions ### `hook(@)` -- 2.44.0