107 lines
3.9 KiB
Plaintext
107 lines
3.9 KiB
Plaintext
---
|
||
title: inline_classes (latest version)
|
||
description: API reference for api_example.inline_classes in the latest version of qiskit-sphinx-theme
|
||
in_page_toc_min_heading_level: 2
|
||
python_api_type: module
|
||
python_api_name: api_example.inline_classes
|
||
---
|
||
|
||
<span id="module-api_example.inline_classes" />
|
||
|
||
<span id="api-example-inline-classes" />
|
||
|
||
# Inline classes
|
||
|
||
This is a page to test out how we render classes and functions included inline in the page. This is common with module pages.
|
||
|
||
## Important APIs
|
||
|
||
Every time you use this program, you’ll want to create an instance of [`api_example.inline_classes.SimpleInlineClass`](#api_example.inline_classes.SimpleInlineClass "api_example.inline_classes.SimpleInlineClass"). It has a simple interface:
|
||
|
||
### SimpleInlineClass
|
||
|
||
<Class id="api_example.inline_classes.SimpleInlineClass" github="https://github.com/Qiskit/qiskit_sphinx_theme/tree/stable/0.1/api_example/inline_classes.py" signature="api_example.inline_classes.SimpleInlineClass(arg1)" modifiers="class">
|
||
This is a simple class that does not have any methods or attributes.
|
||
|
||
It only has the class description and constructor. Many classes in Qiskit docs are simple like this.
|
||
</Class>
|
||
|
||
It can be useful to use free functions rather than the class:
|
||
|
||
### inline\_function
|
||
|
||
<Function id="api_example.inline_classes.inline_function" github="https://github.com/Qiskit/qiskit_sphinx_theme/tree/stable/0.1/api_example/inline_classes.py" signature="api_example.inline_classes.inline_function(input1, input2)">
|
||
A function that does awesome stuff.
|
||
|
||
**Returns**
|
||
|
||
Did the function work.
|
||
|
||
**Return type**
|
||
|
||
int
|
||
</Function>
|
||
|
||
Sometimes, you even need to use a really complex class!
|
||
|
||
### InlineClassWithMethods
|
||
|
||
<Class id="api_example.inline_classes.InlineClassWithMethods" github="https://github.com/Qiskit/qiskit_sphinx_theme/tree/stable/0.1/api_example/inline_classes.py" signature="api_example.inline_classes.InlineClassWithMethods" modifiers="class">
|
||
Bases: `object`
|
||
|
||
This class is more involved.
|
||
|
||
Note how the methods and attributes are rendered and indented when this class is inlined on the docs page.
|
||
|
||
#### CLASS\_ATTRIBUTE
|
||
|
||
<Attribute id="api_example.inline_classes.InlineClassWithMethods.CLASS_ATTRIBUTE" attributeTypeHint="str" attributeValue="'An important part of any API.'" />
|
||
|
||
#### interest\_rate
|
||
|
||
<Attribute id="api_example.inline_classes.InlineClassWithMethods.interest_rate" />
|
||
|
||
#### method1
|
||
|
||
<Function id="api_example.inline_classes.InlineClassWithMethods.method1" signature="method1()">
|
||
A simple method.
|
||
|
||
**Return type**
|
||
|
||
int
|
||
</Function>
|
||
|
||
#### method2
|
||
|
||
<Function id="api_example.inline_classes.InlineClassWithMethods.method2" signature="method2(arg1, arg2, description)">
|
||
A method with a lot of args!
|
||
|
||
This method will use a Hamiltonian to reach quantum advantage. Hamilton: great play & the secret to quantum computing. What a polymath.
|
||
|
||
**Parameters**
|
||
|
||
* **arg1** (*int | float*) – All numbers accepted.
|
||
* **arg2** (*list\[*[*InlineClassWithMethods*](#api_example.inline_classes.InlineClassWithMethods "api_example.inline_classes.InlineClassWithMethods")*]*) – A list of other instances, although these will be discarded.
|
||
* **description** (*str*) – If your description is too boring or too cryptic, this program will crash your computer.
|
||
|
||
**Return type**
|
||
|
||
tuple\[int, [*InlineClassWithMethods*](#api_example.inline_classes.InlineClassWithMethods "api_example.inline_classes.InlineClassWithMethods")]
|
||
</Function>
|
||
</Class>
|
||
|
||
### Warning: exceptions
|
||
|
||
The above APIs might raise an exception! Be careful!
|
||
|
||
#### CustomException
|
||
|
||
<Class id="api_example.inline_classes.CustomException" github="https://github.com/Qiskit/qiskit_sphinx_theme/tree/stable/0.1/api_example/inline_classes.py" signature="api_example.inline_classes.CustomException" modifiers="exception">
|
||
See how exceptions render too.
|
||
</Class>
|
||
|
||
## Other prose
|
||
|
||
Blah blah blah.
|
||
|