diff --git a/doc-src/content/index/mixins.haml b/doc-src/content/index/mixins.haml new file mode 100644 index 00000000..3980026e --- /dev/null +++ b/doc-src/content/index/mixins.haml @@ -0,0 +1,14 @@ +--- +title: Compass Documentation | All Mixins +crumb: Docs +body_id: home +--- +%article + %h1#logo Compass Mixins + + - all_mixins.sort_by{|i| i.first.identifier}.each do |item, mixins| + %h3= link_to item[:title], item + %ul + - mixins.sort_by{|m| m.name}.each do |m| + %li= mixin_signature(m) + diff --git a/doc-src/content/index/variables.haml b/doc-src/content/index/variables.haml new file mode 100644 index 00000000..dcb78594 --- /dev/null +++ b/doc-src/content/index/variables.haml @@ -0,0 +1,15 @@ +--- +title: Compass Documentation | All Variables +crumb: Docs +body_id: home +--- +%article + %h1#logo Compass Variables + + - all_constants.sort_by{|i| i.first.identifier}.each do |item, constants| + %h3= link_to item[:title], item + %ul + - constants.sort_by{|c| c.name}.each do |c| + %li $#{c.name} + + \ No newline at end of file diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index b92e48d6..69348aa6 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -139,6 +139,32 @@ def constants(item) constants end +def all_constants + variables = [] + @items.each do |item| + next unless item.identifier =~ %r{/reference} + next unless item[:stylesheet] + vars = constants(item) + if vars.any? + variables << [item, vars] + end + end + variables +end + +def all_mixins + all_mixins = [] + @items.each do |item| + next unless item.identifier =~ %r{/reference} + next unless item[:stylesheet] + ms = mixins(item) + if ms.any? + all_mixins << [item, ms] + end + end + all_mixins +end + def mixin_signature(mixin, format = :html) mixin.sass_signature(:none, format) end