You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,10 @@
4
4
5
5
This repository provides the Python package `openqasm-sphinx`, which provides a [Sphinx extension](https://www.sphinx-doc.org) for documentation OpenQASM 2 and 3 code.
6
6
7
+
The documentation is hosted at https://openqasm.com/openqasm-sphinx.
7
8
8
-
## Installation and use
9
+
10
+
## Installation
9
11
10
12
Install the latest release of `openqasm-sphinx` package from pip:
11
13
@@ -15,6 +17,8 @@ pip install openqasm-sphinx
15
17
16
18
This will automatically install all the dependencies as well (Sphinx, for example) if they are not already installed.
17
19
20
+
## Use
21
+
18
22
To activate the extension add `openqasm_sphinx` to your `extensions` list in your Sphinx `conf.py` file, such as:
19
23
20
24
```python
@@ -29,6 +33,25 @@ extensions = [
29
33
30
34
There is no need to import the extension; Sphinx will handle this automatically.
31
35
36
+
Document a gate by doing:
37
+
38
+
```rst
39
+
40
+
.. oq:gate:: my_gate(θ) a, b
41
+
42
+
This is my gate.
43
+
```
44
+
45
+
and later insert a cross-reference to it in inline text with:
46
+
47
+
```rst
48
+
For more information, see :oq:gate:`my_gate`.
49
+
```
50
+
51
+
If you are set `primary_domain = "oq"` in your Sphinx configuration, you can drop the `oq` prefixes.
52
+
53
+
For more complete usage information, see [the rendered documentation](https://openqasm.com/openqasm-sphinx).
0 commit comments