Skip to content

Commit

Permalink
generic code to debug a sphinx-build
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Oct 23, 2018
1 parent 527507d commit 412ea96
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/debug-sphinx-build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

"""
use source code debugger to identify and resolve sphinx-build problems
"""

import os
import re
import sys

from sphinx.cmd import build

# from Makefile
# sphinx-build -b html -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source $(BUILDDIR)/html

def main():
options = """
-b html -d {builddir}/doctrees {paperopt} {sphinxopts} source {builddir}/html
""".format(
builddir=os.getcwd(),
paperopt="-D latex_paper_size=letter",
sphinxopts="",
).strip()

build.main(options.split())


if __name__ == "__main__":
main()

0 comments on commit 412ea96

Please sign in to comment.