Configure Markdown engine #194

Merged
merged 4 commits into from Jan 21, 2013

Conversation

Projects
None yet
4 participants
@MichaelHackett
Contributor

MichaelHackett commented Sep 14, 2012

The README says that the Markdown rendering engine can be selected in the configuration file, but the call to process this config option has been commented out in the current version. Going through the code and the commit that made the change, I cannot see why. So I reinstated it so that I could use Bluecloth/Discount, and it works fine. Except...

I wanted to change the default options that Bluecloth passes to Discount, and I figured that I could use the same mechanism as you used for configuring Maruku (adding a config key with the name of the Markdown engine).

However, Bluecloth expects the hash keys to be symbols, and I didn't see a way to generate those with the current JSON parser. But... I did find an suggestion for converting hash keys from strings to symbols, which seemed like a good way to go --- I can't think of a case where that wouldn't be as good or preferable. I updated the Maruku config code to use symbols instead, but I haven't got Maruku installed so I haven't tested that it still works.

MichaelHackett added some commits Sep 13, 2012

Restored disabled markup-engine configuration (ref: 616bf52).
It's not clear to me why this line was commented out, as the commit message says only "whitespace", referring to the removal of extraneous white space from another part of the file. Was it an accident? (e.g., commented out for testing and checked in unintentionally)
Added support for passing options hash from showoff config file to re…
…ndering engine via Tilt.

Previously, some options were handled manually for the Maruku engine, but not for any of the others. The markdown engine wrappers in Tilt allow the passing of options to the various libraries through a hash given with the renderer is instantiated. The special handling in Showoff for the Maruku engine have been left unchanged for now, but it might be possible to migrate the code to use the same mechanism in the future. (I haven't used Maruku yet myself, so I didn't want to mess with the config code.)
For the markup engine config settings, hash keys are converted from s…
…trings to symbols.

The Tilt markup engine wrappers expect hash keys that are symbols, and there is no way to specify hashes in that format in JSON. But there's no reason the existing Maruku engine settings code couldn't be tweaked to expect symbol keys and work the same way.
Fixes exception when no renderer options specified.
(Oops! Forgot to test with example presentation.)

matthewmccullough added a commit that referenced this pull request Jan 21, 2013

@matthewmccullough matthewmccullough merged commit 1eae579 into schacon:master Jan 21, 2013

@binford2k

This comment has been minimized.

Show comment
Hide comment
@binford2k

binford2k Dec 27, 2013

Where did the default_options go?

Where did the default_options go?

This comment has been minimized.

Show comment
Hide comment
@MichaelHackett

MichaelHackett Dec 30, 2013

Contributor

Very good question! :-) I can't test at the moment, but it looks default_options should be added as the third arg to get_config_option. I guess I must have been using an actual config file, and didn't notice that the defaults were gone.

Contributor

MichaelHackett replied Dec 30, 2013

Very good question! :-) I can't test at the moment, but it looks default_options should be added as the third arg to get_config_option. I guess I must have been using an actual config file, and didn't notice that the defaults were gone.

This comment has been minimized.

Show comment
Hide comment
@binford2k

binford2k Dec 30, 2013

That's what I did when I incorporated your fixes into the Puppet Labs fork. We're now upstream, so you should take a look at our fork when you get a chance. I'd love it if you tested my integration with your existing use case, as well.

That's what I did when I incorporated your fixes into the Puppet Labs fork. We're now upstream, so you should take a look at our fork when you get a chance. I'd love it if you tested my integration with your existing use case, as well.

@b4d26f6fc7fc

This comment has been minimized.

Show comment
Hide comment
@b4d26f6fc7fc

b4d26f6fc7fc Jun 6, 2015

I have the test believe me I do

I have the test believe me I do

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