Support for Redcarpet 2.0 #450

Closed
wants to merge 8 commits into
from

Conversation

Projects
None yet

chitsaou commented Dec 5, 2011

The Redcarpet 2.0.0 has out of beta, and I think it's good to merge it into the trunk.

As I mentioned in #444, the first benefit of Redcarpet 2.0 is that the renderer object can be initialized. There is no need to initialize it each time a Markdown file is going to be converted.

In addition, this patch is compatible with the current config file -- there is no need to change the config file.

Update:

It is also possible to supply renderer options to Redcarpet's HTML renderer. Put the render_options array inside the redcarpet hash. For example, in the _config.yml :

redcarpet:
  extensions:
    # array of ...
  render_options:
    - with_toc_data # add HTML anchors to each header in the output HTML for hyper linking
    - hard_wrap      # translate \n to <br>

chitsaou commented Dec 5, 2011

Oops, I found that the smart extension is deprecated, it is implemented as an module, instead. I'll monkey-patch the extension array.

@chitsaou chitsaou referenced this pull request Dec 5, 2011

Closed

Support Redcarpet 2.0 #444

chitsaou commented Dec 5, 2011

OK, I've put back the SmartyPants.

chitsaou commented Dec 5, 2011

Also added an option to specify render options, which is also a new feature of RedCarpet 2.0. See updated description on the top.

mixonic commented Dec 6, 2011

Tests pass for me on 1.9.2 and ree on OS X.

I might rename @converter @redcarpet_converter, but this looks good to me reading through the diff.

jbrains commented Dec 7, 2011

+1

mtodd commented Jan 2, 2012

:shipit:

Contributor

catsby commented Jan 4, 2012

+1

scottkf commented Jan 12, 2012

What they said

mrcaron commented Feb 6, 2012

Actually, this is probably a better fix than mine as I retain the old functionality, just pull in the new lib.

👍

ryanjm commented Apr 14, 2012

+1

cboettig commented May 1, 2012

+1

Contributor

imathis commented May 21, 2012

+1

Contributor

sankage commented Jun 5, 2012

👍

cboettig commented Jun 5, 2012

Connected to pull request #487. Not sure how the two compare. These requests also connects to issue #200

5long commented Aug 14, 2012

+1

jarib commented Aug 30, 2012

+1

Contributor

mojombo commented Dec 15, 2012

Superseded and closed by #619.

@mojombo mojombo closed this Dec 15, 2012

knuton commented May 11, 2013

Is there official documentation on how to configure RedCarpet?

I found this issue in looking for a way to pass options to RedCarpet, but it now is misleading since all options are passed in the extensions array, including those for the renderer.

That is, the equivalent to the example above would now be:

redcarpet:
  extensions:
    # list of **extensions** could be here
    # below are **renderer options**
    - with_toc_data # add HTML anchors to each header in the output HTML for hyper linking
    - hard_wrap      # translate \n to <br>
Owner

parkr commented May 11, 2013

Nothing detailed. All we have is this: http://jekyllrb.com/docs/configuration/

Yeah, everything has to go into that array at the moment, as the code support is.

knuton commented May 11, 2013

Okay, thanks. I guess these docs are actually informative enough, it was rather bad luck that I stumbled upon this issue first.

Hope my comment keeps others from falling into the same trap.

Owner

parkr commented May 11, 2013

Sorry about that - thank you for your comment! Should clear up some things for others

Contributor

robkorv commented Jun 30, 2013

Been searching all day to get <br /> linebreak with jekyll. At the end of the day I finally stumble on the solution that is written here. This should be in the docs.

markdown: redcarpet
redcarpet:
  extensions:
    - hard_wrap
Owner

parkr commented Jun 30, 2013

@robkorv Great idea! Would you mind submitting a PR? The site is in the site/ directory in the master branch.

Contributor

robkorv commented Jun 30, 2013

Yes, I would and I could.
#1254

@jekyllbot jekyllbot locked and limited conversation to collaborators Feb 27, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.