1 [[!template id=plugin name=ymlfront author="[[rubykat]]"]]
6 IkiWiki::Plugin::ymlfront - add YAML-format data to a page
11 add_plugins => [qw{goodstuff ymlfront ....}],
15 This plugin provides a way of adding arbitrary meta-data (data fields) to any
16 page by prefixing the page with a YAML-format document. This also provides
17 the [[ikiwiki/directive/ymlfront]] directive, which enables one to put
18 YAML-formatted data inside a standard IkiWiki [[ikiwiki/directive]].
20 This is a way to create per-page structured data, where each page is
21 treated like a record, and the structured data are fields in that record. This
22 can include the meta-data for that page, such as the page title.
24 This plugin is meant to be used in conjunction with the [[field]] plugin.
28 If one is not using the ymlfront directive, the YAML-format data in a page
29 must be placed at the start of the page and delimited by lines containing
30 precisely three dashes. The "normal" content of the page then follows.
35 title: Foo does not work
41 When running on the Sprongle system, the Foo function returns incorrect data.
43 What will normally be displayed is everything following the second line of dashes.
44 That will be htmlized using the page-type of the page-file.
46 ### Accessing the Data
48 There are a few ways to access the given YAML data.
52 The **getfield** plugin can display the data as individual variable values.
57 title: Foo does not work
65 **Urgency:** {{$Urgency}}\\
66 **Status:** {{$Status}}\\
67 **Assigned To:** {{$AssignedTo}}\\
68 **Version:** {{$Version}}
70 When running on the Sprongle system, the Foo function returns incorrect data.
72 * [[ftemplate]] plugin
74 The **ftemplate** plugin is like the [[plugins/template]] plugin, but it is also aware of [[field]] values.
79 title: Foo does not work
85 \[[!ftemplate id="bug_display_template"]]
87 When running on the Sprongle system, the Foo function returns incorrect data.
91 The **report** plugin is like the [[ftemplate]] plugin, but it reports on multiple pages, rather than just the current page.
93 * write your own plugin
95 In conjunction with the [[field]] plugin, you can write your own plugin to access the data.
100 IkiWiki::Plugin::field
105 * browse at GitHub: <http://github.com/rubykat/ikiplugins/blob/master/IkiWiki/Plugin/ymlfront.pm>
106 * git repo at git://github.com/rubykat/ikiplugins.git