Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我建立了一个 Jekyll 博客,并且我有以下用于语法高亮的配置。
markdown: redcarpet highlighter: pygments
这使我可以像这样添加语法突出显示:
```javascript function blah(){ } ```
有没有办法保持这种格式但添加行号?
开箱即用的 Jekyll 代码高亮:
{% highlight ruby linenos %} def foo puts 'foo' end {% endhighlight %}
并且无需使用 javascript 突出显示。只需添加pygmentscss。
pygments