From 40ee28bac9e9524eeaaa52f48cc24c950b918d1e Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 6 Sep 2006 02:00:55 +0000 Subject: Bug 350613: Bugzilla should ship with built perldoc Patch By Max Kanat-Alexander r=colin, a=myk --- docs/makedocs.pl | 70 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 60 insertions(+), 10 deletions(-) (limited to 'docs/makedocs.pl') diff --git a/docs/makedocs.pl b/docs/makedocs.pl index 1b83e5d7a..f74f87cc3 100644 --- a/docs/makedocs.pl +++ b/docs/makedocs.pl @@ -21,17 +21,35 @@ # Contributor(s): Matthew Tuck # Jacob Steenhagen # Colin Ogilvie +# Max Kanat-Alexander # This script compiles all the documentation. -use diagnostics; use strict; -use File::Basename; -use lib(".."); -use Bugzilla::Install::Requirements qw (REQUIRED_MODULES OPTIONAL_MODULES MOD_PERL_MODULES); -use Bugzilla::Constants qw (DB_MODULE); -chdir dirname($0); +# We need to be in this directory to use our libraries. +BEGIN { + require File::Basename; + import File::Basename qw(dirname); + chdir dirname($0); +} + +use lib qw(.. lib); + +# We only compile our POD if Pod::Simple is installed. We do the checks +# this way so that if there's a compile error in Pod::Simple::HTML::Bugzilla, +# makedocs doesn't just silently fail, but instead actually tells us there's +# a compile error. +my $pod_simple; +if (eval { require Pod::Simple }) { + require Pod::Simple::HTMLBatch::Bugzilla; + require Pod::Simple::HTML::Bugzilla; + $pod_simple = 1; +}; + +use Bugzilla::Install::Requirements + qw(REQUIRED_MODULES OPTIONAL_MODULES MOD_PERL_MODULES); +use Bugzilla::Constants qw(DB_MODULE BUGZILLA_VERSION); ############################################################################### # Generate minimum version list @@ -116,14 +134,44 @@ sub MakeDocs { } +sub make_pod { + + print "Creating API documentation...\n"; + + my $converter = Pod::Simple::HTMLBatch::Bugzilla->new; + # Don't output progress information. + $converter->verbose(0); + $converter->html_render_class('Pod::Simple::HTML::Bugzilla'); + + my $doctype = Pod::Simple::HTML::Bugzilla->DOCTYPE; + my $content_type = Pod::Simple::HTML::Bugzilla->META_CT; + my $bz_version = BUGZILLA_VERSION; + + my $contents_start = < + + $content_type + Bugzilla $bz_version API Documentation + + +

Bugzilla $bz_version API Documentation

+END_HTML + + $converter->contents_page_start($contents_start); + $converter->contents_page_end(""); + $converter->add_css('style.css'); + $converter->javascript_flurry(0); + $converter->css_flurry(0); + $converter->batch_convert(['../'], 'html/api/'); + + print "\n"; +} + ############################################################################### # Make the docs ... ############################################################################### -if (!-d 'html') { - unlink 'html'; - mkdir 'html', 0755; -} if (!-d 'txt') { unlink 'txt'; mkdir 'txt', 0755; @@ -133,6 +181,8 @@ if (!-d 'pdf') { mkdir 'pdf', 0755; } +make_pod() if $pod_simple; + chdir 'html'; MakeDocs('separate HTML', "jade -t sgml -i html -d $LDP_HOME/ldp.dsl\#html " . -- cgit v1.2.3-24-g4f1b