[WM] howto include (pod) files?

Justin Mason jm.jmason.org
Tue Aug 21 00:38:44 IST 2001


> then I looked at the <contents> tag. however, as the docu says: "load many
> chunks of content from one data source"
> so, this seems more appropriate to load for example a number of pod files
> from a directory at once and then do some processing on then.
> 
> what am I missing here? how would one go about including the pure content
> from a single (pod) file, still define the <content> etc. tags in the wmk
> file, without touching the pod file? Is it possible? Is it just too obvious
> for me to see?

Hi Steffen --

The <contents> tag is the best way to go about this - at the moment.  I've
run into this one too and it's quite inelegant (it does work, it just
doesn't make a lot of sense!).  I've been meaning to add a "load a
*single* content item from an external source" tag, to provide something
that's more logical for that purpose, but I haven't got around to it yet.

Anyway, for an example of the <contents> tag use take a look at the
webmake documentation's file, "doc/documentation.wmk", it loads some POD
files, setting attributes and metadata from the webmake file as it goes.
Here's the code:

  <!-- include the POD documentation directly from the source files -->

  <attrdefault name="listname"    value="all_pods">
  <attrdefault name="format"      value="text/pod">
  <attrdefault name="asis"        value="true">
  <attrdefault name="map"         value="true">
  <metadefault name="score"       value="50">

  <metadefault name="section"     value="08-pod">
  <contents src="../lib/HTML/WebMake" name="PerlCodeLibrary.pm" />
  <contents src="../lib/HTML/WebMake" name="Content.pm" />
  <contents src="../lib/HTML/WebMake" name="Main.pm" />
  </metadefault>

  [... lots of other .pm files follow, I'll skip them here]

  </metadefault>
  </attrdefault>
  </attrdefault>
  </attrdefault>
  </attrdefault>

Note, BTW, that when you're inserting PODs which are embedded in perl
code, you pretty much have to set the "asis" attribute to "true";
otherwise WebMake will try to expand content references in the perl code
as it goes.  This is a little bit annoying, so I may fix this at some
point ;) .

HTH,

--j.




More information about the Webmake-talk mailing list