Skip to content

Commit

Permalink
Doc: Restore API documentation URLs (#1386)
Browse files Browse the repository at this point in the history
* Generate files into the api folder so that URLs stay the same

But in order to keep index.rst to be maintained manually,
the ci command no longer reset the folder. Developers
should do git clean before regenerating docs to ensure
clean initial state.

(cherry picked from commit a7ef805)
  • Loading branch information
kitchoi committed Oct 20, 2020
1 parent 1d8dd1a commit 4993657
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ docs/build/
traitsui/_version.py

# Ignore automatically generated API documentation source
docs/source/api/autogenerated/
# ... except index.rst which is manually maintained.
docs/source/api/*.rst
!docs/source/api/index.rst
2 changes: 1 addition & 1 deletion docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ TraitsUI. For user documentation, please read the
.. toctree::
:maxdepth: 3

autogenerated/traitsui
traitsui
7 changes: 3 additions & 4 deletions etstool.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,10 +397,9 @@ def docs(runtime, toolkit, environment):
click.echo(
"Regenerating API docs in '{environment}'".format(**parameters)
)
output_path = os.path.join("docs", "source", "api", "autogenerated")
if os.path.exists(output_path):
rmtree(output_path)
os.makedirs(output_path)
output_path = os.path.join("docs", "source", "api")
if not os.path.exists(output_path):
os.makedirs(output_path)
commands = [
"edm run -e {environment} -- sphinx-apidoc "
"-e "
Expand Down

0 comments on commit 4993657

Please sign in to comment.