【问题标题】:Octopress kramdown generate error for tags with ':'Octopress kramdown 为带有“:”的标签生成错误
【发布时间】:2013-06-06 16:44:55
【问题描述】:

我想在其中使用带有“:”的 kramdown 标签,即。 {:toc}

和coderay代码块

{:lang="javascript"}

在我的 Octopress 博客中,但我在运行时不断收到此错误

rake generate:

    [my user dir]/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/psych.rb:203:in 
    `parse': (<unknown>): could not find expected ':' 
    while scanning a simple key at line 8 column 1 (Psych::SyntaxError)

我已经安装了 kramdown 和 coderay gem,并对我的 _config.yml 进行了以下更改:

     markdown: kramdown
     kramdown:
         auto_ids: true
         use_coderay: true`
           coderay:
             coderay_line_numbers: nil
             coderay_css: class`

我的博文目录代码如下所示:

    ---
    layout: page
    title: "resources"
    date: 2013-06-06 10:45
    comments: true
    sharing: true
    footer: true
    categories: [3D UI, css, CSS3D, HTML5, javaScript, three.js, 
    smart tv, grunt, jQuery, node.js, bootstrap, css,
    responsive design, api, learning, backbone.js, knockout.js]
    ---
    #Resources
    {:toc}
    ## **Performance and Caching**
     * [Varnish](https://www.varnish-cache.org/)
    {:toc}
    ## **SmartTV**
     * [Samsung Development Guide](http://www.samsungdforum.com/Guide/)
     * [Basic SmartTV Node App Server](https://github.com/rposbo/basic-smart-tv-app-server)
    {:toc} [ .. snip .. ]

代码块代码如下所示:

    `renderer = new THREE.CSS3DRenderer();
    renderer.setSize(window.innerWidth, window.innerHeight);
    renderer.domElement.style.position = 'absolute';

    document.getElementById('video_container').appendChild(renderer.domElement);`
    {:lang="javascript"}

我关注了this post on adding the coderay scss

如果没有 : 标记,网站生成正常。

我错过了什么?

任何帮助将不胜感激!

【问题讨论】:

    标签: markdown jekyll octopress coderay kramdown


    【解决方案1】:

    我注意到的第一件事是您没有正确使用 {:toc} 标签。它的工作原理是这样的:

    * a random unordered list with only one item
    {:toc}
    
    # header 1
    
    # header 2
    

    无序列表用标签标记,并被标题标签生成的列表替换。见:http://kramdown.rubyforge.org/converter/html.html#toc

    如果这没有帮助,请尝试创建一个最小的示例并将代码发布到某个地方,最好是在 github 上。 :)

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-26
    • 1970-01-01
    • 2015-07-03
    • 1970-01-01
    • 2014-10-01
    • 1970-01-01
    • 2023-02-08
    相关资源
    最近更新 更多