redcarpet

How to render table with Redcarpet and Markdown

为君一笑 提交于 2019-12-02 20:34:31
I'm trying to render a table like this with Redcarpet | header 1 | header 2 | | -------- | -------- | | cell 1 | cell 2 | | cell 3 | cell 4 | but it's not working. Is it possible to render a table with Redcarpet ? Yes, you can render a table like that, but you have to enable the :tables option. require 'redcarpet' markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :tables => true) text = <<END | header 1 | header 2 | | -------- | -------- | | cell 1 | cell 2 | | cell 3 | cell 4 | END puts markdown.render(text) Outputs: <table><thead> <tr> <th>header 1</th> <th>header 2</th> </tr> <

Table not render when use Redcarpet in Jekyll GitHub Pages?

£可爱£侵袭症+ 提交于 2019-12-02 15:48:08
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? Adding only markdown: redcarpet into _config.yml is not enough, It's also need the extensions part, e.g. markdown: redcarpet redcarpet: extensions: [

Syntax highlighting in jekyll using redcarpet

那年仲夏 提交于 2019-12-01 22:18:49
问题 I'm trying to get code highlighting to work for a simple blog built with jekyll. I want to be able to do code highlighting within posts written in markdown so I enabled redcarpet as markup language. This works all fine, the code gets formatted in <pre></pre> tags and all the various elements of the code get corresponding classes. e.g. <span class="n">function</span> <span class="n">saySomething</span> <span class="p">()</span> <span class="p">{</span> etc. This is awesome but this doesn't

Syntax highlighting in jekyll using redcarpet

狂风中的少年 提交于 2019-12-01 19:02:15
I'm trying to get code highlighting to work for a simple blog built with jekyll. I want to be able to do code highlighting within posts written in markdown so I enabled redcarpet as markup language. This works all fine, the code gets formatted in <pre></pre> tags and all the various elements of the code get corresponding classes. e.g. <span class="n">function</span> <span class="n">saySomething</span> <span class="p">()</span> <span class="p">{</span> etc. This is awesome but this doesn't give us of the actual highlighting (color) yet. So I suppose there must be some css ready to copy and

Syntax highlighting markdown code blocks in Jekyll (without using liquid tags)

萝らか妹 提交于 2019-11-27 17:23:39
It seems like syntax highlighting in Jekyll is limited to using liquid tags and pygments like so: {% highlight bash %} cd ~ {% endhighlight %} But I've imported my existing blog from wordpress and it was written in markdown (using markdown code blocks) and I don't want to have to go through each post and fix the code blocks. Also, I want to keep my posts in pure markdown format in case I ever need to switch blogging platforms again. I switched my Jekyll parser to redcarpet with the hope that I could use this markdown syntax: ```bash cd ~ ``` But it doesn't seem to work. It just wraps it in a