Skip to content

Feature request for latest highlight.js #1284

Closed

Description

@JenningsWu

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

Activity

  1. added this to the 1.0.0 milestone on Sep 15, 2017
  2. added
    Theme-general
    on Nov 1, 2017
  3. jemc commented on Nov 29, 2017

    @jemc

    We'd like to see this as well.

  4. waylan commented on Nov 29, 2017

    @waylan
    Contributor

    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.

  5. waylan commented on Jun 29, 2018

    @waylan
    Contributor

    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.

  6. waylan commented on Jul 5, 2018

    @waylan
    Contributor

    Fixed in #1533.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementTheme-general

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions