【问题标题】:Not able to add class="CodeRay" in Octopress无法在 Octopress 中添加 class="CodeRay"
【发布时间】:2013-06-28 13:22:35
【问题描述】:

我在 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 中?

我正在关注这个post

提前谢谢你。

【问题讨论】:

  • 你在 Gemfile 中添加了 kramdown 和 coderay 吗?
  • 是的,我有。我做了捆绑安装。

标签: jekyll octopress coderay kramdown


【解决方案1】:

好的,我在this page找到了答案。

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

或者

~~~ ruby
def what?
  42
end
~~~

【讨论】:

    猜你喜欢
    • 2013-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-18
    • 1970-01-01
    • 2020-06-17
    • 2013-12-09
    • 2020-08-14
    相关资源
    最近更新 更多