Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render Hooks #24

Closed
nybblr opened this issue Oct 24, 2012 · 1 comment
Closed

Render Hooks #24

nybblr opened this issue Oct 24, 2012 · 1 comment
Assignees

Comments

@nybblr
Copy link

@nybblr nybblr commented Oct 24, 2012

I've been using Kramdown for some time and love the extended syntax. However, the code blocks seem to be handled by CodeRay by default, but I heavily prefer the better supported Pygments.rb library (previously Albino) since it has much better syntax support (and CodeRay is on its way to abandonment I believe).

Is there already a good API hook/class to inherit from (similar to RedCarpet's renderer base class) so that I can use Pygments to render my code block whenever one is processed? I could hack around in a fork to use Pygments instead, but it would be nicer if this could be done with a simple render class or method overwrite.

Have a blessed day!
~ Jonathan Martin

@gettalong
Copy link
Owner

@gettalong gettalong commented Oct 25, 2012

On 2012-10-24 12:39 -0700 nybblr wrote:

I've been using Kramdown for some time and love the extended syntax.
However, the code blocks seem to be handled by CodeRay by default,
but I heavily prefer the better supported Pygments.rb library
(previously Albino) since it has much better syntax support (and
CodeRay is on its way to abandonment I believe).

Is there already a good API hook/class to inherit from (similar to
RedCarpet's renderer base class) so that I can use Pygments to render
my code block whenever one is processed? I could hack around in a
fork to use Pygments instead, but it would be nicer if this could be
done with a simple render class or method overwrite.

Derive a class from Kramdown::Converter::Html and override the
necessary methods (convert_codeblock and convert_codespan).

Best regards,
Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.