The <metatable> Tag
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 even a content item, such as an
image.
The metatable 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-, or pipe-separated-value format.
Firstly, pick a delimiter character, such as | . Set the delimiter
attribute to this character.
Next, the first line of the metatable lists the metadata you wish to set; it
must start with the value . . This indicates to WebMake that it's
defining the metadata to be set.
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.
So, for example, consider this table, from the WebMake documentation:
<metatable 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>
This will set Main.pm.title to HTML::WebMake::Main,
Main.pm.abstract to module documentation, etc.
Using <metatable> To Tag Non-Content Items
Often, you will need to attach metadata to non-content items, such as images,
or HTML files that are not generated by WebMake. Here's how to do this.
First, load the URLs of the items using a <media> tag. Then
create an empty content item for each one (possibly automated using the
<for> tag). The URLs from the <media> tag will
automatically take precedence over the URLs of the fake content items.
Then use a metatable, as above, to set the metadata you wish to use.
|