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

Using Custom Pygments Styles #1121

Closed
8thHalfHour opened this issue Apr 9, 2021 · 3 comments
Closed

Using Custom Pygments Styles #1121

8thHalfHour opened this issue Apr 9, 2021 · 3 comments
Labels
Bug A bug Needed: replication Bug replication is required

Comments

@8thHalfHour
Copy link

8thHalfHour commented Apr 9, 2021

Problem

There is a lot of conflicting information as to how to add custom pygments styles in the issues here and on other sites, many of which seem to work for some people and not for others. I would like to see a recommended method of adding custom pygment styles to the RTD theme added to the official documentation so it is very easy to understand and implement.

Reproducible Project

N/A

Error Logs/Results

N/A

Expected Results

There should be at least one detailed, easily consumable description of how to add custom pygments styles to the Sphinx RTD theme included in the official documentation.

Environment Info

  • Python Version: v3.9.3
  • Sphinx Version: v3.5.3
  • RTD Theme Version: v0.5.2
@8thHalfHour 8thHalfHour added Bug A bug Needed: replication Bug replication is required labels Apr 9, 2021
@Blendify
Copy link
Member

Blendify commented Apr 9, 2021

Setting the pygments_style is the official method. See sphinx documentation: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-pygments_style

@Blendify Blendify closed this as completed Apr 9, 2021
@8thHalfHour
Copy link
Author

8thHalfHour commented Apr 10, 2021

Yes, I understand that that is the way to select pygments styles from the RTD theme itself. I’m asking how to add — and where to add — custom themes not in the RTD theme. This is a question that has been asked about a thousand times on the Interwebs and in the issues here, and so far, there has been no official recommendation. Unless you are saying that your official recommendation is that no one use their own pygments styles?

@Blendify
Copy link
Member

Sorry for misunderstanding your original question. From a quick google search, I found this: https://pygments.org/docs/styles/#creating-own-styles

If you have issues I would recommend reaching out to Sphinx itself rather than here in the sphinx-rtd-theme as creating a pygments style is independent of theme, the theme uses whatever is given to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: replication Bug replication is required
Projects
None yet
Development

No branches or pull requests

2 participants