thanks to some off-list help from Josh French the extension now works as either a gem or traditional vendored extension. the key change was just to add `unloadable` to the KramdownFilter class.
On Tue, Jan 26, 2010 at 10:35 AM, john muhl <[email protected]> wrote: > just noticed that extracting the textile_filter extension out into a > gem also fails in the exact same ways that i've run into... > > On Tue, Jan 26, 2010 at 9:13 AM, john muhl <[email protected]> wrote: >> On Tue, Jan 26, 2010 at 8:32 AM, Josh French <[email protected]> wrote: >>>> i'm at loss now for why it's not appearing in the drop down when >>>> loaded as a gem. no errors or anything unusual just a missing filter. >>> >>> I'm actually at a loss as to why it would appear when vendored if >>> you're not explicitly loading that subclass. Radiant doesn't do any >>> pre-loading of filter subclasses in the way that it automatically >>> seeks out and loads Page subclasses. If you look at the textile and >>> markdown extensions that ship within core, you'll see that both of >>> them explicitly load the filter subclass within their #activate >>> methods. It'll be safer to follow their example. > >> or are you talking about this not being explicit enough? >> >> --- >> class KramdownFilter < TextFilter >> description_file File.dirname(__FILE__) + "/../markdown.html" >> def filter(text) >> Kramdown::Document.new(RubyPants.new(text).to_html).to_html >> end >> end >> --- >> >> textile_filter >> --- >> class TextileFilter < TextFilter >> description_file File.dirname(__FILE__) + "/../textile.html" >> def filter(text) >> RedCloth.new(text).to_html >> end >> end >> --- >> >> markdown_filter >> --- >> class MarkdownFilter < TextFilter >> description_file File.dirname(__FILE__) + "/../markdown.html" >> def filter(text) >> if defined? RDiscount >> RDiscount.new(text, :smart).to_html >> else >> RubyPants.new(BlueCloth.new(text).to_html).to_html >> end >> end >> end >> --- >> >> again looks the same to me. >> > _______________________________________________ Radiant mailing list Post: [email protected] Search: http://radiantcms.org/mailing-list/search/ List Site: http://lists.radiantcms.org/mailman/listinfo/radiant Radiant: http://radiantcms.org Extensions: http://ext.radiantcms.org
