#!/usr/bin/perl # WikiText convertor script, Copyright (C) 2006 Mikhael Goikhman, Enno Cramer # # This program is free software; you can redistribute it and/or modify # it under the terms of the Perl Artistic License or 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. # # 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use strict; use warnings; use FindBin; use lib "$FindBin::Bin/../lib"; use Text::WikiText; use Getopt::Long qw(:config no_ignore_case require_order bundling); my %options = ( format => 'HTML', full_page => 0, title => 'WikiText Converted Page', author => 'Unknown', no_verbatim => 0, heading_offset => 0, flat_lists => 0, ); sub show_usage (;$) { my $is_error = shift || 0; my $out = $is_error ? \*STDERR : \*STDOUT; my $usage = qq{ Convert WikiText to HTML or another format. Usage: $0 [OPTIONS] [file ...] Options: -h --help show this usage -f --format NAME specify format (default: $options{format}) -F --full-page form standard page, i.e. ... -t --title NAME set title (default: $options{title}) -a --author NAME set author (default: $options{author}) -V --no-verbatim do not include verbatim blocks in output -H --heading-offset N set heading offset (default: 0) -l --flat-lists use
...
...