|
20 | 20 | import sys |
21 | 21 | from datetime import datetime |
22 | 22 |
|
23 | | -from docutils import nodes |
24 | | -from sphinx.util.docfields import TypedField |
25 | | -from sphinx import addnodes |
26 | | - |
27 | 23 |
|
28 | 24 | sys.path.insert(0, os.path.abspath('..')) |
29 | 25 |
|
|
76 | 72 | # |
77 | 73 | # This is also used if you do content translation via gettext catalogs. |
78 | 74 | # Usually you set "language" from the command line for these cases. |
79 | | -language = None |
| 75 | +language = "en" |
80 | 76 |
|
81 | 77 | # List of patterns, relative to source directory, that match files and |
82 | 78 | # directories to ignore when looking for source files. |
|
94 | 90 |
|
95 | 91 | # The theme to use for HTML and HTML Help pages. See the documentation for |
96 | 92 | # a list of builtin themes. |
97 | | -# |
98 | | -html_theme = 'alabaster' |
| 93 | +html_theme = "sphinx_rtd_theme" |
99 | 94 |
|
100 | 95 | # Theme options are theme-specific and customize the look and feel of a theme |
101 | 96 | # further. For a list of options available for each theme, see the |
|
171 | 166 |
|
172 | 167 | html_theme = 'sphinx_rtd_theme' |
173 | 168 | html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] |
174 | | - |
175 | | - |
176 | | -# disable cross-reference for ivar |
177 | | -# patch taken from http://stackoverflow.com/a/41184353/1932023 |
178 | | -def patched_make_field(self, types, domain, items, env=None): |
179 | | - # type: (List, unicode, Tuple) -> nodes.field |
180 | | - def handle_item(fieldarg, content): |
181 | | - par = nodes.paragraph() |
182 | | - par += addnodes.literal_strong('', fieldarg) # Patch: this line added |
183 | | - # par.extend(self.make_xrefs(self.rolename, domain, fieldarg, |
184 | | - # addnodes.literal_strong)) |
185 | | - if fieldarg in types: |
186 | | - par += nodes.Text(' (') |
187 | | - # NOTE: using .pop() here to prevent a single type node to be |
188 | | - # inserted twice into the doctree, which leads to |
189 | | - # inconsistencies later when references are resolved |
190 | | - fieldtype = types.pop(fieldarg) |
191 | | - if len(fieldtype) == 1 and isinstance(fieldtype[0], nodes.Text): |
192 | | - typename = u''.join(n.astext() for n in fieldtype) |
193 | | - par.extend(self.make_xrefs(self.typerolename, domain, typename, |
194 | | - addnodes.literal_emphasis)) |
195 | | - else: |
196 | | - par += fieldtype |
197 | | - par += nodes.Text(')') |
198 | | - par += nodes.Text(' -- ') |
199 | | - par += content |
200 | | - return par |
201 | | - |
202 | | - fieldname = nodes.field_name('', self.label) |
203 | | - if len(items) == 1 and self.can_collapse: |
204 | | - fieldarg, content = items[0] |
205 | | - bodynode = handle_item(fieldarg, content) |
206 | | - else: |
207 | | - bodynode = self.list_type() |
208 | | - for fieldarg, content in items: |
209 | | - bodynode += nodes.list_item('', handle_item(fieldarg, content)) |
210 | | - fieldbody = nodes.field_body('', bodynode) |
211 | | - return nodes.field('', fieldname, fieldbody) |
212 | | - |
213 | | - |
214 | | -TypedField.make_field = patched_make_field |
0 commit comments