Repository: Qiskit/qiskit

Issue:
Documentation for the Pulse module: `Command` linking
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**:
- **Python version**:
- **Operating system**:

### What is the current behavior?

Locally, `Command` API cross references are not working.

With the Azure docs artifact, neither Channels nor Commands works, but Channels works for me locally! :(

### Steps to reproduce the problem

Build this locally https://github.com/Qiskit/qiskit-terra/pull/3849

### What is the expected behavior?

Clicking `Command` and `commands` should lead to another API page

### Suggested solutions

Just need to update `:mod:~qiskit.pulse.commands` probably. It should work though, so unclear!




Discussion:
@SooluThomas has been helping me with this 
The code (in #3849) is correct but the corresponding `.rst` files aren't generated in the `stubs/` folder during the build, which is why `Channels` and `command` are not hyperlinked when the html is generated. I'll look into the details and will open a PR if I find a solution.
Thank you @SooluThomas !!! ❤️ 
`:mod:foo.x` will only add a hyperlink, if the file exists. Currently, the stub files for the modules aren't generated during the build, which is why the hyperlink isn't working. 

The stub files for the modules `qiskit.pulse.channels` and `qiskit.pulse.commands.command` can be created during the build by adding 
```
.. autosummary::
   :hidden:
   :toctree: ../stubs/

   qiskit.pulse.commands.command
   qiskit.pulse.channels
```
to the end of the docstrings so that the stub files will be generated and that particular directive will be hidden.

@nonhermitian Any Ideas?

Resolving patch:
diff --git a/qiskit/pulse/__init__.py b/qiskit/pulse/__init__.py
--- a/qiskit/pulse/__init__.py
+++ b/qiskit/pulse/__init__.py
@@ -36,7 +36,7 @@
 .. _pulse-commands:
 
 Commands (:mod:`~qiskit.pulse.commands`)
-================================================
+========================================
 
 .. autosummary::
    :toctree: ../stubs/
@@ -86,6 +86,13 @@
    Schedule
    Instruction
 
+.. autosummary::
+   :hidden:
+   :toctree: ../stubs/
+
+   qiskit.pulse.commands
+   qiskit.pulse.channels
+
 Configuration
 =============
 
diff --git a/qiskit/pulse/commands/__init__.py b/qiskit/pulse/commands/__init__.py
--- a/qiskit/pulse/commands/__init__.py
+++ b/qiskit/pulse/commands/__init__.py
@@ -12,7 +12,31 @@
 # copyright notice, and modified files need to carry a notice indicating
 # that they have been altered from the originals.
 
-"""Command classes for pulse."""
+"""
+Supported command types in Pulse.
+
+.. autosummary::
+   :toctree: ../stubs/
+
+   Acquire
+   FrameChange
+   SamplePulse
+   Snapshot
+   Delay
+   Gaussian
+   GaussianSquare
+   Drag
+   ConstantPulse
+
+Abstract Classes
+----------------
+.. autosummary::
+   :toctree: ../stubs/
+
+   ParametricPulse
+   Command
+
+ """
 from .instruction import Instruction
 from .acquire import Acquire, AcquireInstruction
 from .frame_change import FrameChange, FrameChangeInstruction


Test patch: