Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
d78faecb
Commit
d78faecb
authored
5 years ago
by
Xavier Robin
Browse files
Options
Downloads
Patches
Plain Diff
Use sphinx.application.Sphinx instead of a main function.
parent
fcb8d6f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/make.py
+29
-14
29 additions, 14 deletions
doc/make.py
with
29 additions
and
14 deletions
doc/make.py
+
29
−
14
View file @
d78faecb
...
...
@@ -5,7 +5,7 @@ import shutil
from
ost
import
settings
from
optparse
import
OptionParser
import
subprocess
import
sphinx.
cmd.build
from
sphinx.
application
import
Sphinx
if
len
(
sys
.
argv
)
==
2
:
root_dir
=
sys
.
argv
[
1
]
...
...
@@ -76,29 +76,44 @@ def ParseArgs():
parser
.
add_option
(
"
-q
"
,
"
--quiet
"
,
action
=
"
store_true
"
,
default
=
False
,
dest
=
"
quiet
"
,
help
=
"
run all test
"
)
return
parser
.
parse_args
()
def
_SelectBuilders
(
opts
):
builders
=
[]
if
opts
.
html
:
builders
.
append
(
'
html
'
)
if
opts
.
doctest
:
builders
.
append
(
'
doctest
'
)
if
opts
.
build_json
:
builders
.
append
(
'
json
'
)
if
opts
.
linkcheck
:
builders
.
append
(
'
linkcheck
'
)
return
builders
opts
,
args
=
ParseArgs
()
if
not
opts
.
html
and
\
not
opts
.
linkcheck
and
\
not
opts
.
doctest
:
opts
.
html
=
True
extra_
opts
=
[]
extra_
args
=
{}
if
opts
.
quiet
:
extra_opts
=
[
'
-Q
'
]
extra_args
[
'
warning
'
]
=
None
extra_args
[
'
status
'
]
=
None
for
sub_dir
in
(
'
modules
'
,):
for
directory
,
dirnames
,
filenames
in
os
.
walk
(
sub_dir
):
_CollectRstDocs
(
'
doc/source
'
,
directory
,
filenames
)
if
opts
.
html
:
sphinx
.
cmd
.
build
.
main
(
extra_opts
+
[
'
-b
'
,
'
html
'
,
'
-c
'
,
'
doc/conf
'
,
'
doc/source
'
,
'
doc/build/html
'
])
if
opts
.
doctest
:
sphinx
.
cmd
.
build
.
main
(
extra_opts
+
[
'
-b
'
,
'
doctest
'
,
'
-c
'
,
'
doc/conf
'
,
'
doc/source
'
,
'
doc/build/html
'
])
if
opts
.
build_json
:
sphinx
.
cmd
.
build
.
main
(
extra_opts
+
[
'
-b
'
,
'
json
'
,
'
-c
'
,
'
doc/conf
'
,
'
doc/source
'
,
'
doc/build/html
'
])
if
opts
.
linkcheck
:
sphinx
.
cmd
.
build
.
main
(
extra_opts
+
[
'
-b
'
,
'
linkcheck
'
,
'
-c
'
,
'
doc/conf
'
,
'
doc/source
'
,
'
doc/build/html
'
])
builders
=
_SelectBuilders
(
opts
)
for
builder
in
builders
:
Sphinx
(
srcdir
=
'
doc/source
'
,
confdir
=
'
doc/conf
'
,
outdir
=
'
doc/build/html
'
,
doctreedir
=
'
doc/build/html/.doctrees
'
,
buildername
=
builder
,
**
extra_args
).
build
(
True
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment