Skip to content

Commit 49b3bbf

Browse files
author
Greg Turnquist
committed
SESPRINGPYTHONPY-149: Wired Sphinx docs into the build script so its visible on the project site.
1 parent 5b38342 commit 49b3bbf

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

build.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def usage():
8484
print "\t--docs-html-multi\tgenerate HTML documentation, split up into separate sections"
8585
print "\t--docs-html-single\tgenerate HTML documentation in a single file"
8686
print "\t--docs-pdf\t\tgenerate PDF documentation"
87+
print "\t--docs-sphinx\t\tgenerate Sphinx documentation"
8788
print "\t--docs-all\t\tgenerate all documents"
8889
print "\t--pydoc\t\t\tgenerate pydoc information"
8990
print
@@ -93,7 +94,7 @@ def usage():
9394
"hct",
9495
["help", "clean", "test", "suite=", "debug-level=", "coverage", "package", "build-stamp=", \
9596
"publish", "register", \
96-
"site", "docs-html-multi", "docs-html-single", "docs-pdf", "docs-all", "pydoc"])
97+
"site", "docs-html-multi", "docs-html-single", "docs-pdf", "docs-sphinx", "docs-all", "pydoc"])
9798
except getopt.GetoptError:
9899
# print help information and exit:
99100
print "Invalid command found in %s" % sys.argv
@@ -328,7 +329,8 @@ def docs_all(version):
328329

329330
docs_multi(version)
330331
docs_pdf(version)
331-
332+
docs_sphinx()
333+
332334
def docs_multi(version):
333335
root = p["targetDir"] + "/" + p["dist.ref.dir"] + "/html"
334336
print root
@@ -380,6 +382,13 @@ def docs_pdf(version):
380382
os.remove(ref+"/src/mangled.xml")
381383
os.chdir(cur)
382384

385+
def docs_sphinx():
386+
cur = os.getcwd()
387+
os.chdir("docs/sphinx")
388+
os.system("make html")
389+
os.chdir(cur)
390+
shutil.copytree("docs/sphinx/build/html", "target/docs/sphinx")
391+
383392
def create_pydocs():
384393
sys.path.append(os.getcwd() + "/src")
385394
import springpython
@@ -540,6 +549,9 @@ def create_pydocs():
540549
if option[0] in ("--docs-pdf"):
541550
docs_pdf(complete_version)
542551

552+
if option[0] in ("--docs-sphinx"):
553+
docs_sphinx()
554+
543555
if option[0] in ("--pydoc"):
544556
create_pydocs()
545557

0 commit comments

Comments
 (0)