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

Feature request for latest highlight.js #1284

Closed
JenningsWu opened this issue Sep 15, 2017 · 4 comments
Closed

Feature request for latest highlight.js #1284

JenningsWu opened this issue Sep 15, 2017 · 4 comments

Comments

@JenningsWu
Copy link

@JenningsWu JenningsWu commented Sep 15, 2017

Hi,

YAML syntax highlighting are supported by highlight.js but not the current version used by mkdocs. It would be great if mkdocs could update to use the latest version of highlight.js

@jemc
Copy link

@jemc jemc commented Nov 29, 2017

We'd like to see this as well.

@waylan
Copy link
Member

@waylan waylan commented Nov 29, 2017

Pull requests are always welcome. Either way, this has been added to the 1.0.0 milestone so it should be available in that release.

@waylan
Copy link
Member

@waylan waylan commented Jun 29, 2018

I just went to update this and remembered that highlight.js has a default bundle which supports 23 languages, or you can build a custom bundle with whatever languages you want to support. Users can use MkDocs to document anything, so we shouldn't limit language support (MkDocs' own documentation uses some languages not in the default bundle: YAML and Django). At the same time, for users who only need a few languages, supporting all languages adds unnecessary bandwidth requirements.

Perhaps we should add a theme specific setting to control code highlighting. For example the user could set the option to be enabled or disabled. When enabled, the highlight.js' default set of supported languages would be used (just link to the CDN). When disabled, a user could use extra-css and extra-javascript to add their own custom bundle or use some other highlighter. A few possibilities would include using a competing JS library or providing CSS for Pygments and enabling the codehilite Markdown extension.

@waylan
Copy link
Member

@waylan waylan commented Jul 5, 2018

Fixed in #1533.

@waylan waylan closed this Jul 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants