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

Fix 404s of Thebe files #291

Closed
Eric-Arellano opened this issue May 2, 2023 · 0 comments
Closed

Fix 404s of Thebe files #291

Eric-Arellano opened this issue May 2, 2023 · 0 comments
Milestone

Comments

@Eric-Arellano
Copy link
Collaborator

Eric-Arellano commented May 2, 2023

Problem

When using the jupyter-sphinx extension, we get 404s for some missing files. This is due to jupyter/jupyter-sphinx#163.

Screenshot 2023-05-30 at 12 50 06 PM

We actually don't really like the jupyter-sphinx extension anymore and are trying to get rid of it. But still the majority of Qiskit projects use it, so this is probably worth fixing.

How to reproduce

Build the docs with tox -e docs.

Then start up a web server to render the docs with python3 -m http.server -d example_docs/docs/_build/html. It will print to the console what website to go to, I think localhost:8000. It is useful to build the docs with a server because it fixes a bunch of errors you'd normally see in the Developer Console.

Then, open up the Developer Console and look at the 404 errors.

Proposed solution

See jupyter/jupyter-sphinx#163 (comment) and what it links to at sphinx-doc/sphinx#6241 (comment).

I believe you will want to add that code snippet to qiskit_sphinx_theme/__init__.py. In the file's setup function, add a line like this:

app.connect('config-inited', extend_html_context)

But the event is 'html-page-context', not 'config-inited'.

@Eric-Arellano Eric-Arellano added this to the Theme v1.12.0 milestone May 2, 2023
@Eric-Arellano Eric-Arellano self-assigned this May 2, 2023
Eric-Arellano added a commit that referenced this issue May 4, 2023
…pt (#292)

1. Remove references to `js/vendor`, which was removed in
#17
2. Remove reference to `css.theme.map`, which we never distribute since
we never minify `css.theme` to begin with
3. Remove invalid JavaScript references to `pytorch-shortcuts-wrapper`
and `header-holder`, which no longer exist in our HTML template and
caused the JavaScript to fail to run.

The main console error I still get is tracked by
#291. (FYI: to avoid
a bunch of console errors when developing, you need to serve the app
with e.g. `python3 -m http.server`, rather than opening `index.html`
directly.)

As a result of this change, the right page table of contents now shows
subheadings! You can click the + or - to expand it.

![Screenshot 2023-05-04 at 1 02 48
PM](https://user-images.githubusercontent.com/14852634/236303682-915ac4de-e500-4525-849a-062245e91762.png)
@Eric-Arellano Eric-Arellano removed this from the Theme v1.12.0 milestone May 5, 2023
@Eric-Arellano Eric-Arellano added this to the Theme v1.13.0 milestone May 12, 2023
@Eric-Arellano Eric-Arellano removed their assignment May 17, 2023
@MaldoAlberto MaldoAlberto mentioned this issue Jun 1, 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

No branches or pull requests

1 participant