|
44 | 44 | sys.path.insert(0, os.path.abspath("../../"))
|
45 | 45 |
|
46 | 46 | extensions = [
|
| 47 | + "breathe", |
| 48 | + "exhale", |
47 | 49 | "sphinx.ext.autodoc",
|
48 | 50 | "sphinx.ext.autosectionlabel",
|
49 | 51 | "sphinx.ext.autosummary",
|
|
61 | 63 | "executorch_custom_versions",
|
62 | 64 | ]
|
63 | 65 |
|
| 66 | +# Setup absolute paths for communicating with breathe / exhale where |
| 67 | +# items are expected / should be trimmed by. |
| 68 | +# This file is {repo_root}/docs/cpp/source/conf.py |
| 69 | +this_file_dir = os.path.abspath(os.path.dirname(__file__)) |
| 70 | +doxygen_xml_dir = os.path.abspath("../website/sphinxbuild_cpp/xml") |
| 71 | +repo_root = os.path.dirname( # {repo_root} |
| 72 | + os.path.dirname( # {repo_root}/docs |
| 73 | + os.path.dirname( # {repo_root}/docs/cpp |
| 74 | + this_file_dir # {repo_root}/docs/cpp/source |
| 75 | + ) |
| 76 | + ) |
| 77 | +) |
| 78 | + |
| 79 | +breathe_projects = {"PyTorch": doxygen_xml_dir} |
| 80 | +breathe_default_project = "PyTorch" |
| 81 | + |
| 82 | +# Setup the exhale extension |
| 83 | +exhale_args = { |
| 84 | + ############################################################################ |
| 85 | + # These arguments are required. # |
| 86 | + ############################################################################ |
| 87 | + "containmentFolder": "./cpp_api", |
| 88 | + "rootFileName": "library_root.rst", |
| 89 | + "rootFileTitle": "Library API", |
| 90 | + "doxygenStripFromPath": repo_root, |
| 91 | + ############################################################################ |
| 92 | + # Suggested optional arguments. # |
| 93 | + ############################################################################ |
| 94 | + "createTreeView": True, |
| 95 | + "exhaleExecutesDoxygen": True, |
| 96 | + "exhaleUseDoxyfile": True, |
| 97 | + "verboseBuild": True, |
| 98 | + ############################################################################ |
| 99 | + # HTML Theme specific configurations. # |
| 100 | + ############################################################################ |
| 101 | + # Fix broken Sphinx RTD Theme 'Edit on GitHub' links |
| 102 | + # Search for 'Edit on GitHub' on the FAQ: |
| 103 | + # http://exhale.readthedocs.io/en/latest/faq.html |
| 104 | + "pageLevelConfigMeta": ":github_url: https://github.com/pytorch/pytorch", |
| 105 | + ############################################################################ |
| 106 | + # Individual page layout example configuration. # |
| 107 | + ############################################################################ |
| 108 | + # Example of adding contents directives on custom kinds with custom title |
| 109 | + "contentsTitle": "Page Contents", |
| 110 | + "kindsWithContentsDirectives": ["class", "file", "namespace", "struct"], |
| 111 | + # Exclude PIMPL files from class hierarchy tree and namespace pages. |
| 112 | + "listingExclude": [r".*Impl$"], |
| 113 | + ############################################################################ |
| 114 | + # Main library page layout example configuration. # |
| 115 | + ############################################################################ |
| 116 | + "afterTitleDescription": "Welcome to the ExecuTorch's documentation.", |
| 117 | +} |
| 118 | + |
64 | 119 | templates_path = ["_templates"]
|
65 | 120 |
|
66 | 121 |
|
|
0 commit comments