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

404 thebe #354

Merged
merged 4 commits into from
Jun 2, 2023
Merged

404 thebe #354

merged 4 commits into from
Jun 2, 2023

Conversation

MaldoAlberto
Copy link
Collaborator

@MaldoAlberto MaldoAlberto commented Jun 1, 2023

solve #291

Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thanks!

qiskit_sphinx_theme/__init__.py Outdated Show resolved Hide resolved
qiskit_sphinx_theme/__init__.py Outdated Show resolved Hide resolved
qiskit_sphinx_theme/__init__.py Outdated Show resolved Hide resolved
qiskit_sphinx_theme/__init__.py Outdated Show resolved Hide resolved
qiskit_sphinx_theme/__init__.py Outdated Show resolved Hide resolved
Comment on lines 41 to 46
if not doctree or doctree.traverse(ThebeButtonNode):
thebe_js_files = ["_static/sphinx-thebe.js", "_static/thebelab-helper.js", "https://unpkg.com/thebelab@latest/lib/index.js"]
context["script_files"] = [js_file for js_file in context["script_files"] if js_file not in thebe_js_files]

thebe_css_files = ['_static/thebelab.css', '_static/sphinx-thebe.css']
context["css_files"] = [css_file for css_file in context["css_files"] if css_file not in thebe_css_files]
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to early return if the condition is True.

Suggested change
if not doctree or doctree.traverse(ThebeButtonNode):
thebe_js_files = ["_static/sphinx-thebe.js", "_static/thebelab-helper.js", "https://unpkg.com/thebelab@latest/lib/index.js"]
context["script_files"] = [js_file for js_file in context["script_files"] if js_file not in thebe_js_files]
thebe_css_files = ['_static/thebelab.css', '_static/sphinx-thebe.css']
context["css_files"] = [css_file for css_file in context["css_files"] if css_file not in thebe_css_files]
if not doctree or doctree.traverse(ThebeButtonNode):
return
thebe_js_files = ["_static/sphinx-thebe.js", "_static/thebelab-helper.js", "https://unpkg.com/thebelab@latest/lib/index.js"]
context["script_files"] = [js_file for js_file in context["script_files"] if js_file not in thebe_js_files]
thebe_css_files = ['_static/thebelab.css', '_static/sphinx-thebe.css']
context["css_files"] = [css_file for css_file in context["css_files"] if css_file not in thebe_css_files]

@@ -50,6 +73,7 @@ def setup(app):
_overwrite_pygments_css,
)


Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change

@@ -16,6 +16,7 @@

from qiskit_sphinx_theme import directives, previous_releases, translations


Copy link
Collaborator

Choose a reason for hiding this comment

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

When opening a pull request, it's a good practice to look in GitHub at the diff. Are you making any changes you didn't realize? This is a good example of one. There's no reason to be adding these blank lines here. I suspect it was leftover from when you were iterating on the code.

Suggested change

Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Great work! Thanks.

@Eric-Arellano Eric-Arellano merged commit 77295f0 into Qiskit:main Jun 2, 2023
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.

2 participants