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

Make syntax highlighting optional #183

Closed
idleberg opened this Issue Oct 30, 2014 · 13 comments

Comments

Projects
None yet
3 participants
@idleberg

idleberg commented Oct 30, 2014

It would be nice to have an option to disable the prettify class from being added to the pre-tag. Personally, I prefer using another highlighter that doesn't rely on extra classes.

@d0ugal

This comment has been minimized.

Member

d0ugal commented Oct 30, 2014

Are you adding your own highlighter with the extra css?

@idleberg

This comment has been minimized.

idleberg commented Oct 30, 2014

So far, I was only running a couple of tests on an early custom theme and noticed those classes get added. Eventually, I will use extra_css to load highlight.js — but I don't see how that influences the prettify inclusion.

@d0ugal

This comment has been minimized.

Member

d0ugal commented Oct 30, 2014

Just trying to fully understand the use case. I think this probably makes sense, I'm just trying to think how we best do it without adding more and more config options.

@tomchristie

This comment has been minimized.

Contributor

tomchristie commented Oct 30, 2014

Isn't the hightlighting entirely dependant on the theme - is using a custom theme the right answer here?

@d0ugal

This comment has been minimized.

Member

d0ugal commented Oct 30, 2014

@idleberg

This comment has been minimized.

idleberg commented Oct 30, 2014

If you don't like adding more config options, then maybe a switch (e.g. --no-prettify) works better?

@tomchristie

This comment has been minimized.

Contributor

tomchristie commented Oct 30, 2014

Ideally we ought to tweak the default css/javascript so it doesn't require us to postprocess the html in that way.

maybe a switch (e.g. --no-prettify) works better?

Nah. Extra switches are not any better than extra config.

@d0ugal

This comment has been minimized.

Member

d0ugal commented Oct 30, 2014

+1 to fixing the default css. Should just be a case of changing https://github.com/tomchristie/mkdocs/blob/master/mkdocs/themes/mkdocs/css/prettify-1.0.css

@d0ugal

This comment has been minimized.

Member

d0ugal commented Oct 30, 2014

... and removing the hack in the code of course :)

@tomchristie

This comment has been minimized.

Contributor

tomchristie commented Oct 30, 2014

@d0ugal May also be some javascript that keys into that?

@d0ugal

This comment has been minimized.

@idleberg idleberg closed this Nov 3, 2014

@idleberg

This comment has been minimized.

idleberg commented Nov 3, 2014

Awesome, will check it out when I get home

@idleberg

This comment has been minimized.

idleberg commented Nov 4, 2014

Works, thanks a lot guys!

d0ugal added a commit that referenced this issue Nov 6, 2014

Merge pull request #190 from ngzhian/optional-syntax-highlight
Fix #183: Don't add classes to code blocks

@d0ugal d0ugal added this to the 0.11.0 milestone Nov 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment