diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index 5f7114de..723bed3b 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -128,11 +128,20 @@ def mixin_signature(mixin) mixin.sass_signature(:include) end -def mixin_examples(item, mixin) - @items.select do |i| - i[:example] && +def example_items + @example_items ||= @items.select{|i| i[:example]} +end + +def examples_for_item(item) + @examples ||= {} + @examples[item] ||= example_items.select do |i| i[:framework] == item[:framework] && - i[:stylesheet] == item[:stylesheet] && + i[:stylesheet] == item[:stylesheet] + end +end + +def mixin_examples(item, mixin) + examples_for_item(item).select do |i| i[:mixin] == mixin.name end.map{|i| i.reps.find{|r| r.name == :default}} end