Skip to content

Instantly share code, notes, and snippets.

@hamelsmu
Created February 25, 2022 18:49
Show Gist options
  • Save hamelsmu/06a4c5024e332b60e84fb2502040de4e to your computer and use it in GitHub Desktop.
Save hamelsmu/06a4c5024e332b60e84fb2502040de4e to your computer and use it in GitHub Desktop.
Example of Schema For Docs
<DocSection type="class" name="ExampleError" module="test_lib.example" link="test_lib/example.py#L155">
<SigArgSection>
<SigArg name="msg" type="str" default="foo"/>
<SigArg name="code" type="str" default="foo"/>
</SigArgSection>
<Description summary="Exceptions are documented in the same way as classes." extended_summary="The __init__ method may be documented in either the class level\ndocstring, or as a docstring on the __init__ method itself.\n\nEither form is acceptable, but the two should not be mixed. Choose one\nconvention to document the __init__ method and be consistent with it." />
<ParamSection name="Parameters">
<Parameter name="msg" type="str" desc="Human readable string describing the exception." />
<Parameter name="code" type=":obj:`int`, optional" desc="Numeric error code." />
</ParamSection>
<ParamSection name="Attributes">
<Parameter name="msg" type="str" desc="Human readable string describing the exception." />
<Parameter name="code" type="int" desc="Numeric error code." />
</ParamSection>
<ParamSection name="Returns">
<Parameter name="msg" type="str" desc="Human readable string describing the exception." />
<Parameter name="code" type="int" desc="Numeric error code." />
</ParamSection>
</DocSection>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment