-
Notifications
You must be signed in to change notification settings - Fork 47
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
Styling of generated code/markup via CSS/pygments #23
Comments
@thaxy you can generate CSS styles using the Pygments but its easiest if you just take one of the pre-generated css files from here. https://github.com/richleland/pygments-css You may need to adjust the CSS a bit (change .highlight to .code) |
Nevermind, I didn't understand that properly on first read. Indeed, I have not seen the 'long' class names either so far, I have to investigate. |
Okay, I am looking at this for around 1h now and I couldn't find any solution yet. Thanks for your support. I will update you if I find something. |
@thaxy I was not able yet to generate a Pygments CSS file with "long" classnames, but Docutils has a setting http://docutils.sourceforge.net/docs/user/config.html#syntax-highlight I could overwrite this setting in the RestructuredFilter code directly and make So you could either write your own rST markup filter, with these rst-formatter-settings, but the simplest way is to override filter settings for the existing rST markup filter. There's a feature to do this: https://django-markup.readthedocs.io/en/latest/filter_settings.html These settings in your
Example:
Here the
And the
|
I know the following is a bit general and not tightly related to this repo but maybe you can make the following use case a bit more clearer for new users like me
Could you add an explanation to the documentation how to apply styles for the (rst) generated markup?
I am a bit lost here because pygments seems to abbreviate the classes like
kn
ornn
see: http://pygments.org/docs/styles/#builtin-stylesBut instead, I get something like below. I saw that the unit test covers this with long class names too but I wonder why.
The text was updated successfully, but these errors were encountered: