X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=project%2Fcaptive%2Fdoc%2FMacros.pm;h=c247d6f8e26a51b83188293571e2b544214a0314;hb=f37f652212eb6cb31136488d14d2c2a3908fe30a;hp=a30562ec6db3faa79af6947521ab649cc01032a0;hpb=b4ddfba5b53a40e47285f8851e1ff7bb5419909b;p=www.jankratochvil.net.git diff --git a/project/captive/doc/Macros.pm b/project/captive/doc/Macros.pm index a30562e..c247d6f 100755 --- a/project/captive/doc/Macros.pm +++ b/project/captive/doc/Macros.pm @@ -1,8 +1,6 @@ -#! /usr/bin/perl -# # $Id$ # Captive project doc macros. -# Copyright (C) 2003 Jan Kratochvil +# Copyright (C) 2003-2005 Jan Kratochvil # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,39 +30,12 @@ our @EXPORT=qw( ); our @ISA=qw(Exporter); -BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,)[0]]}; eval "use lib '$top_dir'"; close F; } use My::Web; require CGI; -Wrequire 'My::Project'; +Wrequire 'project::Lib'; -sub init ($%) -{ -my($class,%args)=@_; - - %args=( - "rel_start"=>top_dir("/project/captive/"), - "rel_up"=>top_dir("/project/captive/doc/"), - %args); - My::Web->init( - "head_css"=>" -.productname { font-family: cursive; } -.fname { font-family: monospace; } -.constant { font-family: monospace; } -.author { font-family: cursive; } -.stuff { font-style: italic; font-size: larger; margin-left: 20%; margin-right: 10%; } -.function { font-family: monospace; } -.type { font-family: monospace; } -.command { font-family: monospace; } -.instruction { font-style: italic; } -", - "WebConfig::heading_novskip"=>1, - %args, - ); - My::Web->heading(); - print My::Project->section("captive"); - $class->navigate(); -} +our $HTML_TEST=0; sub footer ($) { @@ -79,23 +50,26 @@ sub navigate ($;$) { my($class,$where)=@_; - print ''."\n"; - print ''."\n" for (qw(10 20 40 20 10)); - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print ''."\n"; - print '
'; - print img "/My/arrow-left" ,"Previous document","a_href"=>$My::Web::W->{"rel_prev"} - if $My::Web::W->{"rel_prev"}; - print ''; - print img "/My/arrow-up" ,"Parent","a_href"=>$My::Web::W->{"rel_up"} - if $My::Web::W->{"rel_up"} && !($where && $where eq "footer"); - print ''; - print img "/My/arrow-right","Next document","a_href"=>$My::Web::W->{"rel_next"} - if $My::Web::W->{"rel_next"}; - print '
'."\n"; + print ''."\n"; + # FIXME: print ''."\n" for (qw(10 20 40 20 10)); + # causes whole invisible icons in: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050719 Galeon/1.3.21 + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print ''."\n"; + print '
'; + print img "/My/arrow-left" ,"Previous document","a_href"=>$My::Web::W->{"rel_prev"} + if $My::Web::W->{"rel_prev"}; + print ''; + print img "/My/arrow-up" ,"Parent","a_href"=>$My::Web::W->{"rel_up"} + if $My::Web::W->{"rel_up"} && !($where && $where eq "footer"); + print ''; + print img "/My/arrow-right","Next document","a_href"=>$My::Web::W->{"rel_next"} + if $My::Web::W->{"rel_next"}; + print '
'."\n"; } sub doc_img ($$) @@ -103,9 +77,9 @@ sub doc_img ($$) my($img_base,$caption)=@_; my $r=""; - $r.=''."\n"; - $r.="\t\n"; + $r.='
".img($img_base,$caption)."
'."\n"; $r.="\t\n"; + $r.="\t".'\n"; $r.='
$caption
'.img($img_base,$caption)."
'."\n"; $r.=vskip "2ex"; return $r; @@ -115,25 +89,44 @@ sub captive_srcfile ($;$) { my($filename,$text)=@_; - a_href 'http://cvs.jankratochvil.net/viewcvs/*checkout*/captive/'.$filename.'?rev=HEAD', + a_href 'http://cvs.jankratochvil.net/viewcvs/*checkout*/captive/'.$filename.'?rev=HEAD&content-type=text/plain', ($text || $filename); } -our $freespeech=a_href 'http://www.gnu.org/philosophy/free-sw.html','Free'; -our $freebeer=a_href 'http://www.gnu.org/philosophy/free-sw.html','free (as in beer)'; - sub productname { my($url,$name)=@_; return ''.a_href($url,CGI::escapeHTML($name)).''; } -our $Wine=productname 'http://www.winehq.com/','Wine'; -our $ReactOS=productname 'http://www.reactos.com/','ReactOS'; -our $LinuxNTFS=productname 'http://linux-ntfs.sourceforge.net/','Linux NTFS'; -our $GnomeVFS=productname 'http://developer.gnome.org/doc/API/gnome-vfs/','Gnome-VFS'; -our $GnomeVFSmodule=productname 'http://developer.gnome.org/doc/API/gnome-vfs/modules.html','Gnome-VFS-module'; -our $gnulinux='GNU/Linux'; +our($Wine,$ReactOS,$LinuxNTFS,$GnomeVFS,$GnomeVFSmodule,$gnulinux,$freespeech,$freebeer); + +sub init ($%) +{ +my($class,%args)=@_; + + My::Web->init( + "css_push"=>"./Macros.css", + "heading_novskip"=>1, + "rel_start"=>"..", # possibly overridable + "rel_up"=>".", # possibly overridable + "__PACKAGE__"=>caller(), # possibly overridable + %args, + ); + + $Wine=productname 'http://www.winehq.com/','Wine'; + $ReactOS=productname 'http://www.reactos.com/','ReactOS'; + $LinuxNTFS=productname 'http://linux-ntfs.sourceforge.net/','Linux NTFS'; + $GnomeVFS=productname 'http://developer.gnome.org/doc/API/gnome-vfs/','Gnome-VFS'; + $GnomeVFSmodule=productname 'http://developer.gnome.org/doc/API/gnome-vfs/modules.html','Gnome-VFS-module'; + $gnulinux='GNU/Linux'; + $freespeech=a_href 'http://www.gnu.org/philosophy/free-sw.html','Free'; + $freebeer=a_href 'http://www.gnu.org/philosophy/free-sw.html','free (as in beer)'; + + My::Web->heading(); + print(project::Lib->section("captive")); + $class->navigate(); +} 1;