Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Table not render when use Redcarpet in Jekyll GitHub Pages?

As of maruku engine (the default), writing table like

surround text, etc.

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |

surround text...

would render correctly.

But when I switch to redcarpet (add markdown: redcarpet into _config.yml), the table no longer rendered, both localhost and on GitHub Pages.

Did I do something wrong?

like image 873
neizod Avatar asked Apr 19 '13 07:04

neizod


3 Answers

Adding only markdown: redcarpet into _config.yml is not enough, It's also need the extensions part, e.g.

markdown: redcarpet
redcarpet:
  extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]
like image 179
neizod Avatar answered Oct 21 '22 11:10

neizod


For this question, it seems the important extension here is "tables".

However if you want more Github flavored markdown, there are a few more listed at http://sholsinger.com/2014/03/jekyll-github-flavored-markdown.

Combining with neizod's answer I ended up using.

markdown: redcarpet
redcarpet:
  extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "strikethrough", "superscript", "with_toc_data"]
like image 6
Ben Holland Avatar answered Oct 21 '22 10:10

Ben Holland


The redcarpet markdown engine is no longer supported by GitHub Pages and may cease working at any time.

A very straightforward solution is to delete the markdown setting in site's _config.yml file and instead have an extra line between the headline/text and the table.

You can get more information from github help and this solution was taken from this issue.

like image 2
loupipalien Avatar answered Oct 21 '22 12:10

loupipalien