Skip to content

Add Support for Displaying Language Name Option as a Header in Rouge #2119

@0xh3xa

Description

@0xh3xa

Is your enhancement request related to a problem?

Currently, Rouge does not provide an option to display the programming language name as a header above the code block. This makes it difficult for users to quickly identify the language, especially when multiple code snippets are present in a document. It would enhance readability and usability if the language name was automatically displayed.

Image

Describe the solution you'd like

I would like Rouge to include an option that allows the language name to be displayed as a header above the code block. This could be implemented as:

  • An optional setting in Jekyll or Rouge itself.

  • A built-in style that adds the language name dynamically before rendering the code block.

  • A CSS class or additional metadata that allows themes to customize the appearance of the language header.

Additional context

Many other syntax highlighters, such as Prism.js and Highlight.js, offer this feature, making it easier for users to identify languages at a glance. Implementing this in Rouge would improve its usability and make it a more feature-complete option for static site generators like Jekyll.

For example the following:

Image

Would love to hear your thoughts on whether this is feasible and how best it could be integrated into Rouge!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement-requestA request for an enhancement to be developed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions