Skip to content

Commit b94fd38

Browse files
committed
Change docs _generated folder name to api
1 parent 148a87a commit b94fd38

7 files changed

Lines changed: 23 additions & 21 deletions

File tree

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ astropy/wcs/include/wcsconfig.h
2020
# Sphinx
2121
_build
2222
_generated
23+
docs/api
24+
2325

2426
# Packages/installer info
2527
*.egg

‎astropy/setup_helpers.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ def initialize_options(self):
806806
def finalize_options(self):
807807
#Clear out previous sphinx builds, if requested
808808
if self.clean_docs:
809-
dirstorm = ['docs/_generated']
809+
dirstorm = ['docs/api']
810810
if self.build_dir is None:
811811
dirstorm.append('docs/_build')
812812
else:

‎astropy/sphinx/conf.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def get_graphviz_version():
152152

153153
autosummary_generate = True
154154

155-
automodapi_toctreedirnm = '_generated'
155+
automodapi_toctreedirnm = 'api'
156156

157157

158158
# -- Options for HTML output -------------------------------------------------

‎astropy/sphinx/ext/automodapi.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
`automodapi_toctreedirnm`. It must be a string that specifies the name of
4141
the directory the automodsumm generated documentation ends up in. This
4242
directory path should be relative to the documentation root (e.g., same
43-
place as ``index.rst``). It defaults to '_generated'
43+
place as ``index.rst``). It defaults to 'api'
4444
4545
"""
4646

@@ -118,7 +118,7 @@ def automodapi_replace(sourcestr, app, dotoctree=True, docname=None,
118118
If True, a ":toctree:" option will be added in the "..
119119
automodsumm::" sections of the template, pointing to the
120120
appropriate "generated" directory based on the Astropy convention
121-
(e.g. in ``docs/_generated``)
121+
(e.g. in ``docs/api``)
122122
docname : str
123123
The name of the file for this `sourcestr` (if known - if not, it
124124
can be None). If not provided and `dotoctree` is True, the
@@ -268,4 +268,4 @@ def setup(app):
268268

269269
app.connect('source-read', process_automodapi)
270270

271-
app.add_config_value('automodapi_toctreedirnm', '_generated', True)
271+
app.add_config_value('automodapi_toctreedirnm', 'api', True)

‎astropy/sphinx/ext/automodsumm.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def get_members_class(obj, typ, include_public=[],
477477
ns['underline'] = len(name) * '='
478478

479479
# We now check whether a reference file exists for the module
480-
# being documented. This assumes that we are in _generated, and
480+
# being documented. This assumes that we are in 'api', and
481481
# that ../ gives us the root of the docs. We first check if the
482482
# current module is a file or a directory, as this will give a
483483
# different path for the reference file. For example, if

‎astropy/sphinx/ext/tests/test_automodapi.py‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ def warn(self, msg, loc):
5353
5454
.. automodsumm:: astropy.sphinx.ext.tests.test_automodapi
5555
:functions-only:
56-
:toctree: _generated/
56+
:toctree: api/
5757
{empty}
5858
5959
Classes
6060
^^^^^^^
6161
6262
.. automodsumm:: astropy.sphinx.ext.tests.test_automodapi
6363
:classes-only:
64-
:toctree: _generated/
64+
:toctree: api/
6565
{empty}
6666
6767
Class Inheritance Diagram
@@ -82,7 +82,7 @@ def test_am_replacer_basic():
8282
"""
8383
from ..automodapi import automodapi_replace
8484

85-
fakeapp = FakeApp(automodapi_toctreedirnm='_generated')
85+
fakeapp = FakeApp(automodapi_toctreedirnm='api')
8686
result = automodapi_replace(am_replacer_str.format(options=''), fakeapp)
8787

8888
assert result == am_replacer_basic_expected
@@ -100,15 +100,15 @@ def test_am_replacer_basic():
100100
101101
.. automodsumm:: astropy.sphinx.ext.tests.test_automodapi
102102
:functions-only:
103-
:toctree: _generated/
103+
:toctree: api/
104104
{empty}
105105
106106
Classes
107107
^^^^^^^
108108
109109
.. automodsumm:: astropy.sphinx.ext.tests.test_automodapi
110110
:classes-only:
111-
:toctree: _generated/
111+
:toctree: api/
112112
{empty}
113113
114114
@@ -123,7 +123,7 @@ def test_am_replacer_noinh():
123123
"""
124124
from ..automodapi import automodapi_replace
125125

126-
fakeapp = FakeApp(automodapi_toctreedirnm='_generated')
126+
fakeapp = FakeApp(automodapi_toctreedirnm='api')
127127
ops = ['', ':no-inheritance-diagram:']
128128
ostr = '\n '.join(ops)
129129
result = automodapi_replace(am_replacer_str.format(options=ostr), fakeapp)
@@ -143,15 +143,15 @@ def test_am_replacer_noinh():
143143
144144
.. automodsumm:: astropy.sphinx.ext.tests.test_automodapi
145145
:functions-only:
146-
:toctree: _generated/
146+
:toctree: api/
147147
{empty}
148148
149149
Classes
150150
*******
151151
152152
.. automodsumm:: astropy.sphinx.ext.tests.test_automodapi
153153
:classes-only:
154-
:toctree: _generated/
154+
:toctree: api/
155155
{empty}
156156
157157
Class Inheritance Diagram
@@ -172,7 +172,7 @@ def test_am_replacer_titleandhdrs():
172172
"""
173173
from ..automodapi import automodapi_replace
174174

175-
fakeapp = FakeApp(automodapi_toctreedirnm='_generated')
175+
fakeapp = FakeApp(automodapi_toctreedirnm='api')
176176
ops = ['', ':title: A new title', ':headings: &*']
177177
ostr = '\n '.join(ops)
178178
result = automodapi_replace(am_replacer_str.format(options=ostr), fakeapp)
@@ -202,7 +202,7 @@ def test_am_replacer_titleandhdrs():
202202
203203
.. automodsumm:: astropy.sphinx.ext.automodapi
204204
:functions-only:
205-
:toctree: _generated/
205+
:toctree: api/
206206
{empty}
207207
208208
@@ -216,7 +216,7 @@ def test_am_replacer_nomain():
216216
"""
217217
from ..automodapi import automodapi_replace
218218

219-
fakeapp = FakeApp(automodapi_toctreedirnm='_generated')
219+
fakeapp = FakeApp(automodapi_toctreedirnm='api')
220220
result = automodapi_replace(am_replacer_nomain_str, fakeapp)
221221

222222
assert result == am_replacer_nomain_expected
@@ -245,7 +245,7 @@ def test_am_replacer_nomain():
245245
246246
.. automodsumm:: astropy.sphinx.ext.automodapi
247247
:functions-only:
248-
:toctree: _generated/
248+
:toctree: api/
249249
:skip: something1,something2
250250
251251
@@ -259,7 +259,7 @@ def test_am_replacer_skip():
259259
"""
260260
from ..automodapi import automodapi_replace
261261

262-
fakeapp = FakeApp(automodapi_toctreedirnm='_generated')
262+
fakeapp = FakeApp(automodapi_toctreedirnm='api')
263263
result = automodapi_replace(am_replacer_skip_str, fakeapp)
264264

265265
assert result == am_replacer_skip_expected
@@ -281,7 +281,7 @@ def test_am_replacer_invalidop():
281281
"""
282282
from ..automodapi import automodapi_replace
283283

284-
fakeapp = FakeApp(automodapi_toctreedirnm='_generated')
284+
fakeapp = FakeApp(automodapi_toctreedirnm='api')
285285
automodapi_replace(am_replacer_invalidop_str, fakeapp)
286286

287287
expected_warnings = [('Found additional options invalid-option in '

‎docs/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ help:
3838

3939
clean:
4040
-rm -rf $(BUILDDIR)
41-
-rm -rf _generated
41+
-rm -rf api
4242

4343
html:
4444
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html

0 commit comments

Comments
 (0)