2 # Captive project doc macros.
3 # Copyright (C) 2003-2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 package project::captive::doc::Macros;
20 require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
21 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
28 &doc_img &productname &captive_srcfile
29 $freespeech $freebeer $Wine $ReactOS $LinuxNTFS $GnomeVFS $GnomeVFSmodule $gnulinux
31 our @ISA=qw(Exporter);
35 Wrequire 'project::Lib';
45 project::captive::doc::Macros->navigate("footer");
53 print '<table border="0" width="100%">'."\n";
54 # FIXME: print '<col width="'.$_.'%" />'."\n" for (qw(10 20 40 20 10));
55 # causes whole invisible icons in: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/20050719 Galeon/1.3.21
57 print '<td></td>'."\n";
58 print '<td align="left">';
59 print img "/My/arrow-left" ,"Previous document","a_href"=>$My::Web::W->{"rel_prev"}
60 if $My::Web::W->{"rel_prev"};
62 print '<td align="center">';
63 print img "/My/arrow-up" ,"Parent","a_href"=>$My::Web::W->{"rel_up"}
64 if $My::Web::W->{"rel_up"} && !($where && $where eq "footer");
66 print '<td align="right">';
67 print img "/My/arrow-right","Next document","a_href"=>$My::Web::W->{"rel_next"}
68 if $My::Web::W->{"rel_next"};
70 print '<td></td>'."\n";
72 print '</table>'."\n";
77 my($img_base,$caption)=@_;
80 $r.='<table border="0" width="100%">'."\n";
81 $r.="\t<caption>$caption</caption>\n";
82 $r.="\t".'<tr><td align="center">'.img($img_base,$caption)."</td></tr>\n";
88 sub captive_srcfile ($;$)
90 my($filename,$text)=@_;
92 a_href 'http://cvs.jankratochvil.net/viewcvs/*checkout*/captive/'.$filename.'?rev=HEAD&content-type=text/plain',
100 return '<span class="productname">'.a_href($url,CGI::escapeHTML($name)).'</span>';
102 our($Wine,$ReactOS,$LinuxNTFS,$GnomeVFS,$GnomeVFSmodule,$gnulinux,$freespeech,$freebeer);
109 "css_push"=>"./Macros.css",
110 "heading_novskip"=>1,
111 "rel_start"=>"..", # possibly overridable
112 "rel_up"=>".", # possibly overridable
113 "__PACKAGE__"=>caller(), # possibly overridable
117 $Wine=productname 'http://www.winehq.com/','Wine';
118 $ReactOS=productname 'http://www.reactos.com/','ReactOS';
119 $LinuxNTFS=productname 'http://linux-ntfs.sourceforge.net/','Linux NTFS';
120 $GnomeVFS=productname 'http://developer.gnome.org/doc/API/gnome-vfs/','Gnome-VFS';
121 $GnomeVFSmodule=productname 'http://developer.gnome.org/doc/API/gnome-vfs/modules.html','Gnome-VFS-module';
122 $gnulinux='GNU/Linux';
123 $freespeech=a_href 'http://www.gnu.org/philosophy/free-sw.html','Free';
124 $freebeer=a_href 'http://www.gnu.org/philosophy/free-sw.html','free (as in beer)';
127 print(project::Lib->section("captive"));