我使用 jekyll的最小主题
我正在Markdown中写下页面。在我的_config.yml文件中,我有选项:
markdown: kramdown
highlighter: rouge
kramdown:
input: GFM
syntax_highlighter: rouge
以某种方式,代码并未突出显示: https:/> https:/ /sergedmi.github.io/pages/arccos
请注意,最小主题确实包含
该代码在github中正确突出显示:
有技巧吗?
I created a github page, using jekyll's minimal theme
I'm writing the pages in markdown. In my _config.yml file, I have the options :
markdown: kramdown
highlighter: rouge
kramdown:
input: GFM
syntax_highlighter: rouge
Somehow, the code is however not highlighted : https://sergedmi.github.io/pages/arccos
Note that the minimal theme does contain a css stylesheet that should highlight the code according to rouge markup.
The code is correctly highlighted in github : https://github.com/SergeDmi/SergeDmi.github.io/blob/master/pages/arccos.md
Any tip ?
发布评论
评论(1)
更新的答案
我相信修复程序是将
c ++
更改为cpp
在您的标记代码块中。这是我测试修复程序的方式。
jekyll new CPP检验
_CONFIG.YML
用于使用rouge
用于代码块语法突出显示。中运行
目录Jekyll S
CPP检测渲染
是
c ++
的样子这是
cpp
的样子原始答案
是您需要在Markdown代码块中使用
CPP
而不是C ++
?如果您将
C ++
cpp
切换,则GitHub将语法突出显示您的代码块相同。Rouge文档C ++为
cpp
此处 https ://github.com/rouge-ruby/rouge/blob/master/docs/languages.md 。Updated Answer
I am confident that the fix is to change
C++
tocpp
in your Markdown code blocks.Here is how I tested the fix.
jekyll new cpp-test
_config.yml
to userouge
for code block syntax highlighting.jekyll s
in newcpp-test
directoryRendering
Here is what it looks like with

C++
Here is what it looks like with

cpp
Original Answer
Could it be that you need to use
cpp
instead ofC++
in your Markdown code blocks?It looks like GitHub will syntax highlight your code blocks the same if you switch
C++
tocpp
.Rouge documents C++ as
cpp
here https://github.com/rouge-ruby/rouge/blob/master/docs/Languages.md.