HTML::WebMake - a simple web site management system, allowing an entire site to be created from a set of text and markup files and one WebMake file.
my $f = new HTML::WebMake::Main (); $f->readfile ($filename); $f->make(); my $failures = $f->finish(); exit $failures;
WebMake is a simple web site management system, allowing an entire site to be created from a set of text and markup files and one WebMake file.
It requires no dynamic scripting capabilities on the server; WebMake sites can be deployed to a plain old FTP site without any problems.
It allows the separation of responsibilities between the content editors, the HTML page designers, and the site architect; only the site architect needs to edit the WebMake file itself, or know perl or WebMake code.
A multi-level website can be generated entirely from 1 or more WebMake files containing content, links to content files, perl code (if needed), and output instructions. Since the file-to-page mapping no longer applies, and since elements of pages can be loaded from different files, this means that standard file access permissions can be used to restrict editing by role.
Since WebMake is written in perl, it is not limited to command-line invocation; using the
HTML::WebMake::Main module directly allows WebMake to be run from other Perl scripts, or even mod_perl (WebMake uses
use strict throughout, and temporary globals are used only where strictly necessary).
- $f = new HTML::WebMake::Main
Constructs a new
HTML::WebMake::Mainobject. You may pass the following attribute-value pairs to the constructor.
Force output. Normally if a file is already up to date, it is not modified. This will force the file to be re-made.
Force the cached metadata and dependency data for the site to be rebuilt. Normally this is used to speed up partial rebuilds of the site. This option implies
Run more quickly, but take more risks. Normally, dynamic content, such as Perl sections, sitemaps, or navigation links, are always considered to be in need of rebuilding, as mapping their dependencies is often very difficult or impossible. This switch forces them to be ignored for dependency-tracking purposes, and so an output file that depends on them will not be rebuilt unless a normal content item on that page changes.
Rewrite links to be absolute URLs based at this URL. By default, links are specified as relative wherever possible.
Generate output, and look for support files (images etc.), relative to this directory.
Paranoid mode; do not allow perl code evaluation or accesses to directories above the WebMake file.
Debug mode; more output.
- $f->set_option ($optname, $optval);
Set a WebMake option. Currently supported options are:
- $f->readfile ($filename)
Read and parse the given WebMake file.
- $f->readstring ($string)
Read and parse the given WebMake configuration (as a string).
- $f->make (@fnames)
Make either the files named by $fnames (or all outputs if $fname is not supplied), based on the WebMake files read earlier.
- $pagetext = $f->make_to_string ($fname)
Make the file named by $fname, and output its text to STDOUT, based on the WebMake files read earlier.
- $ok = $f->can_build($fname);
Returns 1 if WebMake can build the named file, 0 otherwise.
- $num_failures = $f->finish();
Finish with a WebMake object and dispose of its internal open files etc. Returns the number of serious failure conditions that occurred (files that could not be created, etc.).
See also http://webmake.taint.org/ for more information.
Justin Mason <jm /at/ jmason.org>
WebMake is distributed under the terms of the GNU Public License.
The latest version of this library is likely to be available from CPAN as well as: