diff --git a/doc-src/content/index/functions.haml b/doc-src/content/index/functions.haml index 423d5000..3db82d99 100644 --- a/doc-src/content/index/functions.haml +++ b/doc-src/content/index/functions.haml @@ -16,4 +16,9 @@ body_id: home %h1#logo All Ruby Based Functions %ul - 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 \ No newline at end of file diff --git a/doc-src/content/reference/compass/helpers/color-stops.haml b/doc-src/content/reference/compass/helpers/color-stops.haml index 01d3d5df..a95f629a 100644 --- a/doc-src/content/reference/compass/helpers/color-stops.haml +++ b/doc-src/content/reference/compass/helpers/color-stops.haml @@ -8,6 +8,8 @@ classnames: - reference - core - helpers +documented_functions: + - "color-stops" --- %h1 Compass Color Stops Helper diff --git a/doc-src/content/reference/compass/helpers/colors.haml b/doc-src/content/reference/compass/helpers/colors.haml index 0e99a04d..3c49e423 100644 --- a/doc-src/content/reference/compass/helpers/colors.haml +++ b/doc-src/content/reference/compass/helpers/colors.haml @@ -8,6 +8,11 @@ classnames: - reference - core - helpers +documented_functions: + - "adjust-lightness" + - "adjust-saturation" + - "scale-lightness" + - "scale-saturation" --- %h1 Compass Color Helpers %p diff --git a/doc-src/content/reference/compass/helpers/constants.haml b/doc-src/content/reference/compass/helpers/constants.haml index b619dfe4..e1995322 100644 --- a/doc-src/content/reference/compass/helpers/constants.haml +++ b/doc-src/content/reference/compass/helpers/constants.haml @@ -8,6 +8,8 @@ classnames: - reference - core - helpers +documented_functions: + - "opposite-position" --- %h1 Compass Constant Helpers diff --git a/doc-src/content/reference/compass/helpers/cross-browser.haml b/doc-src/content/reference/compass/helpers/cross-browser.haml index b11f68d9..f8097bd7 100644 --- a/doc-src/content/reference/compass/helpers/cross-browser.haml +++ b/doc-src/content/reference/compass/helpers/cross-browser.haml @@ -8,6 +8,16 @@ classnames: - reference - core - helpers +documented_functions: + - "prefixed" + - "prefix" + - "-webkit" + - "-moz" + - "-o" + - "-ms" + - "-svg" + - "-pie" + - "-css2" --- %h1 Compass Cross Browser Helpers diff --git a/doc-src/content/reference/compass/helpers/display.haml b/doc-src/content/reference/compass/helpers/display.haml index d4f5396f..c0c3924e 100644 --- a/doc-src/content/reference/compass/helpers/display.haml +++ b/doc-src/content/reference/compass/helpers/display.haml @@ -8,6 +8,8 @@ classnames: - reference - core - helpers +documented_functions: + - "elements-of-type" --- %h1 Compass Display Helpers diff --git a/doc-src/content/reference/compass/helpers/font-files.haml b/doc-src/content/reference/compass/helpers/font-files.haml index 170c1bf5..d055c900 100644 --- a/doc-src/content/reference/compass/helpers/font-files.haml +++ b/doc-src/content/reference/compass/helpers/font-files.haml @@ -8,6 +8,8 @@ classnames: - reference - core - helpers +documented_functions: + - "font-files" --- %h1 Compass Font Files Helper diff --git a/doc-src/content/reference/compass/helpers/image-dimensions.haml b/doc-src/content/reference/compass/helpers/image-dimensions.haml index 13533d9f..c1f99cca 100644 --- a/doc-src/content/reference/compass/helpers/image-dimensions.haml +++ b/doc-src/content/reference/compass/helpers/image-dimensions.haml @@ -8,6 +8,9 @@ classnames: - reference - core - helpers +documented_functions: + - "image-width" + - "image-height" --- %h1 Compass Image Dimension Helpers diff --git a/doc-src/content/reference/compass/helpers/inline-data.haml b/doc-src/content/reference/compass/helpers/inline-data.haml index eac0bf10..9c212392 100644 --- a/doc-src/content/reference/compass/helpers/inline-data.haml +++ b/doc-src/content/reference/compass/helpers/inline-data.haml @@ -8,6 +8,9 @@ classnames: - reference - core - helpers +documented_functions: + - "inline-image" + - "inline-font-files" --- %h1 Compass Inline Data Helpers diff --git a/doc-src/content/reference/compass/helpers/selectors.haml b/doc-src/content/reference/compass/helpers/selectors.haml index 472c79d4..ed80584e 100644 --- a/doc-src/content/reference/compass/helpers/selectors.haml +++ b/doc-src/content/reference/compass/helpers/selectors.haml @@ -8,6 +8,12 @@ classnames: - reference - core - helpers +documented_functions: + - "nest" + - "append-selector" + - "enumerate" + - "headings" + - "headers" --- %h1 Compass Selector Helpers @@ -67,6 +73,7 @@ classnames: %li %a(href="/examples/compass/helpers/using-extend-in-place-of-enumerate/") Example of using @extend in place of enumerate +%a(name="headers") #headings.helper %h3 %a(href="#append-selector") diff --git a/doc-src/content/reference/compass/helpers/sprites.haml b/doc-src/content/reference/compass/helpers/sprites.haml index 91f70f2e..3a2eb5d3 100644 --- a/doc-src/content/reference/compass/helpers/sprites.haml +++ b/doc-src/content/reference/compass/helpers/sprites.haml @@ -8,6 +8,13 @@ classnames: - reference - core - helpers +documented_functions: + - "sprite-map" + - "sprite" + - "sprite-map-name" + - "sprite-file" + - "sprite-url" + - "sprite-position" --- %h1 Compass Sprite Helpers diff --git a/doc-src/content/reference/compass/helpers/trig.haml b/doc-src/content/reference/compass/helpers/trig.haml index cf1e5320..2147d2b2 100644 --- a/doc-src/content/reference/compass/helpers/trig.haml +++ b/doc-src/content/reference/compass/helpers/trig.haml @@ -8,6 +8,11 @@ classnames: - reference - core - helpers +documented_functions: + - "pi" + - "sin" + - "cos" + - "tan" --- %h1 Compass Trig Helpers diff --git a/doc-src/content/reference/compass/helpers/urls.haml b/doc-src/content/reference/compass/helpers/urls.haml index 038efe66..da1d7853 100644 --- a/doc-src/content/reference/compass/helpers/urls.haml +++ b/doc-src/content/reference/compass/helpers/urls.haml @@ -8,6 +8,10 @@ classnames: - reference - core - helpers +documented_functions: + - "stylesheet-url" + - "font-url" + - "image-url" --- %h1 Compass URL Helpers diff --git a/doc-src/content/search.haml b/doc-src/content/search.haml index 49580019..fa0c31ff 100644 --- a/doc-src/content/search.haml +++ b/doc-src/content/search.haml @@ -30,5 +30,15 @@ body_id: 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 %li.none Please enter a search term. \ No newline at end of file diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index 24921c1e..6fa56b6b 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -176,12 +176,11 @@ def all_mixins end 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[:stylesheet] all_functions += functions(item).map{|f| [item, f] } end - rv end def example_items @@ -192,6 +191,12 @@ def example_items 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) @site.cached("examples/#{item.identifier}") do example_items.select do |i|