Skip to content

Commit fa46747

Browse files
committed
More docs
1 parent fe12f8a commit fa46747

File tree

5 files changed

+35
-1
lines changed

5 files changed

+35
-1
lines changed

docs/source/api/traits.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
3+
======
4+
traits
5+
======
6+
7+
.. py:currentmodule:: pythreejs
8+
9+
.. automodule:: pythreejs.traits
10+
:members:
11+
:undoc-members:

docs/source/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,8 @@
187187
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
188188

189189
# otherwise, readthedocs.org uses their theme by default, so no need to specify it
190+
191+
192+
# Ignore anchored API links (javascript uses the anchors, otherwise invalid)
193+
linkcheck_ignore = [r'https://threejs.org/docs/#(api|manual)']
194+
# linkcheck_anchors_ignore = ['^!', '^api', '^manual']

docs/sphinxext/autodoc_traits.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from collections import OrderedDict
44

5-
from traitlets import TraitType, Undefined, Container, Dict, Any
5+
from traitlets import TraitType, Undefined, Container, Dict, Any, HasTraits
66
from sphinx.ext.autodoc import ClassDocumenter, AttributeDocumenter
77

88

@@ -38,6 +38,10 @@ class HasTraitsDocumenter(ClassDocumenter):
3838
objtype = 'hastraits'
3939
directivetype = 'class'
4040

41+
@classmethod
42+
def can_document_member(cls, member, membername, isattr, parent):
43+
return isinstance(member, HasTraits)
44+
4145
def get_object_members(self, want_all):
4246
"""Add traits to members list"""
4347
check, members = super().get_object_members(want_all)

js/scripts/templates/autodoc_index.mustache

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
API Reference
66
=============
77

8+
The pythreejs API attempts to mimic `the three.js API`_ as closely as possible.
9+
This API reference therefore does not attempt to explain the purpose of any
10+
forwarded objects or attributes, but can still be useful for:
11+
12+
- The trait signatures of various properties.
13+
- Classes, properties and methods custom to pythreejs.
14+
- Variations from the three.js API, e.g. for :py:class:`~pythreejs.BufferAttribute`.
15+
16+
.. _`the three.js API`: https://threejs.org/docs/
17+
18+
819
.. automodule:: pythreejs
920
:members:
1021
:undoc-members:

setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@
7272
'matplotlib',
7373
'scikit-image'
7474
],
75+
'docs': [
76+
'sphinx>=1.5',
77+
]
7578
},
7679
'packages': [name], # Manually specify here, update after autogen
7780
'zip_safe': False,

0 commit comments

Comments
 (0)