Mowyw example: page `bar'

[%include head2%]

## Syntax hilighting

This page contains some syntax hilighting using the [%verbatim foo%] [%syntax perl%] $perlCode [%endsyntax%][%endverbatim foo%] construct. Note that not only perl is support, but every language that vim has a syntax file for.

    [%syntax perl%]
    #!/usr/bin/perl
    # Copyright (C) 2006 by Moritz Andreas Lenz, http://moritz.faui2k3.org/
    # This is free Software. You may use, modify, redistribute... it
    # under the terms of the WTFPL: http://sam.zoy.org/wtfpl/
    #
    # Use it at your own Risk

    use warnings;
    use strict;
    use GD;

    my $width = 1024;
    my $edges = 5;
    my $height = $width;

    foreach $edges (10, 11, 13){
    	my $im = new GD::Image($width,$height);
    	my $black = $im->colorAllocate(0, 0, 0);
    	my $white = $im->colorAllocate(255, 255, 255);
    	$im->fill(1, 1, $white);

    	my @x;
    	my @y;

    	for (my $i = 0; $i < $edges; $i++){
    		$x[$i] = int $width/2 * (1-sin($i * (2*3.14159) / $edges));
    		$y[$i] = int $height/2 * (1-cos($i * (2*3.14159) / $edges));
    	}

    	for (my $i = 0; $i < $edges; $i++){
    		$im->line($x[$i], $y[$i], $x[($i+1)%$edges], $y[($i+1)%$edges], $black);
    	}

    	my $x = $width * rand();
    	my $y = $height * rand();

    	for (0 .. 5000 * $edges * $edges * $edges){
    		my $i = int ($edges*rand());
    		$x = .5*($x + $x[$i]);
    		$y = .5*($y + $y[$i]);
    		$im->setPixel(int $x, int $y, $black);
    	}

    	my $fn = sprintf("sierpinski-%02d.png", $edges);

    	open(OUT, ">", $fn) or die "$0: can't write to file '$fn': $!";
    	print "Writing file $fn\n";

    	binmode OUT;
    	print OUT $im->png;
    	close OUT;
    }
    [%endsyntax%]

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed ut dui ac lacus egestas vehicula. Quisque faucibus, risus id consequat porta, orci ligula condimentum mi, ac commodo leo libero eget tortor. Maecenas a ligula in nibh luctus gravida. Praesent vehicula rhoncus tortor. Donec porta rutrum dui. Donec dignissim congue mauris. Sed rhoncus laoreet sem. Nam dui pede, vestibulum convallis, posuere ut, dictum eu, diam. Phasellus nunc. Ut eget ante a ipsum porttitor scelerisque. Quisque auctor elit vitae massa. Vestibulum massa risus, gravida quis, hendrerit sit amet, bibendum sit amet, enim. Fusce nulla. Quisque vulputate metus vitae orci. Pellentesque at arcu. Ut sed neque.

[%menu nav bar%]