Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > a2ac79ac252ef7b89f2f0fc449728720 > files > 454

ikiwiki-3.20190228-1.1.mga6.noarch.rpm

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ymlfront (third party plugin)</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />

<link rel="stylesheet" href="../../style.css" type="text/css" />

<link rel="stylesheet" href="../../local.css" type="text/css" />










</head>
<body>

<div class="page">

<div class="pageheader">
<div class="header">
<span>
<span class="parentlinks">

<a href="../../index.html">ikiwiki</a>/ 

<a href="../../plugins.html">plugins</a>/ 

<a href="../contrib.html">contrib</a>/ 

</span>
<span class="title">
ymlfront (third party plugin)

</span>
</span>



</div>









</div>





<div id="pagebody">

<div id="content" role="main">
<p><span class="infobox">
Plugin: ymlfront<br />
Author: <span class="createlink">rubykat</span><br />
Included in ikiwiki: no<br />
Enabled by default: no<br />
Included in <a href="../goodstuff.html">goodstuff</a>: no<br />
Currently enabled: no<br />
</span></p>

<div class="toc">
	<ol>
		<li class="L2"><a href="#index1h2">NAME</a>
		</li>
		<li class="L2"><a href="#index2h2">SYNOPSIS</a>
		</li>
		<li class="L2"><a href="#index3h2">DESCRIPTION</a>
		</li>
		<li class="L2"><a href="#index4h2">DETAILS</a>
		</li>
		<li class="L2"><a href="#index5h2">PREREQUISITES</a>
		</li>
		<li class="L2"><a href="#index6h2">DOWNLOAD</a>
		</li>
	</ol>
</div>

<h2><a name="index1h2"></a>NAME</h2>

<p>IkiWiki::Plugin::ymlfront - add YAML-format data to a page</p>

<h2><a name="index2h2"></a>SYNOPSIS</h2>

<pre><code># activate the plugin
add_plugins =&gt; [qw{goodstuff ymlfront ....}],

# configure the plugin
ymlfront_delim =&gt; [qw(--YAML-- --YAML--)],
</code></pre>

<h2><a name="index3h2"></a>DESCRIPTION</h2>

<p>This plugin provides a way of adding arbitrary meta-data (data fields) to any
page by prefixing the page with a YAML-format document.  This also provides
the <a href="./ikiwiki/directive/ymlfront.html">ymlfront</a> directive, which enables one to put
YAML-formatted data inside a standard IkiWiki <a href="../../ikiwiki/directive.html">directive</a>.</p>

<p>This is a way to create per-page structured data, where each page is
treated like a record, and the structured data are fields in that record.  This
can include the meta-data for that page, such as the page title.</p>

<p>This plugin is meant to be used in conjunction with the <a href="./field.html">field</a> plugin.</p>

<h2><a name="index4h2"></a>DETAILS</h2>

<p>There are three formats for adding YAML data to a page.  These formats
should not be mixed - the result is undefined.</p>

<ol>
<li><p>ymlfront directive</p>

<p>See <a href="./ikiwiki/directive/ymlfront.html">ymlfront</a> for more information.</p></li>
<li><p>default YAML-compatible delimiter</p>

<p>By default, the YAML-format data in a page is placed at the start of
the page and delimited by lines containing precisely three dashes.
This is what YAML itself uses to delimit multiple documents.
The "normal" content of the page then follows.</p>

<p>For example:</p>

<pre><code>---
title: Foo does not work
Urgency: High
Status: Assigned
AssignedTo: Fred Nurk
Version: 1.2.3
---
When running on the Sprongle system, the Foo function returns incorrect data.
</code></pre>

<p>What will normally be displayed is everything following the second line of dashes.  That will be htmlized using the page-type of the page-file.</p></li>
<li><p>user-defined delimiter</p>

<p>Instead of using the default "---" delimiter, the user can define,
in the configuration file, the <strong>ymlfront_delim</strong> value, which is an
array containing two strings. The first string defines the markup for
the start of the YAML data, and the second string defines the markip
for the end of the YAML data. These two strings can be the same, or
they can be different. In this case, the YAML data section is not
required to be at the start of the page, but as with the default, it
is expected that only one data section will be on the page.</p>

<p>For example:</p>

<pre><code>--YAML--
title: Foo does not work
Urgency: High
Status: Assigned
AssignedTo: Fred Nurk
Version: 1.2.3
--YAML--
When running on the Sprongle system, the Foo function returns incorrect data.
</code></pre>

<p>What will normally be displayed is everything outside the delimiters,
both before and after.  That will be htmlized using the page-type of the page-file.</p></li>
</ol>

<h3><a name="index1h3"></a>Accessing the Data</h3>

<p>There are a few ways to access the given YAML data.</p>

<ul>
<li><p><a href="./getfield.html">getfield</a> plugin</p>

<p>The <strong>getfield</strong> plugin can display the data as individual variable values.</p>

<p>For example:</p>

<pre><code>---
title: Foo does not work
Urgency: High
Status: Assigned
AssignedTo: Fred Nurk
Version: 1.2.3
---
# {{&#036;title}}


**Urgency:** {{&#036;Urgency}}\\
**Status:** {{&#036;Status}}\\
**Assigned To:** {{&#036;AssignedTo}}\\
**Version:** {{&#036;Version}}
</code></pre>

<p>When running on the Sprongle system, the Foo function returns incorrect data.</p></li>
<li><p><a href="./ftemplate.html">ftemplate</a> plugin</p>

<p>The <strong>ftemplate</strong> plugin is like the <a href="../template.html">template</a> plugin, but it is also aware of <a href="./field.html">field</a> values.</p>

<p>For example:</p>

<pre><code>---
title: Foo does not work
Urgency: High
Status: Assigned
AssignedTo: Fred Nurk
Version: 1.2.3
---
[[!ftemplate  id="bug_display_template"]]


When running on the Sprongle system, the Foo function returns incorrect data.
</code></pre></li>
<li><p><a href="./report.html">report</a> plugin</p>

<p>The <strong>report</strong> plugin is like the <a href="./ftemplate.html">ftemplate</a> plugin, but it reports on multiple pages, rather than just the current page.</p></li>
<li><p>write your own plugin</p>

<p>In conjunction with the <a href="./field.html">field</a> plugin, you can write your own plugin to access the data.</p></li>
</ul>

<h2><a name="index5h2"></a>PREREQUISITES</h2>

<pre><code>IkiWiki
IkiWiki::Plugin::field
YAML::Any
</code></pre>

<h2><a name="index6h2"></a>DOWNLOAD</h2>

<ul>
<li>browse at GitHub: <a href="http://github.com/rubykat/ikiplugins/blob/master/IkiWiki/Plugin/ymlfront.pm">http://github.com/rubykat/ikiplugins/blob/master/IkiWiki/Plugin/ymlfront.pm</a></li>
<li>git repo at git://github.com/rubykat/ikiplugins.git</li>
</ul>

</div>







</div>

<div id="footer" class="pagefooter" role="contentinfo">

<div id="pageinfo">




<div class="tags">
Tags:

<a href="../type/meta.html" rel="tag">type/meta</a>

</div>



<div id="backlinks">
Links:

<a href="./ftemplate/ikiwiki/directive/ftemplate.html">ftemplate/ikiwiki/directive/ftemplate</a>


</div>






<div class="pagedate">
Last edited <span class="date">Tue Feb 26 23:01:54 2019</span>
<!-- Created <span class="date">Tue Feb 26 23:01:54 2019</span> -->
</div>

</div>


<!-- from ikiwiki -->
</div>

</div>

</body>
</html>