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

How do I add a new url renderer, like .raw and .pre? #8

Open
Splendorr opened this issue May 11, 2015 · 0 comments
Open

How do I add a new url renderer, like .raw and .pre? #8

Splendorr opened this issue May 11, 2015 · 0 comments

Comments

@Splendorr
Copy link

I've looked through the code, but don't know whether this is possible or where it would be.

In my repo here:
https://github.com/Splendorr/awngoing-1.17.13
Live here:
http://www.awngo.in

I write a lot of things in a semi-poetic style, with a bunch of line breaks. I re-worked your provisional RedCarpet renderer from Interblah.net to get it to work in my site. I love the :hard_wrap option for writing in Markdown but keeping these line breaks.

However, I've also created an alternate renderer that does not preserve line breaks, which I know is easier for some people to read. So I have 2 renderers added in application.rb, both of which work when set as :render_as: options in a given snip:

config.renderers[:redcarpet] = Vanilla::Renderers::Redcarpet
config.renderers[:idontreadpoetry] = Vanilla::Renderers::RedcarpetNoPo

Here's what I'd like. I want to default most of my snips to the regular, line-break-keeping :redcarpet: renderer. I want to either provide a link that changes the current snip's renderer to :idontreadpoetry:, or just tell people they can add .idontreadpoetry to the end of the URL to make things look like paragraphs.

I don't see a "link_to" dynasnip that can take a renderer parameter at the moment, and just adding one of my custom renderers to the URL produces an error.

Is there a way to do one of these? Thanks, I'm having a good time! :)

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

No branches or pull requests

1 participant