<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>
WebMake: Documentation: The <metatable> Tag
</title>
<meta name="generator" content="WebMake/2.2" />
<style>
body {
background-color: #ffffff;
color: #000000;
font-size: medium;
font-family: verdana,lucida,helvetica,sans-serif;
}
code, samp, pre {
font-family: Courier New,courier,fixed-width,monospace;
}
H1 { font-size: x-large; font-family: Garamond,Book Antiqua,Times,serif; background: #FFCC66; }
H2 { font-size: large; font-family: Garamond,Book Antiqua,Times,serif; background: #FFDD77; }
H3 { font-size: medium; font-family: Garamond,Book Antiqua,Times,serif; background: #FFEE88; }
H4 { font-size: small; font-family: Garamond,Book Antiqua,Times,serif; }
H5 { font-size: x-small; font-family: Garamond,Book Antiqua,Times,serif; }
H6 { font-size: xx-small; font-family: Garamond,Book Antiqua,Times,serif; }
A:link {
font-weight: bold;
color: #004000;
text-decoration: underline;
}
A:visited {
font-weight: normal;
color: #008000;
text-decoration: underline;
}
A:active {
font-weight: bold;
color: #800000;
text-decoration: underline;
}
dt {
font-size: medium;
font-weight: bold;
padding-top: 8px; padding-bottom: 8px;
}
dd {
padding-top: 8px; padding-bottom: 8px;
}
</style>
</head>
<body bgcolor="#ffffff" text="#000000" link="#3300cc" vlink="#660066">
<font face="lucida,verdana,sans-serif">
<div align="center">
<img src="images/WebMakeTitle.png" alt="WebMake" width="500" height="122" />
</div>
<table width="100%">
<tr>
<td valign="top">
<strong><a href="http://webmake.taint.org/">WebMake</a>
Documentation</strong> (version 2.2)
</td>
<td valign="top">
<div align="right">
[ <a href="metadefault.html">Back</a> | <a href="attrdefault.html">Forward</a> | <a href="index.html">Index</a>
| <a href="allinone.html">All In One</a> ]
</div>
</td>
</tr>
</table>
<!-- yes, it's that Mozilla black-border code again ;) -->
<!-- stolen from www.mozilla.org via rc3.org -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td bgcolor="#aaaaaa">
<table border="0" cellspacing="4" cellpadding="4" width="100%">
<tr>
<td bgcolor="#ffffff">
<table border="0" cellspacing="4" cellpadding="4" width="100%">
<tr>
<td>
<h1>The <metatable> Tag</h1><p>
Metadata is usually embedded inside a content item using the <wmmeta>
tag. However, sometimes you may want to tag a content item with metadata from
outside, if the text of the content is not under your control; or you may want
to tag metadata to an object that is not text-based, such as an image.
</p>
<p>
The <a href="metatable.html">metatable</a> tag allows you to do this, and in bulk. You list a table of
content names and the metadata you want to attach to each content item, in
tab-, comma-, pipe-separated-value, or XML format.
</p>
<p>
By default, the table is read from between the <<a href="metatable.html">metatable</a>> and
</metatable> tags. However, if you set the <em>src</em> attribute,
the table will be read from the location specified, instead.
</p>
<p>
Use the <em>format</em> attribute to specify whether the <a href="metatable.html">metatable</a> is in
XML (<strong>xml</strong>) or Delimiter-Separated-Value (<strong>csv</strong>) format.
</p>
<a name="Delimiter_Separated_Value_Format"><h1>Delimiter-Separated-Value Format</h1></a><p>
Firstly, pick a delimiter character, such as <code>|</code>. Set the <em>delimiter</em>
attribute to this character.
</p>
<p>
Next, the first line of the <a href="metatable.html">metatable</a> lists the metadata you wish to set; it
must start with the value <code>.</code>. This indicates to WebMake that it's
defining the metadata to be set.
</p>
<p>
Finally, list as many lines of metadata as you like; the first value on the
line is the name of the content item you wish to attach the metadata to. From
then on, the other values on the line are the values of the metadata.
</p>
<p>
So, for example, consider this table, from the WebMake documentation:
</p>
<pre>
<<a href="metatable.html">metatable</a> delimiter="|">
.|title|abstract
Main.pm|HTML::WebMake::Main|module documentation
PerlCodeLibrary.pm|HTML::WebMake::PerlCodeLibrary|module documentation
Content.pm|HTML::WebMake::Content|module documentation
EtText2HTML.pm|Text::EtText::EtText2HTML|module documentation
HTML2EtText.pm|Text::EtText::HTML2EtText|module documentation
webmake|webmake(1)|script documentation
ettext2html|ettext2html(1)|script documentation
ethtml2text|ethtml2text(1)|script documentation
</metatable>
</pre>
<p>
This will set <strong>Main.pm.title</strong> to <strong>HTML::WebMake::Main</strong>,
<strong>Main.pm.abstract</strong> to <strong>module documentation</strong>, etc.
</p>
<a name="XML_Format"><h1>XML Format</h1></a><p>
The XML block is surrounded with a <metaset> tag, and contains
<target> blocks naming the content items the enclosed metadata items are
associated with.
</p>
<p>
Inside the <target> blocks, <meta> tags name each metadatum, and
enclose the metadatum's value.
</p>
<p>
<pre>
<!--etsafe-->
<metaset>
<target id="foo.txt">
<meta name="title">
This is Foo.txt's title.
</meta>
</target>
</metaset>
<!--/etsafe-->
</pre>
</p>
<a name="Using_lt_a_href_metatable_metatable_a_gt_To_Tag_Non_Content_Items"><h1>Using <<a href="metatable.html">metatable</a>> To Tag Non-Content Items</h1></a><p>
Previously, WebMake required you to create phoney content items, in order to
tag metadata onto images or other non-content items. This is no longer
required. Just load the URLs of the items using a <a href="media.html"><media></a>
tag, and each one will have a "phoney" content item created with the same
name automatically.
</p>
<p>
Then use a <a href="metatable.html">metatable</a>, as above, to set the metadata you wish to use.
</p>
<p>
</p>
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="100%">
<tr>
<td valign="top">
<strong><a href="http://webmake.taint.org/">WebMake</a>
Documentation</strong> (version 2.2)
</td>
<td valign="top">
<div align="right">
[ <a href="metadefault.html">Back</a> | <a href="attrdefault.html">Forward</a> | <a href="index.html">Index</a>
| <a href="allinone.html">All In One</a> ]
</div>
</td>
</tr>
</table>
<div align="right">
<a href="http://webmake.taint.org/"><img src="images/BuiltWithWebMake.png" alt="Built With WebMake" border="0" width="88" height="31" /></a>
</div>
</font>
</body>
</html>