如何在Octopress中添加class="CodeRay"

问题描述 投票:0回答:1

我在 Octopress 中使用 kramdown 一段时间了。我想将 CodeRay 添加到我的 Octopress 中。我安装了coderay。

➜  octopress git:(source) ✗ sudo gem install coderay
Password:
Successfully installed coderay-1.0.9
1 gem installed
Installing ri documentation for coderay-1.0.9...
Installing RDoc documentation for coderay-1.0.9...

我更改了_config.yml

markdown: kramdown
kramdown:
  use_coderay: true
  coderay:
    coderay_line_numbers: table
    coderay_css: class

我添加了 sass/custom/_coderay-github.scss,我可以在我的 CSS 中看到它们。

我使用了以下内容,但没有一个在我的 html 中添加标签,以便它不会渲染 CodeRay css。

~~~
def hello
  puts "hello world"
end
~~~
{:lang="ruby"}

缩进:

    puts "hello world"
{:lang="ruby"}

如何将 CodeRay 添加到我的 Octopress?

我正在关注这个帖子

jekyll octopress coderay kramdown
1个回答
0
投票

好的,我在此页面找到了答案。

~~~
def what?
  42
end
~~~
{:.language-ruby}

或者

~~~ ruby
def what?
  42
end
~~~
© www.soinside.com 2019 - 2024. All rights reserved.