Skip to content

Commit

Permalink
Replace handmade api docs with autogenerated api docs (#637)
Browse files Browse the repository at this point in the history
* link to autogenerated docs in api reference, not manually curated api docs

* delete all the manually curated api doc rst files

* update gitignore and ignore tests_with_backend for api docs

* use templates for api docs

* newlines at end of template files

* year ranges
  • Loading branch information
aaronayres35 authored Apr 12, 2021
1 parent 541f3da commit e5a8594
Show file tree
Hide file tree
Showing 16 changed files with 103 additions and 1,048 deletions.
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@

# Docs files to ignore
/docs/source/api/*.rst
!docs/source/api/axis.rst
!docs/source/api/containers.rst
!docs/source/api/data_ranges.rst
!docs/source/api/data_sources.rst
!docs/source/api/mappers.rst
!docs/source/api/plot_factories.rst
!docs/source/api/renderers.rst
!docs/source/api/visual_components
!/docs/source/api/chaco.api.rst
docs/build/

# ignore the build directories
Expand Down
16 changes: 14 additions & 2 deletions ci/edmtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@

doc_ignore = {
"*/tests",
"chaco/tests_with_backend/*"
}

environment_vars = {
Expand Down Expand Up @@ -292,6 +293,7 @@ def docs(runtime, toolkit, environment):
"""
parameters = get_parameters(runtime, toolkit, environment)
parameters["templates_dir"] = "docs/source/api/templates/"
packages = " ".join(doc_dependencies)
ignore = " ".join(doc_ignore)
commands = [
Expand All @@ -305,13 +307,23 @@ def docs(runtime, toolkit, environment):
execute(commands, parameters)
click.echo("Done installing documentation tools")

api_path = os.path.join("docs", "source", "api")

# Remove any previously autogenerated API documentation.
doc_api_files = os.listdir(api_path)
permanent = ['chaco.api.rst', 'templates']
previously_autogenerated = \
[file for file in doc_api_files if file not in permanent]
for file in previously_autogenerated:
os.remove(os.path.join(api_path, file))

click.echo(
"Regenerating API docs in '{environment}'".format(**parameters)
)
api_path = os.path.join("docs", "source", "api")
commands = [
"edm run -e {environment} -- sphinx-apidoc -e -M --no-toc -o "
"edm run -e {environment} -- python -m sphinx.ext.apidoc -e --no-toc -o "
+ api_path
+ " -t {templates_dir}"
+ " chaco "
+ ignore
]
Expand Down
16 changes: 16 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
:orphan:

.. _api_reference:

=============
API Reference
=============

This document contains the auto-generated API reference documentation for
Chaco. For user documentation, please read the
:doc:`Chaco User Manual <user_manual/index>`

.. toctree::
:maxdepth: 3

api/chaco
78 changes: 0 additions & 78 deletions docs/source/api/axis.rst

This file was deleted.

13 changes: 13 additions & 0 deletions docs/source/api/chaco.api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
..
(C) Copyright 2006-2021 Enthought, Inc., Austin, TX
All rights reserved.
This software is provided without warranty under the terms of the BSD
license included in LICENSE.txt and may be redistributed only under
the conditions described in the aforementioned license. The license
is also available online at http://www.enthought.com/licenses/BSD.txt
Thanks for using Enthought open source!
chaco.api module
================

.. automodule:: chaco.api
53 changes: 0 additions & 53 deletions docs/source/api/containers.rst

This file was deleted.

37 changes: 0 additions & 37 deletions docs/source/api/data_ranges.rst

This file was deleted.

54 changes: 0 additions & 54 deletions docs/source/api/data_sources.rst

This file was deleted.

24 changes: 0 additions & 24 deletions docs/source/api/index.rst

This file was deleted.

Loading

0 comments on commit e5a8594

Please sign in to comment.