문제

I want to use kramdown tags with ':' in them, ie. {:toc}

and coderay code blocks

{:lang="javascript"}

in my Octopress blog but I keep getting this error when running

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)

I have installed the kramdown and coderay gems and made the following changes to my _config.yml:

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

My blogpost toc code looks like this:

    ---
    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 .. ]

the codeblock code looks like this:

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

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

I followed this post on adding the coderay scss

Without the : tags the site generates fine.

What am I missing?

Any help would be appreciated!

도움이 되었습니까?

해결책

The first thing I noticed is that you did not use the {:toc} tags properly. It works like this:

* a random unordered list with only one item
{:toc}

# header 1

# header 2

The unordered list is marked with the tag and gets replaced by list generated from your header tags. See: http://kramdown.rubyforge.org/converter/html.html#toc

If this doesn't help, than please try to create a minimal example and post the code somewhere, preferably at github. :)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top