diff --git a/docs/Doxyfile b/docs/Doxyfile index fa14c861df..3201957989 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -829,7 +829,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = ../src/ifcgeom ../src/serializers +INPUT = ../src/ifcgeom ../src/serializers ../src/ifcgeom_schema_agnostic ../src/ifcparse # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses diff --git a/docs/conf.py b/docs/conf.py index 99f2967600..994084c24f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ exhale_args = { # These arguments are required "containmentFolder": "./rst_files", "rootFileName": "library_root.rst", - "rootFileTitle": "IfcOpenShell", + "rootFileTitle": "IfcOpenShell C++", "doxygenStripFromPath": "..", # Suggested optional arguments "createTreeView": True, diff --git a/docs/contents.rst b/docs/contents.rst new file mode 100644 index 0000000000..9d9550bad1 --- /dev/null +++ b/docs/contents.rst @@ -0,0 +1,10 @@ +IfcOpenShell +============ + +.. toctree:: + :maxdepth: 3 + + rst_files/library_root + + +* `ifcopenshell-python documentation `_ \ No newline at end of file diff --git a/docs/generate_docs.py b/docs/generate_docs.py index aaf10822db..45004b1412 100644 --- a/docs/generate_docs.py +++ b/docs/generate_docs.py @@ -1,52 +1,28 @@ # This program requires doxygen, sphinx, breathe and exhale. import os -import os.path +import shutil import subprocess from sys import platform - -def copy_content(content, container): - with open(content) as f: - with open(container, "w") as f1: - for line in f: - f1.write(line) - - conf_path = "./conf.py" index_path = "./index.rst" - if not os.path.isdir("./output/doxygen/xml"): os.makedirs("output/doxygen/xml") -if os.path.isfile(conf_path) and not os.path.isfile(index_path): - os.remove(conf_path) -if os.path.isfile(index_path) and not os.path.isfile(conf_path): - os.remove(index_path) - -if not (os.path.isfile(conf_path) and os.path.isfile(index_path)): - subprocess.run(["sphinx-quickstart", "-q", "-p", "IfcOpenShell"]) - -conf_copy = ["./conf_to_copy.py", "./conf.py"] -index_copy = ["./index_to_copy.rst", "./index.rst"] - -copy_content(conf_copy[0], conf_copy[1]) -copy_content(index_copy[0], index_copy[1]) +subprocess.check_call(["sphinx-build", "-b", "html", ".", "output"]) if platform == "linux" or platform == "linux2": - subprocess.run(["make", "html"]) - if not os.path.isdir("/output/_build"): - subprocess.run(["cd","../src/ifcblenderexport/docs"]) - subprocess.run(["make", "html"]) - subprocess.run(["cd", "../../../docs"]) - - subprocess.run(["mv" "../src/ifcblenderexport/docs/_build", "./output"]) + 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(["make", "html"], cwd="../src/ifcblenderexport/docs") + shutil.move("../src/ifcblenderexport/docs/_build", "./output") + os.rename("./output/_build", "./output/python") elif platform == "win32" or platform == "win64": - subprocess.run(["make.bat", "html"]) - - - + subprocess.check_call(["make.bat", "html"])