Skip to content

Commit be73783

Browse files
committed
docs clean up.
1 parent 6e2a68b commit be73783

File tree

6 files changed

+52
-55
lines changed

6 files changed

+52
-55
lines changed

NodeGraphQt/base/node.py

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,53 @@ class NodeObject(object):
2222
2323
Args:
2424
qgraphics_item (AbstractNodeItem): QGraphicsItem item used for drawing.
25-
26-
.. code-block:: python
27-
28-
# snippet taken from the NodeGraphQt.BaseNode class.
29-
30-
class BaseNode(NodeObject):
31-
32-
def __init__(self, qgraphics_item=None):
33-
qgraphics_item = qgraphics_item or NodeItem
34-
super(BaseNode, self).__init__(qgraphics_views)
35-
3625
"""
3726

38-
# Unique node identifier domain. `eg.` ``"io.github.jchanvfx"``
3927
__identifier__ = 'nodeGraphQt.nodes'
28+
"""
29+
Unique node identifier domain. eg. ``"io.github.jchanvfx"``
30+
31+
.. important:: re-implement this attribute to provide a unique node type.
32+
33+
.. code-block:: python
34+
:linenos:
35+
36+
from NodeGraphQt import NodeObject
37+
38+
class ExampleNode(NodeObject):
39+
40+
# unique node identifier domain.
41+
__identifier__ = 'io.jchanvfx.github'
42+
43+
def __init__(self):
44+
...
45+
46+
:return: node type domain.
47+
:rtype: str
48+
"""
4049

41-
# Base node name.
4250
NODE_NAME = None
51+
"""
52+
Initial base node name.
53+
54+
.. important:: re-implement this attribute to provide a base node name.
55+
56+
.. code-block:: python
57+
:linenos:
58+
59+
from NodeGraphQt import NodeObject
60+
61+
class ExampleNode(NodeObject):
62+
63+
# initial default node name.
64+
NODE_NAME = 'Example Node'
65+
66+
def __init__(self):
67+
...
68+
69+
:return: node name
70+
:rtype: str
71+
"""
4372

4473
def __init__(self, qgraphics_item=None):
4574
"""
@@ -71,10 +100,10 @@ def __repr__(self):
71100
def type_(cls):
72101
"""
73102
Node type identifier followed by the class name.
74-
`eg.` ``"com.chantacticvfx.NodeObject"``
103+
`eg.` ``"nodeGraphQt.nodes.NodeObject"``
75104
76105
Returns:
77-
str: node type.
106+
str: node type (``__identifier__.__className__``)
78107
"""
79108
return cls.__identifier__ + '.' + cls.__name__
80109

@@ -84,7 +113,7 @@ def id(self):
84113
The node unique id.
85114
86115
Returns:
87-
str: unique id string.
116+
str: unique identifier string to the node.
88117
"""
89118
return self.model.id
90119

@@ -94,7 +123,7 @@ def graph(self):
94123
The parent node graph.
95124
96125
Returns:
97-
NodeGraphQt.NodeGraph: node graph.
126+
NodeGraphQt.NodeGraph: node graph instance.
98127
"""
99128
return self._graph
100129

docs/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
'sphinx.ext.inheritance_diagram',
5151
'sphinx.ext.intersphinx',
5252
'sphinx.ext.napoleon',
53+
'autodocsumm',
5354
]
5455

5556
intersphinx_mapping = {
@@ -69,6 +70,9 @@
6970
'NodeGraphQt.nodes.group_node.GroupNode': 'NodeGraphQt.GroupNode',
7071
}
7172

73+
# autodocsumm options
74+
autodoc_default_options = {'autosummary': True}
75+
7276
# order of members.
7377
autodoc_member_order = 'groupwise'
7478

docs/graph.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@ NodeGraph
1010

1111
.. autoclass:: NodeGraphQt.NodeGraph
1212
:members:
13-
:exclude-members: model, widget
1413
:member-order: bysource
1514

16-
.. autoattribute:: NodeGraphQt.NodeGraph.widget
17-
.. autoattribute:: NodeGraphQt.NodeGraph.model
18-
1915
SubGraph
2016
********
2117

docs/host_apps/ex_app_nuke.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Creating a node graph widget in Nuke.
77
:width: 800px
88

99
| Here is an example where the :attr:`NodeGraphQt.NodeGraph.widget` can be
10-
registered as a panel in the compositing application NUKE.
10+
registered as a panel in the compositing application NUKE.
1111
1212
.. code-block:: python
1313
:linenos:

docs/host_apps/ex_app_silhouette.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Creating a node graph widget in Silhouette FX.
1212
:width: 800px
1313

1414
| Here is an example where the :attr:`NodeGraphQt.NodeGraph.widget` can be
15-
registered as a dockable panel in the application .
15+
registered as a dockable panel in the application .
1616
1717
.. code-block:: python
1818
:linenos:

docs/nodes/NodeObject.rst

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,6 @@ NodeObject
33

44
.. autoclass:: NodeGraphQt.NodeObject
55
:members:
6-
:exclude-members: NODE_NAME, graph, id, model, type_, view
76
:member-order: bysource
87

9-
.. autoattribute:: NODE_NAME
10-
:annotation:
11-
12-
Initial base node name.
13-
14-
.. important:: re-implement this attribute to provide a base node name.
15-
16-
:return: node name
17-
:rtype: str
18-
198
.. autoattribute:: __identifier__
20-
:annotation:
21-
22-
Unique node identifier domain. eg. ``"nodeGraphQt.nodes"``
23-
24-
.. important:: re-implement this attribute to provide a unique node type.
25-
26-
:return: node identifier domain
27-
:rtype: str
28-
29-
.. autoattribute:: graph
30-
.. autoattribute:: id
31-
.. autoattribute:: model
32-
.. autoattribute:: type_
33-
:annotation:
34-
35-
Node type identifier followed by the class name (<identifier>.<class_name>). `eg.` ``"nodeGraphQt.nodes.NodeObject"``
36-
37-
:return: node type (``__identifier__.__className__``)
38-
:rtype: str
39-
40-
.. autoattribute:: view

0 commit comments

Comments
 (0)