Skip to content

Commit 3da117c

Browse files
committed
docs clean up
1 parent 983bb9d commit 3da117c

File tree

17 files changed

+133
-157
lines changed

17 files changed

+133
-157
lines changed

NodeGraphQt/base/graph.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424

2525
class NodeGraph(QtCore.QObject):
2626
"""
27-
base node graph controller.
27+
The ``NodeGraph`` class is the main controller for managing all nodes.
28+
29+
Inherited from: ``PySide2.QtCore.QObject``
30+
31+
.. image:: _images/graph.png
32+
:width: 60%
2833
"""
2934

3035
#:QtCore.Signal: emits the node object when a node is created in the node graph.

NodeGraphQt/base/node.py

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ def __get__(self, instance, owner):
2727

2828
class NodeObject(object):
2929
"""
30-
base class for all node objects.
30+
The ``NodeGraphQt.NodeObject`` class is the main base class that all
31+
nodes inherit from.
32+
33+
**Inherited by:** :class:`NodeGraphQt.BaseNode`, :class:`NodeGraphQt.BackdropNode`
3134
3235
Args:
3336
qgraphics_item (AbstractNodeItem): graphic item used for drawing.
@@ -78,7 +81,7 @@ def id(self):
7881
@property
7982
def graph(self):
8083
"""
81-
The parent node graph controller.
84+
The parent node graph.
8285
8386
Returns:
8487
NodeGraphQt.NodeGraph: node graph.
@@ -366,7 +369,37 @@ def pos(self):
366369

367370
class BaseNode(NodeObject):
368371
"""
369-
base class of a typical Node with input and output ports.
372+
The ``NodeGraphQt.BaseNode`` class is the base class for nodes that allows
373+
port connections from one node to another.
374+
375+
**Inherited from:** :class:`NodeGraphQt.NodeObject`
376+
377+
.. image:: ../_images/node.png
378+
:width: 250px
379+
380+
example snippet:
381+
382+
.. code-block:: python
383+
:linenos:
384+
385+
from NodeGraphQt import BaseNode
386+
387+
class FooNode(BaseNode):
388+
389+
# unique node identifier domain.
390+
__identifier__ = 'com.chantasticvfx'
391+
392+
# initial default node name.
393+
NODE_NAME = 'Foo Node'
394+
395+
def __init__(self):
396+
super(FooNode, self).__init__()
397+
398+
# create an input port.
399+
self.add_input('in')
400+
401+
# create an output port.
402+
self.add_output('out')
370403
"""
371404

372405
NODE_NAME = 'Base Node'
@@ -664,7 +697,13 @@ def on_input_disconnected(self, in_port, out_port):
664697

665698
class BackdropNode(NodeObject):
666699
"""
667-
base class of a Backdrop node.
700+
The ``NodeGraphQt.BackdropNode`` class allows other node object to be
701+
nested inside, it's mainly good for grouping nodes together.
702+
703+
**Inherited from:** :class:`NodeGraphQt.NodeObject`
704+
705+
.. image:: ../_images/backdrop.png
706+
:width: 250px
668707
"""
669708

670709
NODE_NAME = 'Backdrop'

NodeGraphQt/base/port.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010

1111
class Port(object):
1212
"""
13-
base class for a node port.
13+
The ``Port`` class is used for connecting one node to another.
14+
15+
.. image:: ../_images/port.png
16+
:width: 50%
1417
1518
Args:
1619
node (NodeGraphQt.NodeObject): parent node.

docs/_static/ngqt.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ div.highlight{
271271
}
272272

273273
div.note {
274-
background-color: #544322;
275-
border: 1px solid #bf9d3b;
274+
background-color: #223854;
275+
border: 1px solid #3b7cbf;
276276
border-radius: 4px;
277277
}
278278

@@ -283,7 +283,9 @@ div.seealso {
283283
}
284284

285285
div.topic {
286-
background-color: #eee;
286+
background-color: #232427;
287+
border: 1px solid #2f3b4c;
288+
border-radius: 4px;
287289
}
288290

289291
div.warning {

docs/classes.rst

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
extensions = [
4747
'sphinx.ext.autodoc',
4848
'sphinx.ext.autosectionlabel',
49+
'sphinx.ext.autosummary',
4950
'sphinx.ext.coverage',
5051
'sphinx.ext.intersphinx',
5152
'sphinx.ext.napoleon',
@@ -56,6 +57,12 @@
5657
'PySide2': ('https://doc.qt.io/qtforpython/', None),
5758
}
5859

60+
# autosummary generate stubs.
61+
autosummary_generate = True
62+
63+
# autosummary overwrite generated stubs files.
64+
autosummary_generate_option = True
65+
5966
# Add any paths that contain templates here, relative to this directory.
6067
templates_path = ['_templates']
6168

docs/connections.rst

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/constants.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Constants
2-
*********
2+
#########
33

44
.. automodule:: NodeGraphQt.constants
55
:members:

docs/graph.rst

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
1-
Graph
2-
*****
3-
4-
**Inherited from:** :class:`PySide2.QtCore.QObject`
5-
6-
The ``NodeGraph`` class is the main controller for managing all nodes.
7-
8-
.. image:: _images/graph.png
9-
:width: 60%
10-
111
NodeGraph
12-
=========
13-
14-
NodeGraph Attributes
15-
--------------------
16-
17-
.. autoattribute:: NodeGraphQt.NodeGraph.widget
18-
.. autoattribute:: NodeGraphQt.NodeGraph.model
19-
20-
NodeGraph Class
21-
---------------
2+
#########
223

234
.. autoclass:: NodeGraphQt.NodeGraph
245
:members:
256
:exclude-members: model, widget
7+
8+
----
9+
10+
.. autoattribute:: NodeGraphQt.NodeGraph.widget
11+
.. autoattribute:: NodeGraphQt.NodeGraph.model

docs/index.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
NodeGraphQt
2-
***********
2+
###########
33

44
Welcome to the ``NodeGraphQt`` documentation.
55

6-
.. image:: _images/example_result.png
7-
:width: 60%
6+
.. image:: _images/screenshot.png
7+
:width: 95%
88

9-
Project: https://github.com/jchanvfx/NodeGraphQt
9+
Project Repo: https://github.com/jchanvfx/NodeGraphQt
1010

11-
12-
Contents
13-
========
11+
----
1412

1513
.. toctree::
14+
:name: mastertoc
1615
:maxdepth: 3
1716

1817
overview
1918
constants
20-
classes
19+
graph
20+
nodes
21+
menu
2122
widgets

0 commit comments

Comments
 (0)