You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
Activity
jemc commentedon Nov 29, 2017
We'd like to see this as well.
waylan commentedon 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 commentedon 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
codehiliteMarkdown extension.waylan commentedon Jul 5, 2018
Fixed in #1533.