#include # # # # A wml version of the Unix find command #
    { use File::Find; local @pattern = split ( "\\|", "" ); local $recursive = ''; local $clean = ''; my $dir = ''; foreach ( @pattern ) { $_ = glob2pat ( $_ ); } #say ( "\nFIND in $dir (recursive: $recursive, pattern: ". join("|", @pattern) . "\n" ); local @files = (); find ( \&check_file, $dir ); my $odd = 0; foreach ( sort { split ('/',$a) - split ('/',$b) || $a cmp $b } @files ) { my $abs = $_; s,^$dir,,; s,^/,,g; my $aclass = $odd ? "filelist-odd" : "filelist-even";
  • $_
  • $odd = 1 - $odd; } sub check_file { return if $clean && ( m/~$/ || m/\.bak$/ ); foreach my $p ( @pattern ) { push ( @files, $File::Find::name ) if m/$p/ && ! -d; #say ( "FOUND $File::Find::name\n" ) if m/$p/; $File::Find::prune = 1 if !/\./ && -d && !$recursive; } } sub glob2pat { my $globstr = shift; my %patmap = ( '*' => '.*', '?' => '.', '[' => '[', ']' => ']', ); $globstr =~ s{(.)} { $patmap{$1} || "\Q$1" }ge; return '^' . $globstr . '$'; } }

<de: Infos zum WML Code /><en: About the WML Code /> Momentan kein deutscher Text vorhanden (englische Version)

These pages are generated via WML. Since there are not many useful examples of this powerful website generation tool available, I have decided to publish the source code and the build system of this site here:

The build system

The build system consists of traditional GNU-make Makefiles and some additional WML magic to automatically create dependencies.

The templates

The WML page sources

The navigation menu

The structure and the lables are recursivly generated from the buttons files in each directory. The labels can also be localized (see Multilingual below)

Multilingual

Everything enclosed in a language tag (e.g. <de>.. text ..</de>) will only be copied into the output file for the specified language. Everything else is copied into all output files.
Even the navigation bar is generated for every language.