Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
edef0e4e
Commit
edef0e4e
authored
May 11, 2015
by
Gervase Markham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1144086 - Move extension docs assembly from makedocs.pl to conf.py. r=dkl,a=glob
parent
f805627e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
27 deletions
+46
-27
conf.py
docs/en/rst/conf.py
+40
-0
.gitignore
docs/en/rst/extensions/.gitignore
+6
-0
makedocs.pl
docs/makedocs.pl
+0
-27
No files found.
docs/en/rst/conf.py
View file @
edef0e4e
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
# serve to show the default.
# serve to show the default.
import
sys
,
os
,
re
import
sys
,
os
,
re
import
os.path
import
shutil
# If extensions (or modules to document with autodoc) are in another directory,
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# add these directories to sys.path here. If the directory is relative to the
...
@@ -384,3 +386,41 @@ pdf_fit_background_mode = 'scale'
...
@@ -384,3 +386,41 @@ pdf_fit_background_mode = 'scale'
todo_include_todos
=
True
todo_include_todos
=
True
extlinks
=
{
'bug'
:
(
'https://bugzilla.mozilla.org/show_bug.cgi?id=
%
s'
,
'bug '
)}
extlinks
=
{
'bug'
:
(
'https://bugzilla.mozilla.org/show_bug.cgi?id=
%
s'
,
'bug '
)}
# -- Assemble extension documentation ------------------------------------------
# os.getcwd() is docs/$lang/rst
lang
=
os
.
path
.
basename
(
os
.
path
.
dirname
(
os
.
getcwd
()))
# This is technically defined in Bugzilla/Constants.pm in Perl, but it's
# unlikely to change if we use a relative path.
ext_dir
=
"../../../extensions"
# Still, check just in case, so if it ever changes, we know
if
(
os
.
path
.
isdir
(
ext_dir
)):
# Clear out old extensions docs
for
dir
in
os
.
listdir
(
"extensions"
):
shutil
.
rmtree
(
os
.
path
.
join
(
"extensions"
,
dir
))
# Copy in new copies
for
ext_name
in
os
.
listdir
(
ext_dir
):
ext_path
=
os
.
path
.
join
(
ext_dir
,
ext_name
)
# Ignore files in the extensions/ directory (e.g. create.pl)
if
not
os
.
path
.
isdir
(
ext_path
):
continue
# Ignore disabled extensions
if
os
.
path
.
isfile
(
os
.
path
.
join
(
ext_path
,
"disabled"
)):
continue
src
=
os
.
path
.
join
(
ext_path
,
"docs"
,
lang
,
"rst"
)
# Ignore extensions without rst docs in this language
if
not
os
.
path
.
isdir
(
src
):
continue
dst
=
os
.
path
.
join
(
"extensions"
,
ext_name
)
shutil
.
copytree
(
src
,
dst
)
else
:
print
"Warning: Bugzilla extension directory not found: "
+
ext_dir
docs/en/rst/extensions/.gitignore
0 → 100644
View file @
edef0e4e
# Git doesn't like having empty directories in the repo.
# So we have this file.
# It says to ignore everything in this directory.
*
# Except this file, of course.
!.gitignore
docs/makedocs.pl
View file @
edef0e4e
...
@@ -34,7 +34,6 @@ use lib qw(.. ../lib lib);
...
@@ -34,7 +34,6 @@ use lib qw(.. ../lib lib);
use
Cwd
;
use
Cwd
;
use
File::Copy::
Recursive
qw(rcopy)
;
use
File::Copy::
Recursive
qw(rcopy)
;
use
File::
Find
;
use
File::
Path
qw(rmtree)
;
use
File::
Path
qw(rmtree)
;
use
File::
Which
qw(which)
;
use
File::
Which
qw(which)
;
use
Pod::
Simple
;
use
Pod::
Simple
;
...
@@ -116,32 +115,6 @@ foreach my $lang (@langs) {
...
@@ -116,32 +115,6 @@ foreach my $lang (@langs) {
next
if
grep
{
$_
eq
'--pod-only'
}
@ARGV
;
next
if
grep
{
$_
eq
'--pod-only'
}
@ARGV
;
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.
rmtree
(
"$lang/rst/extensions"
,
0
,
1
);
foreach
my
$ext_name
(
keys
%
extensions
)
{
my
$src
=
$extensions
{
$ext_name
}
.
"/*"
;
my
$dst
=
"$docparent/$lang/rst/extensions/$ext_name"
;
mkdir
(
$dst
)
unless
-
d
$dst
;
rcopy
(
$src
,
$dst
);
}
chdir
"$docparent/$lang"
;
MakeDocs
(
'HTML'
,
'html'
);
MakeDocs
(
'HTML'
,
'html'
);
MakeDocs
(
'TXT'
,
'text'
);
MakeDocs
(
'TXT'
,
'text'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment