Skip to content
Snippets Groups Projects
Commit 76fe6e01 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Fix issues when generating pdf.

parent c1160c5d
No related branches found
No related tags found
No related merge requests found
......@@ -136,17 +136,19 @@ def build_pdf(doc):
return
# process the latex file twice
cmd = [PDFLATEX, "-output-directory", opj("..", PDF), fn]
call(cmd)
call(cmd)
call([PDFLATEX, fn])
call([PDFLATEX, fn])
# clean the pdf directory
# move the pdf file
os.chdir(cwd)
if os.path.exists(PDFDOC):
for el in os.listdir(PDFDOC):
if el.endswith('.pdf'):
continue
os.remove(opj(PDFDOC, el))
pdfdir = opj(DOCS, PDF)
if not os.path.exists(pdfdir):
os.mkdir(pdfdir)
fin = fn.replace('.tex', '.pdf')
fout = "%s_%s.pdf" % (os.path.splitext(fn)[0], doc)
os.rename(opj(latexdoc, fin), opj(pdfdir, fout))
# remove the latex directory
call(["rm", "-rf", latexdoc])
......@@ -589,7 +591,12 @@ if __name__ == '__main__':
OPS.add_option("-a", "--api-doc",
action="store_true",
dest="api_doc",
help="build the API documentation.")
help="build the API documentation in HTML.")
OPS.add_option("--api-pdf",
action="store_true",
dest="api_pdf",
help="build the API documentation in PDF.")
OPS.add_option("--start-feature",
action="store_true",
......@@ -677,6 +684,7 @@ if __name__ == '__main__':
help="pack the web2py plugin.")
OPS.set_defaults(api_doc=False,
api_pdf=False,
close_feature=False,
close_hotfix=False,
close_release=False,
......@@ -699,6 +707,9 @@ if __name__ == '__main__':
if OPT.api_doc:
sphinx("-b html", opj(DOCSRC, API), opj(DOCS, API))
if OPT.api_pdf:
build_pdf(API)
if OPT.close_feature:
close_feature()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment