Thread: [Btrwiz-commits] CVS: btrwiz/doc/src btren.pm,NONE,1.1 makedoc.pl,NONE,1.1
Brought to you by:
howama
From: Mark H. <ho...@us...> - 2002-08-06 15:18:08
|
Update of /cvsroot/btrwiz/btrwiz/doc/src In directory usw-pr-cvs1:/tmp/cvs-serv7207/doc/src Added Files: btren.pm makedoc.pl Log Message: initial documentation work --- NEW FILE: btren.pm --- #!/usr bin/perl # # BtrWiz documentation translations # package btren; $btren::data = { 'full name' => 'Batch Text Replacer Wizard', 'Version: ' => 'Version: ', 'help docs' => 'Help Documentation', 'index head' => 'BTRWiz is a graphical application for replacing text over multiple files. BTRWiz is given a list of directories and filters, from which it determines the files to be scanned. Each of these files is searched for the find text and all occurances are replaced with the replace text. If the user wishes, these can be interpreted as regular expressions. This document describes the operation of Batch Text Replacer.', 'authors' => 'This help documentation has been written by Mark Howard. This is part of an open source project. We always need more help writing documentation. If you could spare a few moments of time, either to write more documentation, review documentation, or just send encouraging mail, we would be very grateful', # Rewrite the next paragraph to give details of yourself and your # translation. 'translation' => 'This is the native Engligh (GB) documentation by Mark Howard.', 'also avail in' => 'This document is available in the following languages: ', 'please translate' => 'If your language is not listed above, please consider translating the documentation to your own language. It is not a difficult task, involves minimal work and will make a lot of people happy :).', # Various page titles, also used on the index page 'command line options' => 'Command Line Options', 'screens' => 'Wizard Pages', 'Start Screen' => 'Start Screen', 'Development' => 'Development', 'Getting More Help' => 'Getting More Help', 'options head' => 'BTRWiz is primarily a graphical application. In order to make any text replacements, it must (currently) be run as a graphical application. However, we do provide the following command line options:', 'version' => 'Displays a version message and exits', 'help' => 'Displays a help message and exits', 'screens head' => 'BTRWiz is composed of a number of wizard "screens". Each of these performs a specific task in the replacement process. The following page describes the function of each screen', 'welcome screen' => 'Welcome screen', 'welcome details' => 'This page is merely a banner screen for the start of the program. It serves no purpose other than to tell you the program version and a little bit about what the proceeding screens do.', }; 1; --- NEW FILE: makedoc.pl --- #!/usr/bin/perl # # BTRWiz documentation creator # use strict; use warnings; use CGI qw(:standard *table *Tr *td); use CGI::Pretty; use btren; my %locales = ('en' => 'English', ); my $version = '0.0.0.0.1'; &generatehtml; sub generatehtml{ foreach my $locale (keys %locales){ my $data; $data = $btren::data if ($locale eq 'en'); printindex( $locale, $data); printoptions( $locale, $data); printscreens( $locale, $data); printmorehelp( $locale, $data); } } sub printheader{ my $out = shift; my $data = shift; print $out start_html({-style => {src => '../stylesheet.css'}}), start_table({-class => 'head', -cellspacing => 0, -cellpadding => 0, -border => 0 }), Tr( td({-rowspan => 3}, 'LOGO' ), td( h3({-class => 'head'}, $data->{'full name'}) ), ), Tr( td( h2({-class => 'head'}, $data->{'help docs'})), ), Tr( td( p({-class => 'head'}, $data->{"Version: "}, $version)), ), end_table, ; print OUT start_table({-width => '100%'}), start_Tr(), start_td(); print OUT ul( li(a({-href => 'options.html'}, $data->{'command line options'}) ), li( a({-href => 'screens.html'}, $data->{'screens'})), # ul( # li($data->{'Start Screen'} ) # )), li(a({-href => 'morehelp.html'}, $data->{'Getting More Help'})), ), end_td(), start_td(); } sub printfooter{ my $out = shift; my $data = shift; print $out end_td(), end_Tr(), table({-class => 'head', -width=> '100%', -cellspacing => 0, -cellpadding => 0, -border => 0}), Tr( td( p({-class => 'head'}, $data->{'full name'})), td( p({-class => 'head', -align => 'right'}, $data->{'help docs'})) ), end_html; } sub printindex{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/index.html" or die "Unable to open output file, ../user/$locale/index.html\: $!"; printheader( \*OUT, $data); print OUT h1('BTRWiz', $data->{'help docs'}), p( $data->{'index head'} ), p( $data->{'authors'} ), p( $data->{'tranlation'} ), p( $data->{'also avail in'} ), ul( li( a({-href => '../en/index.html'}, 'English') ), ), p( $data->{'please translate'} ); printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/index.html\: $!"; } sub printoptions{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/options.html" or die "Unable to open output file, ../user/$locale/options.html\: $!"; printheader( \*OUT, $data); print OUT h1('BTRWiz', $data->{'command line options'}), p($data->{'options head'}), dl( dt( code('-v, --version') ), dd( $data->{'version'} ), dt( code('-h, --help') ), dd( $data->{'help'} ), ); printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/options.html\: $!"; } sub printmorehelp{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/morehelp.html" or die "Unable to open output file, ../user/$locale/morehelp.html\: $!"; printheader( \*OUT, $data); print OUT h1('BTRWiz', $data->{'Getting More Help'}), p( a({-href => 'mailto:btr...@li...'}, 'btr...@li...') ), ; printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/morehelp.html\: $!"; } sub printscreens{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/screens.html" or die "Unable to open output file, ../user/$locale/screens.html\: $!"; printheader( \*OUT, $data); print OUT h1( $data->{'screens'}), p( $data->{'screens head'} ), h2( $data->{'welcome screen'} ), p( $data->{'welcome details'}), '.', br(), '.', br(), '.', br(), ; printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/screens.html\: $!"; } sub printopns{ my $locale = shift; my $data = shift; open OUT, ">../user/$locale/index.html" or die "Unable to open output file, ../user/$locale/index.html\: $!"; printheader( \*OUT, $data); print OUT h1('BTRWiz', $data->{'help docs'}), ; printfooter( \*OUT, $data); close OUT or die "Unable to close output file, ../$locale/index.html\: $!"; } |