Skip to content

Feature Request: add Lean syntax-highlighting support #441

@lakesare

Description

@lakesare

Description

Printing .lean files produces no syntax highlighting (or incorrect highlighting from auto-detection).
From what I see, this happens because Lean language grammar is not bundled with highlight.js core, it lives in the separate third-party package highlightjs-lean, maintained by the leanprover-community.

Steps to reproduce

  1. Open any .lean file in VS Code with the vscode-lean4 extension installed
  2. Print or preview with vsc-print
  3. Observe: code is rendered as plain text with no syntax coloring

In the screenshot below, notice that e.g. comments don't get highlighted.

Image

Expected behavior

Lean keywords, tactics, literals, and comments are syntax-highlighted, similar to other supported languages.

Suggested fix

Add highlightjs-lean as a dependency and register it:

const leanHljs = require('highlightjs-lean');
hljs.registerLanguage('lean', leanHljs);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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