Webmake

Webmake is a simple HTML preprocessor and website management system, based around a templating system for HTML documents and an emphasis on page generation. The project has been inactive since 2004 and presumably there are good alternatives under active development, so I cannot recommend it. Nonetheless it continues to meet my needs, so I don’t mind being its last remaining user.

These notes are Linux-centric because that’s what I use, but Webmake should run on any platform where Perl is installed. In 2003 I successfully installed Webmake on Windows with ActiveState Perl, which was so long ago I don’t remember the details.

INSTALLATION
Packages and modules
Some Linux distributions carry Webmake in their software repositories. This would be the preferred method of installation.

Version 2.2 is available as CPAN module HTML::WebMake. This older version lacks lang_tag, so it doesn’t meet my needs. But it’s an easy to install option for users who don’t need the newest features.

Rolling your own
And of course you can install it by hand according to the README. Here’s how it went for me on Ubuntu Linux 12.10 amd64 with perl 5.14:

Using my distribution’s package manager and CPAN I installed the required and optional Perl modules:

  • Ubuntu package libio-string-perl, corresponding to CPAN module IO::String.
  • Ubuntu package libimage-size-perl, corresponding to CPAN module Image::Size.
  • CPAN module Text::EtText. CPAN will pull in version 2.2 of EtText. It works despite the version difference with Webmake 2.4. I haven’t tried it, but the latest bleeding edge version 2.3 of EtText is available.
  • Ubuntu package libhtml-parser-perl, corresponding to CPAN module HTML::Parser.
  • CPAN module DB_File failed to install. Being merely optional, I chose to do without it rather than track down the issue.
  • CPAN module XML::Sablotron isn’t needed by me and was omitted.

I downloaded the latest bleeding edge version (2.4) of Webmake and unpacked it to a temporary location. Entering the source directory, I did per the README:

$ perl Makefile.PL
$ make
$ make test
# make install

Notice that the latter is done as root. Webmake is now installed as a Perl module.

TODO: Try installing it with checkinstall.

TROUBLESHOOTING
When using Webmake, an error message similar to “Parsing of undecoded UTF-8 will give garbage when decoding entities at /usr/lib/perl5/vendor_perl/5.8.8/HTML/WebMake/HTMLCleaner.pm line 114” can indicate a UTF-8 encoded source file that contains a character that needs to be changed to its character entity. The offending source file is named immediately after the error message. An easy solution is to open the offending source file in a code editor and convert to HTML entities. For example in Bluefish, select Tools – Convert – Characters to entities, and insure that the option “Convert characters ISO8859-1” is selected. Save your document and re-run Webmake; the error should be gone.

Because I compile Webmake by hand rather than go through my distro’s package manager, I risk breaking Webmake when Perl is upgraded. A symptom of this is that attempting to run Webmake fails with an error message such as

Can’t locate HTML/WebMake/Main.pm in @INC (you may need to install the HTML::WebMake::Main module) (@INC contains: /lots /of /directories) at /usr/bin/webmake line 65.

Webmake is installed (the executable is at /usr/bin/webmake) but you compiled it for a different version of Perl than you now have. The solution is to recompile, repeating “rolling your own” above.

The above refers to Webmake 2.4 compiled from source and was last updated 1 January 2015.

REFERENCES
Project site
Undecoded UTF-8 errors in Perl

Advertisements

About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s