From 7d997f1007b240c14c04ff73b09a2a62fa3e64ad Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 13 Jan 2010 02:36:28 +0000 Subject: ftemplate: field-aware structured template plugin --- doc/plugins/contrib/ftemplate.mdwn | 94 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 doc/plugins/contrib/ftemplate.mdwn (limited to 'doc/plugins/contrib/ftemplate.mdwn') diff --git a/doc/plugins/contrib/ftemplate.mdwn b/doc/plugins/contrib/ftemplate.mdwn new file mode 100644 index 000000000..bcc6f2c67 --- /dev/null +++ b/doc/plugins/contrib/ftemplate.mdwn @@ -0,0 +1,94 @@ +[[!template id=plugin name=ftemplate author="[[rubykat]]"]] +[[!tag type/meta type/format]] +[[!toc]] +## NAME + +IkiWiki::Plugin::ftemplate - field-aware structured template plugin + +## SYNOPSIS + + # activate the plugin + add_plugins => [qw{goodstuff ftemplate ....}], + +## DESCRIPTION + +This plugin provides the **ftemplate** directive. This is like +the [[ikiwiki/directive/template]] directive, with the addition that one does not +have to provide all the values in the call to the template, +because ftemplate can query structured data ("fields") using +the [[field]] plugin. + +Templates are files that can be filled out and inserted into pages in +the wiki, by using the ftemplate directive. The directive has an id +parameter that identifies the template to use. + +Additional parameters can be used to fill out the template, in +addition to the "field" values. Passed-in values override the +"field" values. + +There are two places where template files can live. One is, as with the +[[plugins/template]] plugin, in the /templates directory on the wiki. These +templates are wiki pages, and can be edited from the web like other wiki +pages. + +The second place where template files can live is in the global +templates directory (the same place where the page.tmpl template lives). +This is a useful place to put template files if you want to prevent +them being edited from the web, and you don't want to have to make +them work as wiki pages. + +### EXAMPLES + +#### Example 1 + +PageA: + + [[!meta title="I Am Page A"]] + [[!meta description="A is for Apple."]] + [[!meta author="Fred Nurk"]] + [[!ftemplate id="mytemplate"]] + +Template "mytemplate": + + # + by + + **Summary:** + +This will give: + +

I Am Page A

+

by Fred Nurk

+

Summary: A is for Apple. + +#### Example 2: Overriding values + +PageB: + + [[!meta title="I Am Page B"]] + [[!meta description="B is for Banana."]] + [[!meta author="Fred Nurk"]] + [[!ftemplate id="mytemplate" title="Bananananananas"]] + +This will give: + +

Bananananananas

+

by Fred Nurk

+

Summary: B is for Banana. + +### LIMITATIONS + +One cannot query the values of fields on pages other than the current +page. + +## PREREQUISITES + + IkiWiki + IkiWiki::Plugin::field + HTML::Template + Encode + +## DOWNLOAD + +* browse at GitHub: +* git repo at git://github.com/rubykat/ikiplugins.git -- cgit v1.2.3 From a3527672769b93eeb4a70fbe9f316c986706c375 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 13 Jan 2010 02:37:27 +0000 Subject: fixed title --- doc/plugins/contrib/ftemplate.mdwn | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'doc/plugins/contrib/ftemplate.mdwn') diff --git a/doc/plugins/contrib/ftemplate.mdwn b/doc/plugins/contrib/ftemplate.mdwn index bcc6f2c67..fba51e1c2 100644 --- a/doc/plugins/contrib/ftemplate.mdwn +++ b/doc/plugins/contrib/ftemplate.mdwn @@ -43,10 +43,10 @@ them work as wiki pages. PageA: - [[!meta title="I Am Page A"]] - [[!meta description="A is for Apple."]] - [[!meta author="Fred Nurk"]] - [[!ftemplate id="mytemplate"]] + \[[!meta title="I Am Page A"]] + \[[!meta description="A is for Apple."]] + \[[!meta author="Fred Nurk"]] + \[[!ftemplate id="mytemplate"]] Template "mytemplate": @@ -65,10 +65,10 @@ This will give: PageB: - [[!meta title="I Am Page B"]] - [[!meta description="B is for Banana."]] - [[!meta author="Fred Nurk"]] - [[!ftemplate id="mytemplate" title="Bananananananas"]] + \[[!meta title="I Am Page B"]] + \[[!meta description="B is for Banana."]] + \[[!meta author="Fred Nurk"]] + \[[!ftemplate id="mytemplate" title="Bananananananas"]] This will give: -- cgit v1.2.3 From 9b45264c1c3e83b991d74de6df652a2f2e8749d8 Mon Sep 17 00:00:00 2001 From: "http://kerravonsen.dreamwidth.org/" Date: Wed, 19 May 2010 11:20:44 +0000 Subject: new version --- doc/plugins/contrib/ftemplate.mdwn | 83 ++++---------------------------------- 1 file changed, 7 insertions(+), 76 deletions(-) (limited to 'doc/plugins/contrib/ftemplate.mdwn') diff --git a/doc/plugins/contrib/ftemplate.mdwn b/doc/plugins/contrib/ftemplate.mdwn index fba51e1c2..d82867f94 100644 --- a/doc/plugins/contrib/ftemplate.mdwn +++ b/doc/plugins/contrib/ftemplate.mdwn @@ -1,85 +1,16 @@ [[!template id=plugin name=ftemplate author="[[rubykat]]"]] [[!tag type/meta type/format]] -[[!toc]] -## NAME -IkiWiki::Plugin::ftemplate - field-aware structured template plugin +This plugin provides the [[ikiwiki/directive/ftemplate]] directive. -## SYNOPSIS +This is like the [[ikiwiki/directive/template]] directive, with the addition +that one does not have to provide all the values in the call to the template, +because ftemplate can query structured data ("fields") using the [[field]] +plugin. - # activate the plugin - add_plugins => [qw{goodstuff ftemplate ....}], - -## DESCRIPTION - -This plugin provides the **ftemplate** directive. This is like -the [[ikiwiki/directive/template]] directive, with the addition that one does not -have to provide all the values in the call to the template, -because ftemplate can query structured data ("fields") using -the [[field]] plugin. - -Templates are files that can be filled out and inserted into pages in -the wiki, by using the ftemplate directive. The directive has an id -parameter that identifies the template to use. - -Additional parameters can be used to fill out the template, in -addition to the "field" values. Passed-in values override the -"field" values. - -There are two places where template files can live. One is, as with the -[[plugins/template]] plugin, in the /templates directory on the wiki. These -templates are wiki pages, and can be edited from the web like other wiki -pages. - -The second place where template files can live is in the global -templates directory (the same place where the page.tmpl template lives). -This is a useful place to put template files if you want to prevent -them being edited from the web, and you don't want to have to make -them work as wiki pages. - -### EXAMPLES - -#### Example 1 - -PageA: - - \[[!meta title="I Am Page A"]] - \[[!meta description="A is for Apple."]] - \[[!meta author="Fred Nurk"]] - \[[!ftemplate id="mytemplate"]] - -Template "mytemplate": +## Activate the plugin - # - by - - **Summary:** - -This will give: - -

I Am Page A

-

by Fred Nurk

-

Summary: A is for Apple. - -#### Example 2: Overriding values - -PageB: - - \[[!meta title="I Am Page B"]] - \[[!meta description="B is for Banana."]] - \[[!meta author="Fred Nurk"]] - \[[!ftemplate id="mytemplate" title="Bananananananas"]] - -This will give: - -

Bananananananas

-

by Fred Nurk

-

Summary: B is for Banana. - -### LIMITATIONS - -One cannot query the values of fields on pages other than the current -page. + add_plugins => [qw{goodstuff ftemplate ....}], ## PREREQUISITES -- cgit v1.2.3