#!/usr/bin/perl # roqdocbuild; # Last updated: 2008-04-17 $version = '3.0'; $copyyear = '2008'; =head1 Roqet Document Builder A perl script to convert a text file that is in - regular ascii, - Roqet Document Format, - POD HTML Format (which was previously converted from POD format) or - a script (Perl, SQL, etc.) ... into a Roqet HTML document. =head2 Roqet Document Format The format of an Roqet Document Format is as follows: - (comment) @ heading (heading) * bullet command = description and [examples] (descriptive line) [code] {{link~~linkname}} {*imagelink*} [[ preformatted block (puts in
 tag block)
  ]]
- -->import:filename to import an external file into 
 tag block

=head2 The Template File

  The HTML Template File can contain these tags
  (*title*)
  (*title_extra*)
  (*author*)
  (*css_background_image*)
  (*content*)
  (*body*)
  (*copyright*)
  (*draftdate*)

=head1 ChangeLog

  2004-06-08 :: 1.5 :: fixed = error when inside a codeblock
  2004-06-11 :: 1.6 :: added ability to handle preformat tags; [[ and ]]
  2004-06-15 :: 1.7 :: modified link method to {{link~~linkname}}
  2004-06-30 :: 1.8 :: tabulated command-lists; looks much nicer
  2004-09-15 :: 1.9 :: rebranding and pod cleanup
  2005-05-26 :: 2.0 :: added -->import:filename command
  2005-06-02 :: 2.1 :: modified to truncate preformatted output
  2006-08-21 :: 2.2 :: changed output format of "=" areas
  2006-08-28 :: 2.3 :: removed use of xml file and added use of params to 
                       work in a makefile
  2006-09-20 :: 2.5 :: removed named sublink from software page link
  2006-11-21 :: 2.6 :: added changelog create subroutine
  2006-12-04 :: 2.7 :: modified footer to display original file type
  2008-01-24 :: 2.8 :: added image link method: {* *} 
  2008-04-16 :: 2.9 :: added wiki-format create subroutine (to bulk-create
                       pages for RoqWiki)
  2008-04-17 :: 3.0 :: added roqet document format upgrate subroutine to
                       upgrade roqet document formatted files to v2.0
                       Modified changelog conversion to fit new format too

=head1 Author

  roqet 

=head1 Copyright

  RoqDocBuild Perl script copyright 2006 roqet .
  RoqDocBuild et al can be distributed and modified under the terms of the
  GNU General Public License: http://www.gnu.org/copyleft/gpl.html

  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; either version 2 of the License, or
  (at your option) any later version.

  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.

  Updates and other scripts and software available at:
  http://www.roqet.org/software.html
   ~~~
   'l'
    -

=cut

if ($ARGV[0] eq '') {die "Parameters not entered!\n";}
$input_file = $ARGV[0];
$template_file = $ARGV[1];
$output_file = $ARGV[2];
$author = $ARGV[3];
$title = $ARGV[4];
$title_extra = $ARGV[5];
$type = $ARGV[6];

print "Roqet Document Builder v$version\n";
print "Copyright $copyyear roqet \n";

undef (@textfile);
open TEXTIN, $input_file or die "error opening " . $input_file . ": $!\n";
@textfile = ;    
close TEXTIN;

if ($type ne 'upgrade') {
  open TEMPLATE, $template_file or die "error opening " . $template_file . ": $!\n";
  @templatefile =