Jekyll中的受防护代码块

时间:2016-02-03 23:03:40

标签: ruby rubygems jekyll kramdown rouge

我刚刚将当地的Jekyll安装升级为Jekyll 3.0.2。

我期待在发布源代码时使用fenced(反引号)代码块。

然而,这不起作用,我仍然需要使用Liquid标签来指定代码块

我在_config.yml中的构建设置:

baseurl: /
destination: _site
permalink: pretty
markdown: kramdown
kramdown:
  input: GFM
  syntax_highlighter: rouge

安装的Ruby gem列表

activesupport (4.2.5.1)
addressable (2.3.8)
bigdecimal (1.2.6)
bundler (1.11.2)
coffee-script (2.4.1)
coffee-script-source (1.10.0)
colorator (0.1)
ethon (0.8.1)
execjs (2.6.0)
faraday (0.9.2)
ffi (1.9.10 x64-mingw32)
gemoji (2.1.0)
github-pages (45)
github-pages-health-check (0.6.0)
html-pipeline (2.3.0)
i18n (0.7.0)
io-console (0.4.3)
jekyll (3.0.2)
jekyll-coffeescript (1.0.1)
jekyll-feed (0.3.1)
jekyll-gist (1.4.0)
jekyll-mentions (1.0.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.9.1)
jekyll-sass-converter (1.3.0)
jekyll-seo-tag (0.1.4)
jekyll-sitemap (0.10.0)
jekyll-textile-converter (0.1.0)
jekyll-watch (1.3.1)
jemoji (0.5.1)
json (1.8.3, 1.8.1)
kramdown (1.9.0)
liquid (3.0.6)
listen (3.0.5)
mercenary (0.3.5)
mini_portile2 (2.0.0)
minitest (5.8.4, 5.4.3)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.6.7.2 x64-mingw32)
octokit (4.2.0)
power_assert (0.2.2)
psych (2.0.8)
public_suffix (1.5.3)
rake (10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.5)
rdiscount (2.1.8)
rdoc (4.2.0)
redcarpet (3.3.3)
RedCloth (4.2.9)
rouge (1.10.1)
safe_yaml (1.0.4)
sass (3.4.21)
sawyer (0.6.0)
terminal-table (1.5.2)
test-unit (3.0.8)
thread_safe (0.3.5)
typhoeus (0.8.0)
tzinfo (1.2.2)

1 个答案:

答案 0 :(得分:2)

此配置适用于我。

<强> _config.yml

markdown: kramdown
kramdown: 
  input: GFM
  syntax_highlighter: rouge

<强> test.md

#### Writing a simple C Program

```c

#include <stdio.h>
int main(){
 printf("Hello Drone\n");
 return 0;
}
```

Compile and run the program on native system to test the code.