Inline TOC token support for RDiscount #333

Closed
wants to merge 11 commits into
from

Projects

None yet

2 participants

@mkaito
Contributor
mkaito commented May 15, 2011

Since RDiscount's toc generation requires the call to a separate method on the RDiscount object, I've implemented inline token replacement. You can define the token in the config file.

If you have @config['rdiscount']['toc_token'] = "[TOC]", then [TOC] in the document will be replaced with the generated table of contents. If the toc generation extension is not enabled, it will be replaced with a linebreak, which should be safe.

@mojombo
Contributor
mojombo commented May 30, 2011

Awesome! Do you think you could write a few tests for this to make sure it's working as intended?

@mkaito
Contributor
mkaito commented May 31, 2011

Apparenetly, bundler can't find posix-spawn, which is required by the bundle. I guess I could manually install the other dependencies to run the tests, but I'd rather keep my gem space clean.

Any idea what's wrong with posix-spawn? gem list --remote shows it correctly.

@mojombo
Contributor
mojombo commented Jun 1, 2011

What's the specific error? Can you paste in the bundler output? What versions of Ruby and Bundler are you using?

@mkaito
Contributor
mkaito commented Jun 2, 2011

ruby -v

ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]

gem list bundler

*** LOCAL GEMS ***

bundler (1.1.pre.4)

cd ~/dev/jekyll && bundle install

Fetching source index for http://rubygems.org/
Could not find posix-spawn-0.3.6 in any of the sources

@mkaito
Contributor
mkaito commented Aug 8, 2011

posix-spawn eventually installed, but now RedCloth is giving me major hell. I guess I'll have to wait a little longer.

@mkaito
Contributor
mkaito commented Nov 1, 2011

Alright, this should do it. There are 3 failing test cases about pygments, but since my local pygments install is a little flaky, I didn't want to fiddle with it.

PS: Nice mustache avatar =)

@mojombo mojombo closed this in 8a0fbf0 Apr 23, 2012
@mojombo
Contributor
mojombo commented Apr 23, 2012

This pull request got messed up somehow, so I've cherry picked the relevant commits and pushed them up. Thanks so much for the patch!

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