Link to index pages from the search page, link ruby functions to their appropriate compass docs, where they exist.
This commit is contained in:
parent
df756b194c
commit
2e2b384327
@ -16,4 +16,9 @@ body_id: home
|
|||||||
%h1#logo All Ruby Based Functions
|
%h1#logo All Ruby Based Functions
|
||||||
%ul
|
%ul
|
||||||
- Sass::Script::Functions.public_instance_methods.sort_by{|m| m.to_s}.each do |m|
|
- Sass::Script::Functions.public_instance_methods.sort_by{|m| m.to_s}.each do |m|
|
||||||
%li= m.to_s.gsub("_","-")
|
%li
|
||||||
|
- name = m.to_s.gsub("_","-")
|
||||||
|
- if i = item_for_function_name(name)
|
||||||
|
%a{:href=>"#{i.path}##{name}"}= name
|
||||||
|
- else
|
||||||
|
= name
|
@ -8,6 +8,8 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "color-stops"
|
||||||
---
|
---
|
||||||
%h1 Compass Color Stops Helper
|
%h1 Compass Color Stops Helper
|
||||||
|
|
||||||
|
@ -8,6 +8,11 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "adjust-lightness"
|
||||||
|
- "adjust-saturation"
|
||||||
|
- "scale-lightness"
|
||||||
|
- "scale-saturation"
|
||||||
---
|
---
|
||||||
%h1 Compass Color Helpers
|
%h1 Compass Color Helpers
|
||||||
%p
|
%p
|
||||||
|
@ -8,6 +8,8 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "opposite-position"
|
||||||
---
|
---
|
||||||
%h1 Compass Constant Helpers
|
%h1 Compass Constant Helpers
|
||||||
|
|
||||||
|
@ -8,6 +8,16 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "prefixed"
|
||||||
|
- "prefix"
|
||||||
|
- "-webkit"
|
||||||
|
- "-moz"
|
||||||
|
- "-o"
|
||||||
|
- "-ms"
|
||||||
|
- "-svg"
|
||||||
|
- "-pie"
|
||||||
|
- "-css2"
|
||||||
---
|
---
|
||||||
%h1 Compass Cross Browser Helpers
|
%h1 Compass Cross Browser Helpers
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "elements-of-type"
|
||||||
---
|
---
|
||||||
%h1 Compass Display Helpers
|
%h1 Compass Display Helpers
|
||||||
|
|
||||||
|
@ -8,6 +8,8 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "font-files"
|
||||||
---
|
---
|
||||||
%h1 Compass Font Files Helper
|
%h1 Compass Font Files Helper
|
||||||
|
|
||||||
|
@ -8,6 +8,9 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "image-width"
|
||||||
|
- "image-height"
|
||||||
---
|
---
|
||||||
%h1 Compass Image Dimension Helpers
|
%h1 Compass Image Dimension Helpers
|
||||||
|
|
||||||
|
@ -8,6 +8,9 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "inline-image"
|
||||||
|
- "inline-font-files"
|
||||||
---
|
---
|
||||||
%h1 Compass Inline Data Helpers
|
%h1 Compass Inline Data Helpers
|
||||||
|
|
||||||
|
@ -8,6 +8,12 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "nest"
|
||||||
|
- "append-selector"
|
||||||
|
- "enumerate"
|
||||||
|
- "headings"
|
||||||
|
- "headers"
|
||||||
---
|
---
|
||||||
%h1 Compass Selector Helpers
|
%h1 Compass Selector Helpers
|
||||||
|
|
||||||
@ -67,6 +73,7 @@ classnames:
|
|||||||
%li
|
%li
|
||||||
%a(href="/examples/compass/helpers/using-extend-in-place-of-enumerate/") Example of using <code>@extend</code> in place of enumerate
|
%a(href="/examples/compass/helpers/using-extend-in-place-of-enumerate/") Example of using <code>@extend</code> in place of enumerate
|
||||||
|
|
||||||
|
%a(name="headers")
|
||||||
#headings.helper
|
#headings.helper
|
||||||
%h3
|
%h3
|
||||||
%a(href="#append-selector")
|
%a(href="#append-selector")
|
||||||
|
@ -8,6 +8,13 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "sprite-map"
|
||||||
|
- "sprite"
|
||||||
|
- "sprite-map-name"
|
||||||
|
- "sprite-file"
|
||||||
|
- "sprite-url"
|
||||||
|
- "sprite-position"
|
||||||
---
|
---
|
||||||
%h1 Compass Sprite Helpers
|
%h1 Compass Sprite Helpers
|
||||||
|
|
||||||
|
@ -8,6 +8,11 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "pi"
|
||||||
|
- "sin"
|
||||||
|
- "cos"
|
||||||
|
- "tan"
|
||||||
---
|
---
|
||||||
%h1 Compass Trig Helpers
|
%h1 Compass Trig Helpers
|
||||||
|
|
||||||
|
@ -8,6 +8,10 @@ classnames:
|
|||||||
- reference
|
- reference
|
||||||
- core
|
- core
|
||||||
- helpers
|
- helpers
|
||||||
|
documented_functions:
|
||||||
|
- "stylesheet-url"
|
||||||
|
- "font-url"
|
||||||
|
- "image-url"
|
||||||
---
|
---
|
||||||
%h1 Compass URL Helpers
|
%h1 Compass URL Helpers
|
||||||
|
|
||||||
|
@ -30,5 +30,15 @@ body_id: search
|
|||||||
}
|
}
|
||||||
%input#q{:type => "text", :placeholder=>"Search"}
|
%input#q{:type => "text", :placeholder=>"Search"}
|
||||||
|
|
||||||
|
%h2 Index of all:
|
||||||
|
%ul#indexes
|
||||||
|
%li
|
||||||
|
%a(href="/index/variables/") Variables
|
||||||
|
%li
|
||||||
|
%a(href="/index/mixins/") Mixins
|
||||||
|
%li
|
||||||
|
%a(href="/index/functions/") Functions
|
||||||
|
|
||||||
|
%h2 Results
|
||||||
%ol#results
|
%ol#results
|
||||||
%li.none Please enter a search term.
|
%li.none Please enter a search term.
|
@ -176,12 +176,11 @@ def all_mixins
|
|||||||
end
|
end
|
||||||
|
|
||||||
def all_functions
|
def all_functions
|
||||||
rv = @items.inject([]) do |all_functions, item|
|
@items.inject([]) do |all_functions, item|
|
||||||
next all_functions unless item.identifier =~ %r{/reference}
|
next all_functions unless item.identifier =~ %r{/reference}
|
||||||
next all_functions unless item[:stylesheet]
|
next all_functions unless item[:stylesheet]
|
||||||
all_functions += functions(item).map{|f| [item, f] }
|
all_functions += functions(item).map{|f| [item, f] }
|
||||||
end
|
end
|
||||||
rv
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def example_items
|
def example_items
|
||||||
@ -192,6 +191,12 @@ def example_items
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def item_for_function_name(function_name)
|
||||||
|
@items.detect do |item|
|
||||||
|
(item.identifier =~ %r{helpers}) && item[:documented_functions] && item[:documented_functions].include?(function_name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def examples_for_item(item)
|
def examples_for_item(item)
|
||||||
@site.cached("examples/#{item.identifier}") do
|
@site.cached("examples/#{item.identifier}") do
|
||||||
example_items.select do |i|
|
example_items.select do |i|
|
||||||
|
Loading…
Reference in New Issue
Block a user