ev3dev / ev3dev.github.io

pretty web page for ev3dev
http://www.ev3dev.org
46 stars 190 forks source link

Replace pygments and {% highlight %} syntax with GFM #308

Open dlech opened 7 years ago

dlech commented 7 years ago

I have just seen this, which has convinced me that using GFM code fences is the right way to go (even though I don't particularly like them).

The highlight zone

GitHub Pages now only supports Rouge, a pure-Ruby syntax highlighter, meaning you no longer need to install Python and Pygments to preview your site locally. If you were previously using Pygments for highlighting, the two libraries are feature compatible, so we'll swap Rouge in for Pygments when we build your site, to ensure a seamless transition.

Traditionally, highlighting in Jekyll has been implemented via the {% highlight %} Liquid tag, forcing you to leave a pure-Markdown experience. With kramdown and Rouge as the new defaults, syntax highlighting on GitHub Pages should work like you'd expect it to work anywhere else on GitHub, with native support for backtick-style fenced code blocks right within the Markdown.

dlech commented 7 years ago

So, we should replace all instances of {% highlight %} and drop the pygments css.

WasabiFan commented 7 years ago

Does this mean that we can drop that extra CSS? IIRC from my testing a few weeks ago, neither code formatting method worked without the custom CSS. Or maybe the issue was that the default CSS didn't look right on our site... I'm not sure.

dlech commented 7 years ago

Did you edit highlight: in _config.yml? I haven't tried it, you could be right that we need to keep the css.

WasabiFan commented 7 years ago

Maybe? 😊 I can't say it was a particularly scientific test... I don't want to draw any conclusions based on my demonstrably bad memory.