Skip to content

Define a MyST lexer for pygments #255

@pradyunsg

Description

@pradyunsg

Is your feature request related to a problem? Please describe.

"I'm always frustrated when..." I have a code block example of MyST, and it is not highlighted to make the syntax elements visible because there's no syntax highlighter that I can use with pygments that gives me highlighted MyST sources. :)

Describe the solution you'd like

A definition of a MySTLexer for pygments in this package (or upstream!) that correctly handles code blocks with MyST directives as well as inline MyST directives. :)

Describe alternatives you've considered

Maintaining status quo... which is "fine".

Additional context

A/B screenshots -- highlighting of equivalent example snippets in MyST and reST, using the default theme in pygments (md lexer vs rest lexer).

Screenshot 2020-09-21 at 2 42 13 PM

Screenshot 2020-09-21 at 2 42 09 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions