Skip to content

Commit 9e4d5ed

Browse files
committed
Show more details in API docs #10
This includes members of enums, plus fields for class types and events.
1 parent 29d2798 commit 9e4d5ed

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

generator/generate.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,8 +849,15 @@ def generate_sphinx(self) -> str:
849849
docs += '* Types_\n* Commands_\n* Events_\n\n'
850850

851851
docs += 'Types\n-----\n'
852+
docs += '\nGenerally you do not need to instantiate CDP types ' \
853+
'yourself. Instead, the API creates objects for you as return ' \
854+
'values from commands, and then you can use those objects as ' \
855+
'arguments to other commands.\n'
852856
for type in self.types:
853857
docs += f'\n.. autoclass:: {type.id}\n'
858+
docs += ' :members:\n'
859+
docs += ' :undoc-members:\n'
860+
docs += ' :exclude-members: from_json, to_json\n'
854861

855862
docs += '\nCommands\n--------\n'
856863
for command in sorted(self.commands, key=operator.attrgetter('py_name')):
@@ -859,6 +866,9 @@ def generate_sphinx(self) -> str:
859866
docs += '\nEvents\n------\n'
860867
for event in self.events:
861868
docs += f'\n.. autoclass:: {event.py_name}\n'
869+
docs += ' :members:\n'
870+
docs += ' :undoc-members:\n'
871+
docs += ' :exclude-members: from_json, to_json\n'
862872

863873
return docs
864874

generator/test_generate.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,8 @@ def test_cdp_domain_sphinx():
928928
Types
929929
-----
930930
931+
Generally you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.
932+
931933
.. autoclass:: KeyframeStyle
932934
933935
Commands

0 commit comments

Comments
 (0)