From 7727ab02734783b8fd3082b55976f6b818f7529f Mon Sep 17 00:00:00 2001 From: short <> Date: Mon, 13 Oct 2003 12:02:17 +0000 Subject: [PATCH] +link rel --- autogen.pl | 1 + project/Index.html.pl | 2 + project/Makefile.am | 3 +- project/Rel.pl | 66 ++++++++++++++++++++++++++++++++ project/captive/Preview.html.pl | 3 ++ project/captive/Resources.html.pl | 3 ++ project/captive/Thanks.html.pl | 8 +++- project/captive/doc/APITypes.html.pl | 8 ++-- project/captive/doc/About.html.pl | 8 ++-- project/captive/doc/Architecture.html.pl | 8 ++-- project/captive/doc/CacheManager.html.pl | 8 ++-- project/captive/doc/CallType.html.pl | 8 ++-- project/captive/doc/Components.html.pl | 8 ++-- project/captive/doc/Details.html.pl | 8 ++-- project/captive/doc/Index.html.pl | 9 ++--- project/captive/doc/LinuxNTFS.html.pl | 7 ++-- project/captive/doc/Macros.pm | 54 ++++++++++++++++++++++++-- project/captive/doc/Related.html.pl | 8 ++-- project/captive/doc/Reverse.html.pl | 8 ++-- project/captive/doc/TODO.html.pl | 8 ++-- 20 files changed, 181 insertions(+), 55 deletions(-) create mode 100755 project/Rel.pl diff --git a/autogen.pl b/autogen.pl index da0ac40..7e3ab3b 100755 --- a/autogen.pl +++ b/autogen.pl @@ -53,5 +53,6 @@ AutoGen->run( ./project/LaserGame/*.gif ./project/Islet/*.gif ./project/surprise/*.gif + ./My/*.gif )], ); diff --git a/project/Index.html.pl b/project/Index.html.pl index b962a06..6c82b46 100755 --- a/project/Index.html.pl +++ b/project/Index.html.pl @@ -34,6 +34,8 @@ My::Web->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Project List', "section"=>"Projects", + "rel_up"=>top_dir(), + "rel_start"=>top_dir(), ); My::Web->heading(); diff --git a/project/Makefile.am b/project/Makefile.am index ee556d6..9c90d93 100644 --- a/project/Makefile.am +++ b/project/Makefile.am @@ -82,4 +82,5 @@ EXTRA_DIST+= \ Index.html.pl \ ChangeLog.txt.pl \ Pod2Html.html.pl \ - List.html.pl + List.html.pl \ + Rel.pl diff --git a/project/Rel.pl b/project/Rel.pl new file mode 100755 index 0000000..b5856a4 --- /dev/null +++ b/project/Rel.pl @@ -0,0 +1,66 @@ +#! /usr/bin/perl +# +# $Id$ +# List of projects Perl template. +# Copyright (C) 2003 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 +# the Free Software Foundation; exactly version 2 of June 1991 is required +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +package project::Index; +require 5.6.0; # at least 'use warnings;' but we need some 5.6.0+ modules anyway +our $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; }; +our $CVS_ID=q$Id$; +use strict; +use warnings; + +BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,)[0]]}; eval "use lib '$top_dir'"; close F; } +use My::Web; +use Apache::Constants qw(MOVED); +Wrequire 'My::Project'; + + +my $W=My::Web->init( + "__PACKAGE__"=>__PACKAGE__, + "header_only"=>1, + "args_check"=>{ + "rel"=>'^(?:prev|next)$', + "project"=>'^\w+$', + }, + ); + +my %item=( My::Project::item_hash_read() ); +my @platforms=@My::Project::platforms; +my @projects=(); +while (@platforms) { + my $platform_sym =shift @platforms; + my $platform_name=shift @platforms; + push @projects,sort { + ($item{$b}{"priority"} <=> $item{$a}{"priority"}) + or + (lc($item{$a}{"name"}) cmp lc($item{$b}{"name"})); + } map({ $item{$_}{"platform"} ne $platform_sym ? () : ($_); } keys(%item)); + } +my $target=undef(); +for (0..$#projects) { + next if $projects[$_] ne $W->{"args"}{"project"}; + $target=$projects[$_-1] if $_>0 && $W->{"args"}{"rel"} eq "prev"; + $target=$projects[$_+1] if $_<$#projects && $W->{"args"}{"rel"} eq "next"; + last if $target; + } + +$W->{"r"}->status(MOVED); +$W->{"r"}->header_out("Location"=>"http://".$W->{"r"}->hostname() + .":7680" # DEBUG + ."/project/".(!$target ? "" : "$target/")); diff --git a/project/captive/Preview.html.pl b/project/captive/Preview.html.pl index 4ea9d32..8630c18 100755 --- a/project/captive/Preview.html.pl +++ b/project/captive/Preview.html.pl @@ -27,6 +27,7 @@ use warnings; BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,)[0]]}; eval "use lib '$top_dir'"; close F; } use My::Web; +Wrequire 'My::Project'; My::Web->init( @@ -36,8 +37,10 @@ My::Web->init( td { padding: 10px; text-align: center; } table { border-collapse: collapse; border-style: solid; } ", + "WebConfig::heading_novskip"=>1, ); My::Web->heading(); +print My::Project->section("captive"); print "

Captive NTFS Technology Preview

\n"; diff --git a/project/captive/Resources.html.pl b/project/captive/Resources.html.pl index c24ec8b..eb6aacb 100755 --- a/project/captive/Resources.html.pl +++ b/project/captive/Resources.html.pl @@ -27,13 +27,16 @@ use warnings; BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,)[0]]}; eval "use lib '$top_dir'"; close F; } use My::Web; +Wrequire 'My::Project'; My::Web->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Internet Resources', + "WebConfig::heading_novskip"=>1, ); My::Web->heading(); +print My::Project->section("captive"); print "

Captive NTFS Internet Resources

\n"; diff --git a/project/captive/Thanks.html.pl b/project/captive/Thanks.html.pl index efd463f..c3a87d5 100755 --- a/project/captive/Thanks.html.pl +++ b/project/captive/Thanks.html.pl @@ -27,6 +27,7 @@ use warnings; BEGIN{ open F,"Makefile"; our $top_dir=pop @{[split /\s/,(grep /^top_srcdir/,)[0]]}; eval "use lib '$top_dir'"; close F; } use My::Web; +Wrequire 'My::Project'; My::Web->init( @@ -35,8 +36,11 @@ My::Web->init( "head_css"=>" .name { font-style: italic; } ", + "WebConfig::heading_novskip"=>1, ); My::Web->heading(); +print My::Project->section("captive"); + print <<'HERE';

Captive NTFS Thanks

@@ -67,9 +71,9 @@ print name "Tomas Bures"; print name a_href_cz('http://www.vellum.cz/','Lukas "Klokan" Horalek'),undef(),"services hosting"; print name a_href('http://www-troja.fjfi.cvut.cz/~drab/','Martin Drab'),undef(), "betatesting, ".a_href('http://lufs.sourceforge.net/lufs/','LUFS')." patches"; -print name "Jesse Glick",a_href("http://www.sun.com/","Sun Microsystems"),"betatesting"; print name a_href('http://www.pavouk.org/','Pavel "Pavouk" Ruzicka'),a_href('http://www.gtsgroup.cz/','GTS'), "betatesting"; +print name "Jesse Glick",a_href("http://www.sun.com/","Sun Microsystems"),"betatesting"; print name a_href_cz('http://vellum.cz/~mikc/','Michal "MIKC" Conos'),undef(), "betatesting"; print name a_href("http://sys.xiloo.com/","Matt Wu"), @@ -78,7 +82,7 @@ print name a_href("http://sys.xiloo.com/","Matt Wu"), print name "Steven Edwards" ,a_href("http://www.reactos.com/","ReactOS")." developer","W32 tips"; print name "Casper Hornstrup",a_href("http://www.reactos.com/","ReactOS")." developer","W32 tips"; print <<'HERE'; -
  • Last but not least - greetings to Danese Cooper, Open Source Diva!
  • +
  • Last but not least - Kind greetings to Danese Cooper, Open Source Diva!
  • HERE diff --git a/project/captive/doc/APITypes.html.pl b/project/captive/doc/APITypes.html.pl index 0f0957a..9d62faf 100755 --- a/project/captive/doc/APITypes.html.pl +++ b/project/captive/doc/APITypes.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: API Functions', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'Details.html.pl', + "rel_next"=>'CallType.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -477,4 +477,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/About.html.pl b/project/captive/doc/About.html.pl index 757f6ad..444d98d 100755 --- a/project/captive/doc/About.html.pl +++ b/project/captive/doc/About.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: About', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'Index.html.pl', + "rel_next"=>'Architecture.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -137,4 +137,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/Architecture.html.pl b/project/captive/doc/Architecture.html.pl index 48a4058..0f982ca 100755 --- a/project/captive/doc/Architecture.html.pl +++ b/project/captive/doc/Architecture.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: Architecture', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'About.html.pl', + "rel_next"=>'Components.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -211,4 +211,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/CacheManager.html.pl b/project/captive/doc/CacheManager.html.pl index 778e412..fcd893e 100755 --- a/project/captive/doc/CacheManager.html.pl +++ b/project/captive/doc/CacheManager.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: NT Cache Manager', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'Reverse.html.pl', + "rel_next"=>'Details.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -316,4 +316,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/CallType.html.pl b/project/captive/doc/CallType.html.pl index 4346c95..d1e3049 100755 --- a/project/captive/doc/CallType.html.pl +++ b/project/captive/doc/CallType.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: API Calling Conventions', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'APITypes.html.pl', + "rel_next"=>'TODO.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -160,4 +160,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/Components.html.pl b/project/captive/doc/Components.html.pl index 9335919..c182074 100755 --- a/project/captive/doc/Components.html.pl +++ b/project/captive/doc/Components.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: Components', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'Architecture.html.pl', + "rel_next"=>'Reverse.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -276,4 +276,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/Details.html.pl b/project/captive/doc/Details.html.pl index d31b085..be27aab 100755 --- a/project/captive/doc/Details.html.pl +++ b/project/captive/doc/Details.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: Implementation Details', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'CacheManager.html.pl', + "rel_next"=>'APITypes.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -501,4 +501,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/Index.html.pl b/project/captive/doc/Index.html.pl index 1f4852c..3e7262f 100755 --- a/project/captive/doc/Index.html.pl +++ b/project/captive/doc/Index.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation', - "head_css"=>$doc_Macros_head_css, + "rel_next"=>'About.html.pl', + "rel_up"=>top_dir("/project/captive/"), ); -My::Web->heading(); print <<"HERE"; @@ -44,7 +44,6 @@ print <<"HERE";

    Captive NTFS Developer Documentation

    -
    • About @@ -161,4 +160,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/LinuxNTFS.html.pl b/project/captive/doc/LinuxNTFS.html.pl index fc5ffae..7d2393d 100755 --- a/project/captive/doc/LinuxNTFS.html.pl +++ b/project/captive/doc/LinuxNTFS.html.pl @@ -31,12 +31,11 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: Captive vs. Linux-NTFS', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'Related.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -88,4 +87,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/Macros.pm b/project/captive/doc/Macros.pm index c2c3e09..4197b60 100755 --- a/project/captive/doc/Macros.pm +++ b/project/captive/doc/Macros.pm @@ -28,16 +28,26 @@ use warnings; use Exporter; our @EXPORT=qw( &doc_img &productname &captive_srcfile - $doc_Macros_head_css $freespeech $freebeer $Wine $ReactOS $LinuxNTFS $GnomeVFS $GnomeVFSmodule $gnulinux + $freespeech $freebeer $Wine $ReactOS $LinuxNTFS $GnomeVFS $GnomeVFSmodule $gnulinux ); 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'; -our $doc_Macros_head_css=" +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; } @@ -47,8 +57,46 @@ our $doc_Macros_head_css=" .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(); +} + +sub footer ($) +{ +my($class)=@_; + print vskip "2ex"; + project::captive::doc::Macros->navigate("footer"); + My::Web->footer(); +} + +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 a_href $My::Web::W->{"rel_prev"},img("/My/arrow-left" ,"Previous document") + if $My::Web::W->{"rel_prev"}; + print ''; + print a_href $My::Web::W->{"rel_up"} ,img("/My/arrow-up" ,"Parent") + if $My::Web::W->{"rel_up"} && !($where && $where eq "footer"); + print ''; + print a_href $My::Web::W->{"rel_next"},img("/My/arrow-right","Next document") + if $My::Web::W->{"rel_next"}; + print '
      '."\n"; +} sub doc_img ($$) { diff --git a/project/captive/doc/Related.html.pl b/project/captive/doc/Related.html.pl index 5ba1abe..98de84d 100755 --- a/project/captive/doc/Related.html.pl +++ b/project/captive/doc/Related.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: Related Projects', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'TODO.html.pl', + "rel_next"=>'LinuxNTFS.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -119,4 +119,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/Reverse.html.pl b/project/captive/doc/Reverse.html.pl index ac89f79..d444c87 100755 --- a/project/captive/doc/Reverse.html.pl +++ b/project/captive/doc/Reverse.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: Reverse Engineering', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'Components.html.pl', + "rel_next"=>'CacheManager.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -185,4 +185,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); diff --git a/project/captive/doc/TODO.html.pl b/project/captive/doc/TODO.html.pl index 30e052b..8085863 100755 --- a/project/captive/doc/TODO.html.pl +++ b/project/captive/doc/TODO.html.pl @@ -31,12 +31,12 @@ require CGI; BEGIN { Wuse 'project::captive::doc::Macros'; } -My::Web->init( +project::captive::doc::Macros->init( "__PACKAGE__"=>__PACKAGE__, "title"=>'Captive NTFS Developer Documentation: TODO', - "head_css"=>$doc_Macros_head_css, + "rel_prev"=>'CallType.html.pl', + "rel_next"=>'Related.html.pl', ); -My::Web->heading(); print <<"HERE"; @@ -85,4 +85,4 @@ print <<"HERE"; HERE -My::Web->footer(); +project::captive::doc::Macros->footer(); -- 1.8.3.1