-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Better JavaScript syntax highlighting #441
Comments
PRs are welcome anytime. |
Yep, this would be a great addition! |
@TimKam What Atom UI/Syntax do you use? |
#448 should fix this. |
Could I have some feedback on this please? In my case, it isn't JS that's the problem, but other Pygments lexers. With "classic" html_theme the colours are strong, the bolding good, and the sizes slightly bigger, and the background different from RTD. I don't mind the size change or background difference much, but the Pygments colours are basically clobbered. The bolding is unnoticeable and almost all the colour is bled away, except the disgusting bright red used for string literals. This is running the online version of RTD. Shouldn't the theme respect the Pygments colours? The problem I have is that the tokenisation scheme used doesn't really fit my language or what I want to see, so I have to fudge a bit to get the appearance right, but nothing works on RTD. My language (Felix) isn't the only one impacted. C++ code is similarly impacted. Comments get faded to almost unreadable status, colour is bled away. |
The reason this does not work is that the HTML is not aware of the Pygments CSS #448 was going to fix this but this change is now included in a larger set of changes that can be found in this PR: #467. There are two temp fixes:
|
Ok thanks! actually I used a a <style> tag in a _template/layout.html and that seemed to work. The template gets injected after the main css is linked so it overrides it. |
Basic support for this has been added and #504 finishes this up. Closing. |
The Sphinx Read the Docs theme could do better in highlighting JavaScript code:
Sphinx/Pygments already provides the necessary classes:
So this should be merely a matter of adding additional styles.
If this makes sense to you, I could try to find the time for creating a PR.
The text was updated successfully, but these errors were encountered: