Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add qiskit-card-item and qiskit-call-to-action-item directives #326

Merged
merged 5 commits into from
May 16, 2023

Conversation

Eric-Arellano
Copy link
Collaborator

@Eric-Arellano Eric-Arellano commented May 12, 2023

Closes #323. These are used by several Qiskit projects, so we should de-duplicate them.

Screenshot 2023-05-16 at 10 02 55 AM

Alternative considered: stop using these elements

For example, these elements will be somewhat tricky to get working with Furo: #327.

We considered removing these design elements and instead using standard Sphinx. For example, rather than having qiskit-call-to-action-item with its clickable button to go to a URL, we could instead rely on normal Sphinx links, or the left table of contents, and decide we don't care about the button.

We decided that we like these design elements enough to keep them. It would be a UX regression to remove them. We may want to improve the styling—but we will still need the RST directive. We may also remove these directives in some future, but only after finding a better alternative.

README.md Outdated Show resolved Hide resolved
Comment on lines +8 to +11
.. raw:: html

<div class="tutorials-callout-container">
<div class="row">
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this is not included in the customcalloutitem because it's common to have multiple "items" in a group. This is the outer container code.

customcarditem
==============

.. raw:: html
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto that this is not included in the customcarditem because it's common to have multiple "items" in a group. This is the outer container code.

@@ -29,6 +29,7 @@
"Framework :: Sphinx :: Theme",
],
install_requires=[
"docutils",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI this was already being installed via Sphinx. But it's a best practice to explicitly list out all dependencies that we directly depend on, i.e. that we import.

@Eric-Arellano Eric-Arellano changed the title Add customcardelement and customcalloutitem directives Add qiskit-card-item and qiskit-call-to-action-item directives May 16, 2023
Copy link
Collaborator

@coruscating coruscating left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally okay with this, but is it doing something that can't be done with sphinx-design and custom CSS?

README.md Show resolved Hide resolved
@Eric-Arellano
Copy link
Collaborator Author

I'm generally okay with this, but is it doing something that can't be done with sphinx-design and custom CSS?

I have a feeling this is the direction we'll want to go. But we were thinking it's not really a high priority to make that migration in the next month, compared to things like Furo.

So for now, at least make things less bad by removing the duplication across 6 projects.

README.md Show resolved Hide resolved
qiskit_sphinx_theme/__init__.py Outdated Show resolved Hide resolved
@@ -1,6 +1,6 @@
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2023.
# (C) Copyright IBM 2021, 2023.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this change for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at Git history, the file was first introduced 2021, not 2018. So I fixed it to not lie.

Copy link
Collaborator

@javabster javabster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@Eric-Arellano Eric-Arellano merged commit e89b094 into Qiskit:main May 16, 2023
@Eric-Arellano Eric-Arellano deleted the dry-directives branch May 16, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deduplicate custom_directives.py
4 participants