File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828''' .format (SHARED_HEADER )
2929
3030MODULE_HEADER = '''{}
31-
32- \' \' \'
33- CDP {{}} Domain{{}}
34- \' \' \'
31+ #
32+ # CDP domain: {{}}{{}}
3533
3634from __future__ import annotations
3735from cdp.util import event_class, T_JSON_DICT
@@ -843,12 +841,24 @@ def generate_sphinx(self) -> str:
843841 '''
844842 docs = self .domain + '\n '
845843 docs += '=' * len (self .domain ) + '\n \n '
846-
847844 if self .description :
848845 docs += f'{ self .description } \n \n '
846+ if self .experimental :
847+ docs += '*This CDP domain is experimental.*\n \n '
848+ docs += f'.. module:: cdp.{ self .module } \n \n '
849+ docs += '* Types_\n * Commands_\n * Events_\n \n '
849850
850- docs += f'.. automodule:: cdp.{ self .module } \n '
851- docs += ' :members:\n '
851+ docs += 'Types\n -----\n '
852+ for type in self .types :
853+ docs += f'\n .. autoclass:: { type .id } \n '
854+
855+ docs += '\n Commands\n --------\n '
856+ for command in sorted (self .commands , key = operator .attrgetter ('py_name' )):
857+ docs += f'\n .. autofunction:: { command .py_name } \n '
858+
859+ docs += '\n Events\n ------\n '
860+ for event in self .events :
861+ docs += f'\n .. autoclass:: { event .py_name } \n '
852862
853863 return docs
854864
Original file line number Diff line number Diff line change @@ -911,8 +911,28 @@ def test_cdp_domain_sphinx():
911911
912912 This is the animation domain.
913913
914- .. automodule:: cdp.animation
915- :members:
914+ *This CDP domain is experimental.*
915+
916+ .. module:: cdp.animation
917+
918+ * Types_
919+ * Commands_
920+ * Events_
921+
922+ Types
923+ -----
924+
925+ .. autoclass:: KeyframeStyle
926+
927+ Commands
928+ --------
929+
930+ .. autofunction:: get_current_time
931+
932+ Events
933+ ------
934+
935+ .. autoclass:: AnimationCanceled
916936 """ )
917937 domain = CdpDomain .from_json (json_domain )
918938 actual = domain .generate_sphinx ()
You can’t perform that action at this time.
0 commit comments