Skip to content
This repository has been archived by the owner on Nov 9, 2021. It is now read-only.

added ability to configure the Markdown parser #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lordelph
Copy link

I really like Phrozn, but wanted to make it easier to use Google Prettify within Markdown. It's possible to configure the Markdown parser to include the required 'prettyprint' class on the <pre> tag, but there was no way to do that within Phrozn.

This pull request corrects that. It's a fairly simple change only to the Markdown processor to look for likely configuration settings in both the front matter and the sitewide config.yml. While this opens up all the configurable parts of Markdown Extra, my original goal of making code blocks play with Google Prettify is achieved by adding this to config.yml

markdown:
    code_class_prefix: "prettyprint lang-"
    code_attr_on_pre: true

Using this I can format code in Markdown with fenced code blocks which also hint at the syntax to be used

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ js
 {
    "foo": "sample JSON",
    "bar": "http://www.example.com"
 }
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Markdown will render that with <pre class="prettyprint lang-js"><code>...</code></pre> and the Google Prettify script will play nicely with it.

@lordelph
Copy link
Author

I note the Travis build failed, yet the unit tests all passed on my machine. The failed test was PhroznTest\Outputter\DefaultOutputterTest::testStdOut. The PlainOutputFormatter test passes, and the only difference between the default formatter and the plain one is that the default formatter tries to do some console color coding to the output

$msg = Color::convert($status . $msg . "\n");

As the test fails because the output $msg is empty, could there be something about the Travis environment which makes this fail?

@lenada
Copy link

lenada commented Oct 20, 2014

@lordelph I ran into the same test failing for my PR #112. I can reproduce the failing test locally. Outputbuffer magic :neckbeard: Hints on how to solve this are appreciated

@lenada
Copy link

lenada commented Oct 21, 2014

@lordelph @Pawka I managed to solve the failing builds by installing phpunit 4.2.2 with composer.
see #112

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants