Skip to content

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

@Splendorr

Description

@Splendorr

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! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions