Commit Graph

367 Commits

Author SHA1 Message Date
Ashley Whetter
aac53178eb Fixed error parsing files with unicode docstrings 2018-11-13 11:07:36 -08:00
Ashley Whetter
66cf2ed4d0 Fixed autodoc not documenting anything in submodules or subpackages 2018-09-24 14:52:18 -07:00
Ashley Whetter
a1f1fd8651 Fixed properly resolving definitions imported more than once 2018-09-07 17:36:20 -07:00
Ashley Whetter
2799fb32cc Fixed error when documenting something that's imported in more than one place 2018-09-07 16:56:11 -07:00
Ashley Whetter
007ef746f4 Fixed linter again 2018-08-20 11:01:07 -07:00
Ashley Whetter
fb8892ccad Fixed lint error 2018-08-20 09:48:24 -07:00
Ashley Whetter
c3f3cc33de Added viewcode support for imported members 2018-08-20 09:37:43 -07:00
Ashley Whetter
92b4ea9dc8 Fixed linking to builtin bases 2018-08-13 17:26:54 -07:00
Ashley Whetter
616267726b No longer document __init__ attributes without a docstring
Fixes #146
Also fixed duplicates when a property is set in __init__.
2018-08-13 14:22:11 -07:00
Ashley Whetter
8d4fb4b1c3 Can document a public python API
Closes #153
2018-08-13 12:18:56 -07:00
Ashley Whetter
9e9c28e15b Can opt to write manual documentation 2018-08-10 09:00:54 -07:00
Ashley Whetter
b789dcaa73 Fixed autodoc being unable to discover nested classes 2018-08-07 14:39:38 -07:00
Ashley Whetter
c3ef72ee14 Fixed nested classes not getting displayed in autogenerated docs 2018-08-07 14:39:38 -07:00
Ashley Whetter
8a965bb15a Fixed lint error 2018-08-07 14:33:42 -07:00
Ashley Whetter
bc65e766c3 Made it easier to remove default index page
Also removed autoapi_add_api_root_toctree config option
because it is less useful now.

Closes #152
2018-08-06 16:23:33 -07:00
Ashley Whetter
7dd822eef4 Can still link to public items in private modules 2018-08-06 15:02:01 -07:00
Ashley Whetter
75ebcfc903 private-members also controls private subpackages and submodules
Closes #150
2018-08-06 14:52:42 -07:00
Ashley Whetter
6ffec93569 Fixed lint errors 2018-08-06 14:19:12 -07:00
Ashley Whetter
4ac85dd7af Added autoapi directives for Python 2018-08-06 14:19:12 -07:00
Ashley Whetter
4edf45af35 Added support for static and class methods 2018-08-06 14:19:12 -07:00
Ashley Whetter
9cb2f7d50e Methods include self in their arguments
autodoc does this by default so it makes sense to do it in autoapi also.
2018-08-06 14:19:12 -07:00
Ashley Whetter
af4263457e Full path is resolved for bases from same module 2018-08-06 14:19:12 -07:00
Ashley Whetter
a1825cd98d Fixed astroid 2.0 compatibility
Closes #148
2018-08-06 14:19:12 -07:00
Ashley Whetter
d8f4847a5c
Added support for detecting Python exceptions (#147)
Closes #145
2018-07-31 16:57:24 -07:00
Ashley Whetter
6b8ccf62ae Fixed filtered classes and attributes getting displayed 2018-07-24 12:05:57 -07:00
Ashley Whetter
f2d3352801 Fixed incorrect display of long lists
Stop pretty printing because the annotation option cannot accept
multiline strings.
2018-07-16 12:45:17 -07:00
fredbi
9dd26fd32b Fixed running incorrect jsdoc command on Windows
Issue #125.
jsdoc on windows is deployed as jsdoc.cmd
2018-07-12 14:53:19 -07:00
Sam Lai
974bae1f20 Support specifying package directories in autoapi_dirs (#135)
* Support specifying package directories as well

Fixes #108.

* Use os.sep instead of the hardcoded '/'

This was making the tests fail on Windows because the necessary '/'
replacements were not happening on Windows due to os.sep being '\\'.
2018-07-03 21:34:31 -07:00
Ashley Whetter
ea6f1d322e Fix lint errors 2018-06-05 23:15:45 -07:00
Ashley Whetter
6ca62f16c9 Can control how __init__ docstring is displayed 2018-06-05 22:47:32 -07:00
Ashley Whetter
6eb18467f7 Fixed undoc members logic 2018-06-02 10:57:45 -07:00
Ashley Whetter
9f6f7d0b5d Added support for viewcode 2018-05-24 07:50:39 -07:00
Ashley Whetter
741dfaffb3 Source files no longer need to be in sys.path 2018-05-08 22:41:35 -07:00
Ashley Whetter
b19b9ea28b Extended ast parsing with astroid 2018-05-08 22:41:35 -07:00
Sam Lai
ea8efe91dc Fix lint errors
There should be no behavioural changes - this is just explicitly returning what would've been returned anyway.
2018-04-21 20:48:06 +01:00
Ashley Whetter
b06d4f801b Started autoloading autosummary extension 2017-11-10 14:57:43 -08:00
Ashley Whetter
5075467441 Formats napoleon docstrings in Python 2017-11-10 13:05:35 -08:00
Anthony
ae1c6276df
Merge pull request #116 from AWhetter/py_hierarchy
Py hierarchy
2017-11-09 16:24:09 -07:00
Ashley Whetter
7b3e6fca6d Added basic class signature discovery 2017-11-09 14:18:11 -08:00
Ashley Whetter
b792463cc9 Can turn off autoapisummary directives in output 2017-11-09 12:48:21 -08:00
Ashley Whetter
4adcdc5351 Python documentation is now hierarchical 2017-11-09 12:48:21 -08:00
Ashley Whetter
b5be7b6d9a Fixed a warning 2017-11-09 12:21:52 -08:00
Ashley Whetter
958fe10103 Added autoapisummary directive 2017-11-09 12:21:52 -08:00
Ashley Whetter
5a86878811 Fixed Python subpackages having incomplete names 2017-11-09 11:54:16 -08:00
Eric Holscher
e5cce2c7dd Fix lint 2017-11-09 10:56:42 -07:00
Eric Holscher
d803b28d00 Kill janky napolean overlay 2017-11-09 10:54:20 -07:00
Eric Holscher
3531f5560a Merge remote-tracking branch 'origin/master' into cleanup-june 2017-11-09 10:51:24 -07:00
Ashley Whetter
86a9ffdd60 Fixed lint errors 2017-11-08 16:04:25 -08:00
Ashley Whetter
ae1e4f556d Fixed usage of deprecated status_indicator
This fixes a compatibiity issue with Sphinx 1.7
2017-11-05 15:11:06 -08:00
Ashley Whetter
a1a3f05202 Fix for Sphinx 1.6 2017-11-05 14:18:43 -08:00
Eric Holscher
3875cf495d Fix noting the toctree 2017-06-29 15:10:06 -07:00
Eric Holscher
21a82718ab Fix linting 2017-06-29 14:48:06 -07:00
Eric Holscher
8c1016f8c7 Fix linting 2017-06-29 14:37:59 -07:00
Eric Holscher
ed57a216ec Fix lint 2017-06-29 13:01:23 -07:00
Eric Holscher
0e3e5df437 Fix linting 2017-06-29 10:57:38 -07:00
Eric Holscher
86a4de1668 Don’t show modules with no content. 2017-06-29 10:45:54 -07:00
Eric Holscher
4428ecd6e8 Add ability to process Napolean docstrings. 2017-06-27 17:40:34 -07:00
Eric Holscher
efb541f78a Add ability to add API to top-level TOC. 2017-06-27 17:12:47 -07:00
Eric Holscher
3233bc0ac7 Fix templates to nest functions and use short names 2017-06-27 17:12:17 -07:00
Anthony
152ea1a521 Merge pull request #104 from rtfd/python-ast
Start altering the pydocstyle AST parser for our needs
2017-04-07 18:06:17 -07:00
Anthony
e7a624254a Merge pull request #106 from rtfd/fix-argument-call
Fix Python argument parsing for Call nodes
2017-04-07 17:55:25 -07:00
Anthony Johnson
715b6662e5
Fix Python argument parsing for Call nodes
This previous was throwing exceptions in some cases where Attribute nodes were
used instead of Name nodes.
2017-04-07 16:36:23 -07:00
Anthony Johnson
df74247128
Allow for toplevel module as Sphinx extension
Instead of requiring:

    extensions = ['autoapi.extension']

This allows for the toplevel:

    extensions = ['autoapi']

This is more intuitive for users, as extension is an internal concept.
2017-04-07 15:33:39 -07:00
Anthony Johnson
2603729925
Fix some more parsing issues 2017-04-07 15:25:34 -07:00
Anthony Johnson
0faeb500ee More fixes 2017-04-07 13:12:10 -07:00
Anthony Johnson
3c6e0e4015 Start altering the pydocstyle AST parser for our needs
This forks some of the pydocstyle AST parser into out mapper. Eventually, some
of the other operations such as parsing arguments and performing full name
lookup can be moved in as well. For now, this is not doing any extra assignment
tracking/etc, several of these operations will just throw this information out.

Refs #99
2017-04-07 11:46:57 -07:00
Eric Holscher
426d677324 Fix review feedback 2017-03-02 14:18:39 -08:00
Eric Holscher
d7e8e13613 Don't use string 2017-02-08 10:12:52 -05:00
Eric Holscher
6024223d9e Add fix to version checking on <1.5 2017-02-08 09:53:19 -05:00
Ashley Whetter
a9521553d9 Fix for Sphinx 1.5 2017-02-01 17:14:32 -08:00
Eric Holscher
d34af13767 Fix pathing 2016-11-04 20:50:05 -07:00
Eric Holscher
e8514dfee2 Use shortname for methods 2016-11-04 15:44:47 -07:00
Eric Holscher
5901291d3f Remove nested parse 2016-11-04 15:37:46 -07:00
Eric Holscher
491f8c9065 Keep nested-parse 2016-11-04 15:34:48 -07:00
Eric Holscher
aa06999300 Nest the wrapper 2016-11-04 15:19:56 -07:00
Eric Holscher
ffb2130b55 Implement prepare_docstring filter that wraps Sphinx's
This allows us to output docstrings in a reasonable fashion.
2016-11-04 15:17:50 -07:00
Eric Holscher
c557182525 Fix review feedback 2016-11-04 13:42:15 -07:00
Eric Holscher
73324fab7e Remove unneeded index entry 2016-11-03 13:24:22 -07:00
Eric Holscher
c3db6e5bc8 Python 3 fixes 2016-11-03 13:13:36 -07:00
Eric Holscher
66fd939395 Add a bit more error handling. 2016-11-03 13:13:36 -07:00
Eric Holscher
624eeff030 Break out toctree into separate file.
Also add lots of docstrings,
so hopefully someone can understand this some day.
2016-11-03 13:13:36 -07:00
Eric Holscher
cc41787b58 Write up a more descriptive docstring 2016-11-03 13:13:36 -07:00
Eric Holscher
b6dc3d23d8 Clean up auto-tocing 2016-11-03 13:13:36 -07:00
Eric Holscher
4eefb01759 Build initial toctree implementation 2016-11-03 13:13:36 -07:00
Anthony Johnson
2bff9e45b7 Revert attempt at making a hidden title
This directive was to remove the initial title from the nest block
2016-11-02 20:01:21 -07:00
Anthony Johnson
809c27ac6d Lint fixes 2016-11-02 16:45:41 -07:00
Anthony Johnson
f607d5e1db Improvements to pydocstyle Python parsing
* Moves relative path parsing away from the base mapper implementation
* Change argument parsing from splitting first line of source with ',' to use
  AST traversal instead. This is not complete, but mostly PoC for now. Full
  traversal into argument type nodes will allow us to get nested dict() etc.
  We should open a ticket to track this work
* Cleans up some of the templates to reduce duplicate titles
* Adds a directive for nesting rST from constructs that might have headings.
  Remove the first heading in this case to address the case where a module has a
  docstring with a heading up front
* Adds tests
* Replaces example module with module that has more failing cases of parsing

Closes #78
Fixes #80
Fixes #81
Fixes #82
Fixes #83
Fixes #84
Fixes #85
2016-11-02 16:29:28 -07:00
Anthony Johnson
fbe58022c5 Drop __repr__ method on python mapper
We aren't using this pattern in the other mappers. Something we could add, but
out of scope here.
2016-10-25 16:27:05 -07:00
Anthony Johnson
a5a34df7f4 Basic cleanup on docstrings, import order 2016-10-25 16:26:30 -07:00
Eric Holscher
8e97201423 A few more PYthon upgrades 2016-10-20 14:57:07 -07:00
Eric Holscher
5e18b65a6c Lots of updates to handle file pathing more sanely. 2016-08-25 16:25:38 -07:00
Eric Holscher
3aa1747795 Template updates. 2016-08-25 16:23:48 -07:00
Eric Holscher
6025db45a7 Clean up how we handle file suffix. 2016-08-25 10:58:06 -07:00
Eric Holscher
b24293e545 Start using pydocstyle for Python doc generation 2016-06-09 15:44:30 -07:00
Anthony Johnson
fab86cbc66 Revert basestring -> str in check for autoapi_dirs
Not sure we need to be concerned about byte strings here either way.

Fixes #74
2016-06-08 16:36:11 -07:00
Anthony Johnson
216d0e824b Doc updates 2016-06-02 18:03:54 -07:00
Anthony Johnson
5c07b6cbc5 Make docfx great again!
This updates some small outdated pieces with docfx integration:

* Support docfx.json first, if no patterns were explicitly specified
* Refactor output path, use new _api path
* Add missing operator type to .net parsing and template output
* Fix indent issue with code samples
* Add docs on how to actually use docfx + autoapi

Fixes #45
Fixes #46
Fixes #48
2016-06-02 17:24:31 -07:00
Daniel Roth
e51480d747 Fix indentation of code examples for properties. 2016-06-02 13:58:26 -07:00
Eric Holscher
58cb1ee64d Merge pull request #72 from rtfd/net-detail-cleanup
Clean up .NET detail page, add assemblies list
2016-05-02 07:36:48 -07:00
Eric Holscher
92ef8f60db Merge pull request #71 from rtfd/list-remove-namespace
Use short name for reference link name
2016-05-01 20:37:51 -07:00
Anthony Johnson
1c6c9f15d8 Clean up .NET detail page, add assemblies list
The .NET detail page was slightly messy, this cleans up and settles on some UX
there:

* Don't use an explicit header for summary, move it up under the object heading
* Drop redundant (and broken) github edit link on page, we need to fix the
  github header link instead.
* Add pattern for displaying read only fields in definition list
* Adds namespace + assemblies listing to detail page

Refs #60
2016-05-01 19:57:58 -07:00
Anthony Johnson
4e2d5ccdfb Use short name for reference link name
As the parent block is a namespace declaration, we can use nesting to imply the
namespace. This removes the namespace from the object name and matches what we
do on other pages.
2016-05-01 19:27:20 -07:00
Anthony Johnson
11ad556d3e Handle string input for api dir
This was iterating over the settings assuming it was a list. We handle this as a
list in some instances, and recommend using a string in others. Just handle
both.
2016-05-01 19:23:05 -07:00
Anthony
26924f93e3 Merge pull request #54 from danroth27/patch-1
Update extension.py to handle absolute paths
2016-04-21 13:36:58 -07:00
Eric Holscher
72a888edde Merge pull request #67 from rtfd/dotnet-code-example-indent
Fix indentation on code block in .NET template
2016-03-30 23:28:39 -07:00
Anthony Johnson
04726106d2 Fix indentation on code block in .NET template 2016-03-25 17:39:00 -07:00
Anthony Johnson
4fef4ab2c1 Complete statement 2016-03-04 10:49:01 -08:00
Anthony Johnson
49af2b252a Update reference resolver for nested resolution 2016-03-04 10:05:21 -08:00
Anthony Johnson
b6b1bb0f8b Fix missing key issue 2016-02-26 15:13:05 -08:00
Anthony Johnson
66dcf1fcaa Add resolution to spec identifiers using docfx references
This uses the docfx output references to resolve the spec identifier to a human
friendly name. The linking still requires full reference resolution however.

Refs #58
2016-02-25 14:35:09 -08:00
Anthony Johnson
019f064f36 Fix parsing issues with code comment XML
* paramref surrounding characters were not handled
* multiple paramrefs weren't parsed out
* uses correct return field

* Fixes #55
* Fixes #56
2016-02-25 11:46:56 -08:00
Daniel Roth
ca3a002aa6 Update extension.py to handle absolute paths 2016-02-02 21:14:28 -08:00
Anthony Johnson
598f449b8e Format definition lists correctly
If the construct is missing documentation, it broke defnition list styling. This
inserts a placeholder comment to avoid that.
2016-01-12 16:33:34 -08:00
Anthony Johnson
a672d55187 Lint fix 2016-01-12 16:33:10 -08:00
Anthony Johnson
bcee7eb22a Use autoapi_root for url root configuration 2015-10-28 11:04:23 -07:00
Anthony Johnson
61db34a4d6 Move include path to base object 2015-10-27 11:35:44 -07:00
Anthony Johnson
d30fa32762 Add configurable url prefix 2015-10-27 11:35:44 -07:00
Anthony Johnson
93869e4ad6 Deconstruct pathname on object 2015-10-27 11:34:54 -07:00
Anthony Johnson
3fd930f4fb Try it again 2015-10-27 11:34:54 -07:00
Anthony Johnson
5fa272ca4b Fix template path issue on windows, fixes #37 2015-10-27 11:34:54 -07:00
Anthony Johnson
1688b53f42 Replace non-existant :dn:ref: reference with :any: for now
This will resolve more lookups as proper references, not anchor links. The :any:
lookup is strict though, the domain should implement it's own :dn:obj: generic
lookup.
2015-10-27 01:12:25 -07:00
Anthony Johnson
af5bb7daeb Fix some escaping issues with transformed XML content
Fixes #38
2015-10-27 00:46:59 -07:00
Eric Holscher
3dfd9ac47f Fix error 2015-10-12 10:50:46 -07:00
Eric Holscher
81d4568713 Merge pull request #35 from rtfd/support-multiple-source-dirs
Rename `autoapi_dir` to `autoapi_dirs` to support multiple source dirs
2015-10-09 17:10:26 -07:00
Eric Holscher
2958bc34fb Fix linting errors 2015-09-23 16:04:45 -07:00
Eric Holscher
4de4b376ca Rename autoapi_dir to autoapi_dirs to support multiple 2015-09-23 16:00:43 -07:00
Daniel Roth
180c1bb36b Update extension.py
Missing an 's'
2015-09-22 08:02:34 -07:00
Anthony Johnson
c645cc18c0 Fix env passed to command, drop docfx.cmd detection 2015-08-21 01:13:08 -07:00
Anthony Johnson
47fbd54623 Drop shell subprocess execution 2015-08-20 22:11:16 -07:00
Anthony Johnson
9b75431e6e Configure docfx command by system 2015-08-20 22:01:25 -07:00
Eric Holscher
3a22ae63e0 Merge pull request #23 from rtfd/doc-name-slugging
Use more proper slugging on filenames for object
2015-08-19 10:48:10 -07:00
Anthony Johnson
87a16ea421 Use more proper slugging on filenames for object
This resolves some issues with special characters in paths on Windows based
systems. It replaces special characters and unicode characters to ensure paths
are predictable.
2015-08-18 18:10:25 -07:00
Anthony Johnson
436eb28d9f Parse out doc id prefixes and add reference types 2015-08-18 14:30:08 -07:00
Anthony Johnson
9676bd011c Doc comment parsing and some optimizations to regex substitutions and patterns
Relies on regex replace and multiple replacement substitions, rather than
iterating over the pattern and applying logic to the found patterns.

Handles:

 * see & seealso - creates a reference link
 * paramref & typepararef - we can't reference params in sphinx, so this just
   replaces with bold text
2015-08-18 12:22:46 -07:00
Eric Holscher
460aea6a8b Stub out XML parsing 2015-08-18 12:22:46 -07:00
Eric Holscher
f8e1d7435c Kill redefined ref_name 2015-08-17 15:04:15 -07:00
Eric Holscher
ee6a2ada3c Use ref_name instead of hacking specific name 2015-08-17 15:02:06 -07:00
Eric Holscher
c14ae7e8f1 Fix linting 2015-08-17 13:03:21 -07:00
Eric Holscher
05d891915f Kill wrong bash prefix 2015-08-17 12:54:10 -07:00
Anthony
d4dd35a0e2 Merge pull request #20 from rtfd/appveyor
Add Windows builds
2015-08-17 11:01:31 -07:00
Eric Holscher
d1fdfa1526 Fix call to join 2015-08-14 14:58:13 -07:00
Eric Holscher
b66a83b550 Fix shell=True 2015-08-14 14:57:15 -07:00
Eric Holscher
dfbae94963 Handle empty objects list 2015-08-14 14:54:28 -07:00
Eric Holscher
243549f2fe Add shell=True to the docfx call 2015-08-14 14:45:49 -07:00
Eric Holscher
3c89158662 Explicitly call bash for docfx 2015-08-14 14:34:58 -07:00
Eric Holscher
d7945ac5ba Explicitly call bash for docfx 2015-08-14 14:34:46 -07:00
Eric Holscher
999a031108 Only open files for writing 2015-08-10 20:16:40 -07:00
Eric Holscher
220599c22f Attempt to fix path names on Windows. 2015-08-10 20:03:46 -07:00
Eric Holscher
a21f88c806 Add comment 2015-08-05 10:10:32 -07:00
Eric Holscher
b4fdac80d3 Raise exception properly on Python 3 2015-08-05 10:09:07 -07:00