From 8ab64629d3a091a0ccb6af52c48ee7bb9fd8834d Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Fri, 4 Apr 2008 00:05:36 +0000 Subject: Bug 182975: Bugzilla directory structure to be adopted to l10n needs - Patch by A.A. Shimono (himorin) r=LpSolit r=mkanat a=LpSolit --- docs/makedocs.pl | 85 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 29 deletions(-) (limited to 'docs/makedocs.pl') diff --git a/docs/makedocs.pl b/docs/makedocs.pl index 1b9a44296..ae5ba4057 100644 --- a/docs/makedocs.pl +++ b/docs/makedocs.pl @@ -26,6 +26,7 @@ # This script compiles all the documentation. use strict; +use Cwd; # We need to be in this directory to use our libraries. BEGIN { @@ -58,7 +59,7 @@ use Bugzilla::Constants qw(DB_MODULE BUGZILLA_VERSION); my $modules = REQUIRED_MODULES; my $opt_modules = OPTIONAL_MODULES; -open(ENTITIES, '>', 'xml/bugzilla.ent') or die('Could not open xml/bugzilla.ent: ' . $!); +open(ENTITIES, '>', 'bugzilla.ent') or die('Could not open bugzilla.ent: ' . $!); print ENTITIES '' ."\n\n"; print ENTITIES '' . "\n"; foreach my $module (@$modules, @$opt_modules) @@ -156,10 +157,10 @@ END_HTML $converter->contents_page_start($contents_start); $converter->contents_page_end(""); - $converter->add_css('style.css'); + $converter->add_css('./../../../style.css'); $converter->javascript_flurry(0); $converter->css_flurry(0); - $converter->batch_convert(['../'], 'html/api/'); + $converter->batch_convert(['../../'], 'html/api/'); print "\n"; } @@ -168,38 +169,64 @@ END_HTML # Make the docs ... ############################################################################### -if (!-d 'txt') { - unlink 'txt'; - mkdir 'txt', 0755; +my @langs; +# search for sub directories which have a 'xml' sub-directory +opendir(LANGS, './'); +foreach my $dir (readdir(LANGS)) { + next if (($dir eq '.') || ($dir eq '..') || (! -d $dir)); + if (-d "$dir/xml") { + push(@langs, $dir); + } } -if (!-d 'pdf') { - unlink 'pdf'; - mkdir 'pdf', 0755; -} - -make_pod() if $pod_simple; -exit unless $build_docs; - -chdir 'html'; - -MakeDocs('separate HTML', "jade -t sgml -i html -d $LDP_HOME/ldp.dsl\#html " . +closedir(LANGS); + +my $docparent = getcwd(); +foreach my $lang (@langs) { + chdir "$docparent/$lang"; + MakeDocs(undef, 'cp ../bugzilla.ent ./xml/'); + + if (!-d 'txt') { + unlink 'txt'; + mkdir 'txt', 0755; + } + if (!-d 'pdf') { + unlink 'pdf'; + mkdir 'pdf', 0755; + } + if (!-d 'html') { + unlink 'html'; + mkdir 'html', 0755; + } + if (!-d 'html/api') { + unlink 'html/api'; + mkdir 'html/api', 0755; + } + + make_pod() if $pod_simple; + next unless $build_docs; + + chdir 'html'; + + MakeDocs('separate HTML', "jade -t sgml -i html -d $LDP_HOME/ldp.dsl\#html " . "$JADE_PUB/xml.dcl ../xml/Bugzilla-Guide.xml"); -MakeDocs('big HTML', "jade -V nochunks -t sgml -i html -d " . + MakeDocs('big HTML', "jade -V nochunks -t sgml -i html -d " . "$LDP_HOME/ldp.dsl\#html $JADE_PUB/xml.dcl " . "../xml/Bugzilla-Guide.xml > Bugzilla-Guide.html"); -MakeDocs('big text', "lynx -dump -justify=off -nolist Bugzilla-Guide.html " . + MakeDocs('big text', "lynx -dump -justify=off -nolist Bugzilla-Guide.html " . "> ../txt/Bugzilla-Guide.txt"); -if (! grep($_ eq "--with-pdf", @ARGV)) { - exit; -} + if (! grep($_ eq "--with-pdf", @ARGV)) { + next; + } -MakeDocs('PDF', "jade -t tex -d $LDP_HOME/ldp.dsl\#print $JADE_PUB/xml.dcl " . + MakeDocs('PDF', "jade -t tex -d $LDP_HOME/ldp.dsl\#print $JADE_PUB/xml.dcl " . '../xml/Bugzilla-Guide.xml'); -chdir '../pdf'; -MakeDocs(undef, 'mv ../xml/Bugzilla-Guide.tex .'); -MakeDocs(undef, 'pdfjadetex Bugzilla-Guide.tex'); -MakeDocs(undef, 'pdfjadetex Bugzilla-Guide.tex'); -MakeDocs(undef, 'pdfjadetex Bugzilla-Guide.tex'); -MakeDocs(undef, 'rm Bugzilla-Guide.tex Bugzilla-Guide.log Bugzilla-Guide.aux Bugzilla-Guide.out'); + chdir '../pdf'; + MakeDocs(undef, 'mv ../xml/Bugzilla-Guide.tex .'); + MakeDocs(undef, 'pdfjadetex Bugzilla-Guide.tex'); + MakeDocs(undef, 'pdfjadetex Bugzilla-Guide.tex'); + MakeDocs(undef, 'pdfjadetex Bugzilla-Guide.tex'); + MakeDocs(undef, 'rm Bugzilla-Guide.tex Bugzilla-Guide.log Bugzilla-Guide.aux Bugzilla-Guide.out'); + +} -- cgit v1.2.3-24-g4f1b