|
9 | 9 | # This file only contains a selection of the most common options. For a full
|
10 | 10 | # list see the documentation:
|
11 | 11 | # https://www.sphinx-doc.org/en/master/usage/configuration.html
|
12 |
| - |
13 |
| -# -- Path setup -------------------------------------------------------------- |
14 |
| - |
15 |
| -# If extensions (or modules to document with autodoc) are in another directory, |
16 |
| -# add these directories to sys.path here. If the directory is relative to the |
17 |
| -# documentation root, use os.path.abspath to make it absolute, like shown here. |
18 | 12 | #
|
19 |
| -# import os |
20 |
| -# import sys |
21 |
| -# sys.path.insert(0, os.path.abspath('.')) |
| 13 | +# |
| 14 | +# Configuration is based on: |
| 15 | +# https://github.com/pytorch/pytorch/blob/main/docs/cpp/source/conf.py |
| 16 | + |
22 | 17 | import os
|
23 | 18 | import sys
|
24 | 19 |
|
25 | 20 | import pytorch_sphinx_theme
|
26 | 21 |
|
| 22 | + |
| 23 | +# -- Project information ----------------------------------------------------- |
| 24 | + |
| 25 | +project = "FBGEMM" |
| 26 | +copyright = "2023, FBGEMM Team" |
| 27 | +author = "FBGEMM Team" |
| 28 | + |
| 29 | +# The short X.Y version. |
| 30 | +version = "0.6" |
| 31 | + |
| 32 | +# The full version, including alpha/beta/rc tags |
| 33 | +release = "0.6.0" |
| 34 | + |
| 35 | + |
| 36 | +# -- Path setup -------------------------------------------------------------- |
| 37 | + |
27 | 38 | for dir_i in os.listdir("../.."):
|
28 | 39 | if dir_i == "fbgemm_gpu":
|
29 | 40 | continue
|
|
32 | 43 | sys.path.insert(0, possible_dir)
|
33 | 44 |
|
34 | 45 |
|
35 |
| -# -- Project information ----------------------------------------------------- |
36 |
| -highlight_language = "C++" |
| 46 | +# Setup absolute paths for communicating with breathe / exhale where |
| 47 | +# items are expected / should be trimmed by. |
| 48 | +# This file is {repo_root}/fbgemm_gpu/docs/src/conf.py |
| 49 | +this_file_dir = os.path.abspath(os.path.dirname(__file__)) |
37 | 50 |
|
38 |
| -project = "fbgemm" |
39 |
| -copyright = "2023, FBGEMM Team" |
40 |
| -author = "FBGEMM Team" |
| 51 | +doxygen_xml_dir = os.path.join( |
| 52 | + os.path.dirname(this_file_dir), # {repo_root}/fbgemm_gpu/docs |
| 53 | + "build", # {repo_root}/fbgemm_gpu/docs/build |
| 54 | + "xml", # {repo_root}/fbgemm_gpu/docs/build/xml |
| 55 | +) |
| 56 | + |
| 57 | +repo_root = os.path.dirname( # {repo_root} |
| 58 | + os.path.dirname( # {repo_root}/fbgemm_gpu |
| 59 | + os.path.dirname( # {repo_root}/fbgemm_gpu/docs |
| 60 | + this_file_dir # {repo_root}/fbgemm_gpu/docs/src |
| 61 | + ) |
| 62 | + ) |
| 63 | +) |
41 | 64 |
|
42 |
| -# The full version, including alpha/beta/rc tags |
43 |
| -release = "0.1.2" |
44 | 65 |
|
45 | 66 | # -- General configuration ---------------------------------------------------
|
46 | 67 |
|
| 68 | +# Tell sphinx what the primary language being documented is. |
| 69 | +primary_domain = "cpp" |
| 70 | + |
| 71 | +# Tell sphinx what the pygments highlight language should be. |
| 72 | +highlight_language = "cpp" |
| 73 | + |
| 74 | +# The name of the Pygments (syntax highlighting) style to use. |
| 75 | +pygments_style = "sphinx" |
| 76 | + |
| 77 | +# The suffix(es) of source filenames. |
| 78 | +# You can specify multiple suffix as a list of string: |
| 79 | +# |
| 80 | +# source_suffix = ['.rst', '.md'] |
| 81 | +source_suffix = ".rst" |
| 82 | + |
| 83 | +# The master toctree document. |
| 84 | +master_doc = "index" |
| 85 | + |
| 86 | +# If true, `todo` and `todoList` produce output, else they produce nothing. |
| 87 | +todo_include_todos = True |
| 88 | + |
| 89 | +# If true, Sphinx will warn about all references where the target cannot be |
| 90 | +# found. |
| 91 | +nitpicky = True |
| 92 | + |
| 93 | +# Make sure the target is unique |
| 94 | +autosectionlabel_prefix_document = True |
| 95 | + |
47 | 96 | # Add any Sphinx extension module names here, as strings. They can be
|
48 | 97 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
49 | 98 | # ones.
|
|
58 | 107 | "sphinx.ext.napoleon",
|
59 | 108 | ]
|
60 | 109 |
|
| 110 | +intersphinx_mapping = { |
| 111 | + "python": ("https://docs.python.org/3", None), |
| 112 | + "pytorch": ("https://pytorch.org/docs/main", None), |
| 113 | + "numpy": ("https://numpy.org/doc/stable", None), |
| 114 | +} |
| 115 | + |
61 | 116 | # Add any paths that contain templates here, relative to this directory.
|
62 | 117 | templates_path = ["_templates"]
|
63 | 118 |
|
|
66 | 121 | # This pattern also affects html_static_path and html_extra_path.
|
67 | 122 | exclude_patterns = []
|
68 | 123 |
|
69 |
| -intersphinx_mapping = { |
70 |
| - "python": ("https://docs.python.org/3", None), |
71 |
| - "pytorch": ("https://pytorch.org/docs/master", None), |
72 |
| - "numpy": ("https://numpy.org/doc/stable", None), |
73 |
| -} |
74 | 124 |
|
75 |
| -# Setup absolute paths for communicating with breathe / exhale where |
76 |
| -# items are expected / should be trimmed by. |
| 125 | +# -- Breathe configuration --------------------------------------------------- |
77 | 126 |
|
78 | 127 | # This should be a dictionary in which the keys are project names and the values
|
79 | 128 | # are paths to the folder containing the doxygen output for that project.
|
80 | 129 | breathe_projects = {
|
81 |
| - "fbgemm_gpu": "../build/xml/", |
82 |
| - "codegen": "../build/xml/codegen/", |
| 130 | + "FBGEMM": doxygen_xml_dir, |
| 131 | + "codegen": f"{doxygen_xml_dir}/codegen", |
83 | 132 | }
|
84 | 133 |
|
85 | 134 | # This should match one of the keys in the breathe_projects dictionary and
|
86 | 135 | # indicates which project should be used when the project is not specified on
|
87 | 136 | # the directive.
|
88 |
| -breathe_default_project = "fbgemm_gpu" |
| 137 | +breathe_default_project = "FBGEMM" |
89 | 138 |
|
90 |
| -# If true, Sphinx will warn about all references where the target cannot be |
91 |
| -# found. |
92 |
| -nitpicky = True |
93 |
| - |
94 |
| -# Make sure the target is unique |
95 |
| -autosectionlabel_prefix_document = True |
96 |
| - |
97 |
| -# Tell sphinx what the primary language being documented is. |
98 |
| -primary_domain = "cpp" |
99 |
| - |
100 |
| -# Tell sphinx what the pygments highlight language should be. |
101 |
| -highlight_language = "cpp" |
102 | 139 |
|
103 | 140 | # -- Options for HTML output -------------------------------------------------
|
104 | 141 |
|
105 | 142 | # The theme to use for HTML and HTML Help pages. See the documentation for
|
106 | 143 | # a list of builtin themes.
|
107 |
| -# |
108 | 144 | html_theme = "pytorch_sphinx_theme"
|
109 | 145 | html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]
|
| 146 | + |
| 147 | +# Add any paths that contain custom static files (such as style sheets) here, |
| 148 | +# relative to this directory. They are copied after the builtin static files, |
| 149 | +# so a file named "default.css" will overwrite the builtin "default.css". |
| 150 | +# NOTE: sharing python docs resources |
| 151 | +html_static_path = ["_static"] |
| 152 | + |
| 153 | +# Theme options are theme-specific and customize the look and feel of a theme |
| 154 | +# further. For a list of options available for each theme, see the |
| 155 | +# documentation. |
110 | 156 | html_theme_options = {
|
111 | 157 | "pytorch_project": "fbgemm",
|
112 | 158 | "collapse_navigation": True,
|
| 159 | + "display_version": True, |
113 | 160 | "analytics_id": "UA-117752657-2",
|
114 | 161 | }
|
115 | 162 |
|
116 |
| -# Add any paths that contain custom static files (such as style sheets) here, |
117 |
| -# relative to this directory. They are copied after the builtin static files, |
118 |
| -# so a file named "default.css" will overwrite the builtin "default.css". |
119 |
| -# html_static_path = ["_static"] |
| 163 | + |
| 164 | +# -- Options for LaTeX output --------------------------------------------- |
| 165 | + |
| 166 | +latex_elements = { |
| 167 | + # The paper size ('letterpaper' or 'a4paper'). |
| 168 | + # |
| 169 | + # 'papersize': 'letterpaper', |
| 170 | + # The font size ('10pt', '11pt' or '12pt'). |
| 171 | + # |
| 172 | + # 'pointsize': '10pt', |
| 173 | + # Additional stuff for the LaTeX preamble. |
| 174 | + # |
| 175 | + # 'preamble': '', |
| 176 | + # Latex figure (float) alignment |
| 177 | + # |
| 178 | + # 'figure_align': 'htbp', |
| 179 | +} |
| 180 | + |
| 181 | +# Grouping the document tree into LaTeX files. List of tuples |
| 182 | +# (source start file, target name, title, |
| 183 | +# author, documentclass [howto, manual, or own class]). |
| 184 | +latex_documents = [ |
| 185 | + ( |
| 186 | + master_doc, |
| 187 | + "fbgemm.tex", |
| 188 | + "FBGEMM Documentation", |
| 189 | + "FBGEMM Team", |
| 190 | + "manual", |
| 191 | + ), |
| 192 | +] |
| 193 | + |
| 194 | + |
| 195 | +# -- Options for manual page output --------------------------------------- |
| 196 | + |
| 197 | +# One entry per manual page. List of tuples |
| 198 | +# (source start file, name, description, authors, manual section). |
| 199 | +man_pages = [(master_doc, "FBGEMM", "FBGEMM Documentation", [author], 1)] |
| 200 | + |
| 201 | + |
| 202 | +# -- Options for Texinfo output ------------------------------------------- |
| 203 | + |
| 204 | +# Grouping the document tree into Texinfo files. List of tuples |
| 205 | +# (source start file, target name, title, author, |
| 206 | +# dir menu entry, description, category) |
| 207 | +texinfo_documents = [ |
| 208 | + ( |
| 209 | + master_doc, |
| 210 | + "FBGEMM", |
| 211 | + "FBGEMM Documentation", |
| 212 | + author, |
| 213 | + "FBGEMM", |
| 214 | + "One line description of project.", |
| 215 | + "Miscellaneous", |
| 216 | + ), |
| 217 | +] |
0 commit comments