4 # Captive project doc macros.
5 # Copyright (C) 2003 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; exactly version 2 of June 1991 is required
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 package project::captive::doc::Macros;
22 require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway
23 our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
30 &doc_img &productname &captive_srcfile
31 $freespeech $freebeer $Wine $ReactOS $LinuxNTFS $GnomeVFS $GnomeVFSmodule $gnulinux
33 our @ISA=qw(Exporter);
35 BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,<F>)[0]]}; eval "use lib '$top_dir'"; close F; }
38 Wrequire 'My::Project';
46 "rel_start"=>top_dir("/project/captive/"),
47 "rel_up"=>top_dir("/project/captive/doc/"),
51 .productname { font-family: cursive; }
52 .fname { font-family: monospace; }
53 .constant { font-family: monospace; }
54 .author { font-family: cursive; }
55 .stuff { font-style: italic; font-size: larger; margin-left: 20%; margin-right: 10%; }
56 .function { font-family: monospace; }
57 .type { font-family: monospace; }
58 .command { font-family: monospace; }
59 .instruction { font-style: italic; }
61 "WebConfig::heading_novskip"=>1,
65 print My::Project->section("captive");
74 project::captive::doc::Macros->navigate("footer");
82 print '<table border="0" width="100%"><tr>'."\n";
83 print '<col width="'.$_.'%" />'."\n" for (qw(10 20 40 20 10));
84 print '<td></td>'."\n";
85 print '<td align="left">';
86 print a_href $My::Web::W->{"rel_prev"},img("/My/arrow-left" ,"Previous document")
87 if $My::Web::W->{"rel_prev"};
89 print '<td align="center">';
90 print a_href $My::Web::W->{"rel_up"} ,img("/My/arrow-up" ,"Parent")
91 if $My::Web::W->{"rel_up"} && !($where && $where eq "footer");
93 print '<td align="right">';
94 print a_href $My::Web::W->{"rel_next"},img("/My/arrow-right","Next document")
95 if $My::Web::W->{"rel_next"};
97 print '<td></td>'."\n";
98 print '</tr></table>'."\n";
103 my($img_base,$caption)=@_;
106 $r.='<table border="0" align="center">'."\n";
107 $r.="\t<tr><td>".img($img_base,$caption)."</td></tr>\n";
108 $r.="\t<caption>$caption</caption>\n";
114 sub captive_srcfile ($;$)
116 my($filename,$text)=@_;
118 a_href 'http://cvs.jankratochvil.net/viewcvs/*checkout*/priv/captive/'.$filename.'?rev=HEAD',
119 ($text || $filename);
122 our $freespeech=a_href 'http://www.gnu.org/philosophy/free-sw.html','Free';
123 our $freebeer=a_href 'http://www.gnu.org/philosophy/free-sw.html','free (as in beer)';
129 return '<span class="productname">'.a_href($url,CGI::escapeHTML($name)).'</span>';
131 our $Wine=productname 'http://www.winehq.com/','Wine';
132 our $ReactOS=productname 'http://www.reactos.com/','ReactOS';
133 our $LinuxNTFS=productname 'http://linux-ntfs.sourceforge.net/','Linux NTFS';
134 our $GnomeVFS=productname 'http://developer.gnome.org/doc/API/gnome-vfs/','Gnome-VFS';
135 our $GnomeVFSmodule=productname 'http://developer.gnome.org/doc/API/gnome-vfs/modules.html','Gnome-VFS-module';
136 our $gnulinux='GNU/Linux';