Gumshoe not defined caused problems of header highlighting #129
-
Describe the bug My website is here and as you can see when scrolling there's no header highlighting (toc highlighting based on scroll) as demonstrated by the furo documentation site. When I open the console it said: I don't know where the problem comes from but apparently there's no Gumshoe js in the build folder. Tks for the theme, it's really awesome! furo==2021.2.28b28 My extensions are: extensions = ['sphinx.ext.mathjax', 'sphinx_autorun',
'nbsphinx', 'recommonmark', 'sphinx.ext.autosectionlabel','sphinx_copybutton',"sphinx_inline_tabs"] |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
Hiya! The link in the issue description is broken. Could you provide an updated link and/or instructions for how to fetch+build the documentation that this is occurring on? |
Beta Was this translation helpful? Give feedback.
-
Sorry ! I made some adjustments :DD So the source code is here https://github.com/nlpinfrench/nlpinfrench.github.io I also have a readthedocs page here https://nlpinfrenchgithubio.readthedocs.io/en/latest/bert/01_theorie.html |
Beta Was this translation helpful? Give feedback.
-
Seems like you're overriding main.js? That seems to be causing this issue: https://github.com/nlpinfrench/nlpinfrench.github.io/blob/master/docs/_static/scripts/main.js |
Beta Was this translation helpful? Give feedback.
-
I've checked. Once I deactivate the nbsphinx extension the highlighting works. That's unfortunate I really need this extension... Maybe I'll tell them this issue. |
Beta Was this translation helpful? Give feedback.
-
I play around a little it seems the main.js generated with and without nbsphinx are exactly the same. However when nbsphinx is activated (no highlighting with scroll) there is no class attribute appended to the list items While deactivated every li has a class attribute Maybe that's what's causing the issue ? |
Beta Was this translation helpful? Give feedback.
-
I'm not sure why the Gumshoe JS file is being removed from the list of assets. What is the list of script tags at the end of the body tag, in the two cases? |
Beta Was this translation helpful? Give feedback.
-
It's the same. This bug is really weird. <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
--
| <script src="_static/jquery.js"></script>
| <script src="_static/underscore.js"></script>
| <script src="_static/doctools.js"></script>
| <script src="_static/clipboard.min.js"></script>
| <script src="_static/copybutton.js"></script>
| <script src="_static/tabs.js"></script>
| <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
| <script async="async" src="https://assets.readthedocs.org/static/javascript/readthedocs-doc-embed.js"></script>
| <script src="_static/scripts/main.js?digest=e931d09b2a40c1bb82b542effe772014573baf67"></script></body> |
Beta Was this translation helpful? Give feedback.
-
Well I finally fix it in a quite simple way. Just add a script tag linking to the cdn of the official gumshoe. In your conf.py, add GUMSHOE = """
</script>
<script src="https://cdn.jsdelivr.net/gh/cferdinandi/gumshoe@4.0/dist/gumshoe.polyfills.min.js"></script>
<script>
"""
def setup(app):
# 3. Tell Sphinx to add your JS code. Sphinx will insert
# the `body` into the html inside a <script> tag:
app.add_js_file(None,body=GUMSHOE) I think it's a source map issue. Not sure why it happened though. Here is the working link. https://nlpinfrenchgithubio.readthedocs.io/en/latest/bert/01_theorie.html |
Beta Was this translation helpful? Give feedback.
-
Source maps are unrelated to this issue FWIW. Even doing |
Beta Was this translation helpful? Give feedback.
-
I just took a look at your repository, and it's unclear to me how you're handling deployments. You seem to have added in the build/ directory as well as the generated documentation into the repository which is generally a bad idea. I suggest deleting the build/ directory and the docs/ directory; and adding a .gitignore file containing:
And then attempting a publish w/ ReadTheDocs. Let me know if that helps with your issues. |
Beta Was this translation helpful? Give feedback.
I just took a look at your repository, and it's unclear to me how you're handling deployments.
You seem to have added in the build/ directory as well as the generated documentation into the repository which is generally a bad idea. I suggest deleting the build/ directory and the docs/ directory; and adding a .gitignore file containing:
And then attempting a publish w/ ReadTheDocs. Let me know if that helps with your issues.