Jekyll: How can I show what's the programming language of a given code snippet?

Created on 26 Jan 2017  ·  2Comments  ·  Source: jekyll/jekyll

For example, let's say I've this


// code here

It would be great that this code snippet could include a header showing what's the programming language being used.

Is it possible?

Thank you in advance!

frozen-due-to-age support

Most helpful comment

While its not currently possible to do this automatically, it would be a nice addition. :+1:

All 2 comments

While its not currently possible to do this automatically, it would be a nice addition. :+1:

This is possible! We output this value into an HTML attribute. A little custom JS to add a header with this value would be easy.

For the sake of simplicity, I can't see us going as far as Octopress did. I helped maintain that code and it was a real pain. There were tons of edge cases and it was all custom.

It's much better if we just rely on the markdown converter and ensure that the data – in some form – is accessible. In this case, the HTML contains the data you need so we're not really blocking you here. 👍

I don't think this is worth exploring further within Jekyll Core. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

weilinzung picture weilinzung  ·  3Comments

MertcanGokgoz picture MertcanGokgoz  ·  3Comments

jekyllbot picture jekyllbot  ·  3Comments

envygeeks picture envygeeks  ·  4Comments

PJOssenbruggen picture PJOssenbruggen  ·  3Comments