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

Missing pygments Styles on RTD Hosted Docs #633

Closed
shawnbrown opened this issue May 7, 2018 · 6 comments
Closed

Missing pygments Styles on RTD Hosted Docs #633

shawnbrown opened this issue May 7, 2018 · 6 comments
Assignees

Comments

@shawnbrown
Copy link

shawnbrown commented May 7, 2018

Problem

Since the first week of May 2018 (coinciding with the release sphinx_rtd_theme 0.3.1), some projects on http://readthedocs.org no longer display syntax highlighting. While the live site no longer highlights code, the HTML and PDF downloads seem to be fine.

The HTML files do include the proper Pygments class attributes...

<div class="code python highlight-default">
    <div class="highlight">
        <pre>
            <span></span><span class="n">html_theme</span> <span class="o">=</span> <span class="s2">&quot;sphinx_rtd_theme&quot;</span>
            <span class="n">html_theme_path</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;_themes&quot;</span><span class="p">,</span> <span class="p">]</span>
        </pre>
    </div>
</div>

...but builds on http://readthedocs.org no longer include any CSS styles for these classes.

These styles used to be included in theme.css but they were removed: c43d473#diff-8b5d5b0b20fffbc206fe1081243fb125L4. Locally, my builds include pygments.css but this file is not being included on the live site.

Reproducible Project

I first noticed this with my own docs but I see that this is also happening in the sphinx-rtd-theme docs too:

Error Logs/Results

My builds are passing so I don't think this has anything to do with a change in my own conf.py:

Environment Info

Since this occurs on http://readthedocs.org/, I don't have access to the environment details but it does appear to be using sphinx-rtd-theme 0.3.1.

@Blendify
Copy link
Member

Blendify commented May 7, 2018

@agjohnson seems like an error on RTD.

@stsewd
Copy link
Member

stsewd commented May 7, 2018

Maybe is the same issue as readthedocs/readthedocs.org#4050?

@jessetan
Copy link
Contributor

jessetan commented May 8, 2018

Your latest docs do have syntax highlighting, but your stable does not. This looks like it was fixed by pinning to a newer version of the theme.

@shawnbrown
Copy link
Author

@jessetan, yes I pinned the new version (as mentioned in the link @stsewd provided) and changed my pygments_style property.

Here are the specific changes I made:

  • In the documentation's conf.py file, I changed pygments_style = 'sphinx' to pygments_style = 'default'.
  • In the project's requirements.txt, I changed sphinx_rtd_theme to sphinx_rtd_theme>=0.3.1.

This seems to have worked for me. I'll leave closing this issue up to your discretion--I wouldn't have opened a new issue, myself, if I had seen the closed one in the readthedocs.org repo so maybe it's good to keep this open until the updated theme is used by default on Read the Docs.

@davidfischer
Copy link
Contributor

I'll wait until readthedocs/readthedocs.org#4096 rolls out and then I think we can close this.

@ericholscher
Copy link
Member

This should be fixed 👍

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

7 participants