Qiskit / qiskit_sphinx_theme

A Sphinx theme and documentation guidelines for Qiskit and Qiskit Ecosystem projects
https://qisk.it/docs-guide
Apache License 2.0
15 stars 29 forks source link

Fix Furo styling for API pages with methods on class page (Cherry-pick of #458) #478

Closed Eric-Arellano closed 1 year ago

Eric-Arellano commented 1 year ago

We're planning to switch some Qiskit projects to stop having dedicated HTML pages per method, mostly due to performance concerns.

Closes https://github.com/Qiskit/qiskit_sphinx_theme/issues/466. Methods were using inline-block rather than block when on the classes page, which resulted in a bug when highlighting over the method to show the # anchor tag:

Screenshot 2023-07-07 at 11 25 45
AM

Instead, we now turn off floating of the [source] label because it causes issues on long code signatures:

Screenshot 2023-07-07 at 3 02 44
PM

After:

Screenshot 2023-07-07 at 3 03 08
PM

Even though the [source] floating to the right is more "elegant", we have too many long signatures in Qiskit to be worth it. It's safer to turn off the float.

This also improves the information hierarchy so that page feels less crowded. Relates to https://github.com/Qiskit/qiskit_sphinx_theme/issues/459: