title: how to write a table of contents with jekyll and redcarpet
body: <p>using jekyll 2.0.3,
  I initially configured _config.yml with</p>
  
  <pre><code>markdown: kramdown
  </code></pre>
  
  <p>and I was able to add a table of contents as follows, in my example.md:</p>
  
  <pre><code>---
  layout: page
  title: Sample
  ---
  {:toc}
  
  ## section 1
  ## section 2
  </code></pre>
  
  <p>however, I switched to redcarpet, see _config.yml:</p>
  
  <pre><code>markdown: redcarpet
  redcarpet:
    extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "strikethrough", "superscript", "with_toc_data"]
  </code></pre>
  
  <p>and now <code>{:toc:}</code> does not work.</p>
  
  <p>The documentation of redcarpet v2.2.2 (used by jekyll 2.0.3):
  <a href="https://github.com/vmg/redcarpet/blob/v2.2.2/README.markdown#and-its-like-really-simple-to-use" rel="nofollow">https://github.com/vmg/redcarpet/blob/v2.2.2/README.markdown#and-its-like-really-simple-to-use</a></p>
  
  <p>mentions <code>:with_toc_data</code>, but I don't where/how to use this.</p>
  
  <p>how can i display the table of contents using redcarpet?</p>