summaryrefslogtreecommitdiffstats
path: root/docs/makedocs.pl
diff options
context:
space:
mode:
Diffstat (limited to 'docs/makedocs.pl')
-rwxr-xr-xdocs/makedocs.pl50
1 files changed, 36 insertions, 14 deletions
diff --git a/docs/makedocs.pl b/docs/makedocs.pl
index 4f0f52579..be5573080 100755
--- a/docs/makedocs.pl
+++ b/docs/makedocs.pl
@@ -26,7 +26,8 @@ use strict;
use Cwd;
use File::Find;
-use File::Copy;
+use File::Basename;
+use File::Copy::Recursive qw(rcopy);
# We need to be in this directory to use our libraries.
BEGIN {
@@ -48,7 +49,8 @@ if (eval { require Pod::Simple }) {
$pod_simple = 1;
};
-use Bugzilla::Constants qw(BUGZILLA_VERSION);
+use Bugzilla;
+use Bugzilla::Constants qw(BUGZILLA_VERSION bz_locations);
use File::Path qw(rmtree);
use File::Which qw(which);
@@ -126,23 +128,43 @@ foreach my $lang (@langs) {
next if grep { $_ eq '--pod-only' } @ARGV;
- # Collect up local extension documentation into the extensions/ dir.
- sub wanted {
- if ($File::Find::dir =~ /\/doc\/?$/ &&
- $_ =~ /\.rst$/)
- {
- copy($File::Find::name, "rst/extensions");
+ chdir $docparent;
+
+ # Generate extension documentation, both normal and API
+ my $ext_dir = bz_locations()->{'extensionsdir'};
+ my @ext_paths = grep { $_ !~ /\/create\.pl$/ && ! -e "$_/disabled" }
+ glob("$ext_dir/*");
+ my %extensions;
+ foreach my $item (@ext_paths) {
+ my $basename = basename($item);
+ if (-d "$item/docs/$lang/rst") {
+ $extensions{$basename} = "$item/docs/$lang/rst";
}
- };
+ }
+ # Collect up local extension documentation into the extensions/ dir.
# Clear out old extensions docs
rmtree('rst/extensions', 0, 1);
mkdir('rst/extensions');
-
- find({
- 'wanted' => \&wanted,
- 'no_chdir' => 1,
- }, "$docparent/../extensions");
+ rmtree('rst/api/extensions', 0, 1);
+ mkdir('rst/api/extensions');
+
+ foreach my $ext_name (keys %extensions) {
+ foreach my $path (glob($extensions{$ext_name} . "/*")) {
+ my ($file, $dir) = fileparse($path);
+ if ($file eq 'api') {
+ my $dst = "$docparent/$lang/rst/api/extensions/$ext_name";
+ mkdir($dst) unless -d $dst;
+ rcopy("$path/*", $dst);
+ next;
+ }
+ my $dst = "$docparent/$lang/rst/extensions/$ext_name";
+ mkdir($dst) unless -d $dst;
+ rcopy($path, "$dst/$file");
+ }
+ }
+
+ chdir "$docparent/$lang";
MakeDocs('HTML', 'make html');
MakeDocs('TXT', 'make text');