X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=project%2Fcaptive%2Fdoc%2FMacros.pm;h=1b24cf3fcba071b0dfbb98404b3d53e00f297b67;hb=f40e75167a045d189c3027a0b112a20c635d3e48;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..1b24cf3 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,70 +30,36 @@ 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'; - - -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(); -} +Wrequire 'project::Lib'; -sub footer ($) -{ -my($class)=@_; - print vskip "2ex"; - project::captive::doc::Macros->navigate("footer"); - My::Web->footer(); -} +our $HTML_TEST=0; 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 +67,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 +79,51 @@ 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)).''; + return ''.a_href($url,escapeHTML($name)).''; +} +our($Wine,$ReactOS,$LinuxNTFS,$GnomeVFS,$GnomeVFSmodule,$gnulinux,$freespeech,$freebeer); + +sub _footer +{ + print vskip "2ex"; + project::captive::doc::Macros->navigate("footer"); +} + +sub init ($%) +{ +my($class,%args)=@_; + + My::Web->init( + "css_push"=>"./Macros.css", + "heading_novskip"=>1, + "rel_start"=>"..", # possibly overridable + "rel_up"=>".", # possibly overridable + "footing_delimit_sub_push"=>\&_footer, + "__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(); } -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'; 1;