diff --git a/docs/Doxyfile b/docs/Doxyfile index 3201957989..16f9ed292e 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = "My Project" +PROJECT_NAME = "IfcOpenShell" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version diff --git a/docs/conf.py b/docs/conf.py index 994084c24f..4583e85a43 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,15 +34,4 @@ exhale_args = { } - - -# html_theme = 'sphinx_rtd_theme' - -# # Tell sphinx what the primary language being documented is. -# primary_domain = 'cpp' - -# # Tell sphinx what the pygments highlight language should be. -# highlight_language = 'cpp' - - - +cpp_id_attributes = ['IFC_PARSE_API', 'IFC_GEOM_API'] diff --git a/docs/generate_docs.py b/docs/generate_docs.py index 45004b1412..87da937985 100644 --- a/docs/generate_docs.py +++ b/docs/generate_docs.py @@ -1,28 +1,39 @@ # This program requires doxygen, sphinx, breathe and exhale. import os +import sys import shutil import subprocess +import multiprocessing -from sys import platform +# some extra check to see if we can find sphinx in pypy bin dir +sphinx_build = os.path.join(os.path.dirname(sys.executable), 'sphinx-build') +if not os.path.exists(sphinx_build): + sphinx_build = "sphinx-build" +else: + os.environ['PATH'] += os.pathsep + os.path.dirname(sys.executable) -conf_path = "./conf.py" -index_path = "./index.rst" +# not used, -j caused issues in my sphinx install +j = str(multiprocessing.cpu_count()) if not os.path.isdir("./output/doxygen/xml"): os.makedirs("output/doxygen/xml") -subprocess.check_call(["sphinx-build", "-b", "html", ".", "output"]) +subprocess.check_call([sphinx_build, "-b", "html", ".", "output"]) -if platform == "linux" or platform == "linux2": +if sys.platform == "linux" or sys.platform == "linux2": if os.path.isdir("output/python"): shutil.rmtree("output/python") if not os.path.exists(os.path.join("../src/ifcblenderexport/docs", "contents.rst")): subprocess.check_call(["ln", "index.rst", "contents.rst"], cwd="../src/ifcblenderexport/docs") + + subprocess.check_call(["sed", "-i", "s/html_theme/# html_theme/g", "conf.py"], cwd="../src/ifcblenderexport/docs")) subprocess.check_call(["make", "html"], cwd="../src/ifcblenderexport/docs") + subprocess.check_call(["git", "checkout", "conf.py"], cwd="../src/ifcblenderexport/docs")) + shutil.move("../src/ifcblenderexport/docs/_build", "./output") os.rename("./output/_build", "./output/python") -elif platform == "win32" or platform == "win64": +elif sys.platform == "win32" or sys.platform == "win64": subprocess.check_call(["make.bat", "html"]) diff --git a/docs/index.rst b/docs/index.rst index eac477b203..9d9550bad1 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,4 +7,4 @@ IfcOpenShell rst_files/library_root -`ifcopenshell-python documentation <_build/html/index.html>`_ \ No newline at end of file +* `ifcopenshell-python documentation `_ \ No newline at end of file diff --git a/docs/index_to_copy.rst b/docs/index_to_copy.rst deleted file mode 100644 index eac477b203..0000000000 --- a/docs/index_to_copy.rst +++ /dev/null @@ -1,10 +0,0 @@ -IfcOpenShell -============ - -.. toctree:: - :maxdepth: 3 - - rst_files/library_root - - -`ifcopenshell-python documentation <_build/html/index.html>`_ \ No newline at end of file