From 45785b75612711996b3062bfe11cc1727fb2ef7f Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 3 May 2010 21:03:17 -0700 Subject: [PATCH] [Docs] Document the enumerate helper. --- .../examples/compass/helpers/enumerate.haml | 7 +++++ .../compass/helpers/enumerate/markup.haml | 6 ++++ .../compass/helpers/enumerate/stylesheet.sass | 8 +++++ .../using-extend-in-place-of-enumerate.haml | 7 +++++ .../markup.haml | 6 ++++ .../stylesheet.sass | 9 ++++++ .../content/reference/compass/helpers.haml | 5 ++++ .../reference/compass/helpers/display.haml | 2 +- .../reference/compass/helpers/enumerate.haml | 30 +++++++++++++++++++ 9 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 doc-src/content/examples/compass/helpers/enumerate.haml create mode 100644 doc-src/content/examples/compass/helpers/enumerate/markup.haml create mode 100644 doc-src/content/examples/compass/helpers/enumerate/stylesheet.sass create mode 100644 doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate.haml create mode 100644 doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate/markup.haml create mode 100644 doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate/stylesheet.sass create mode 100644 doc-src/content/reference/compass/helpers/enumerate.haml diff --git a/doc-src/content/examples/compass/helpers/enumerate.haml b/doc-src/content/examples/compass/helpers/enumerate.haml new file mode 100644 index 00000000..4cd01eca --- /dev/null +++ b/doc-src/content/examples/compass/helpers/enumerate.haml @@ -0,0 +1,7 @@ +--- +title: "Compass Helper: enumerate" +description: How to use the enumerate() helper function. +framework: compass +example: true +--- += render "partials/example" diff --git a/doc-src/content/examples/compass/helpers/enumerate/markup.haml b/doc-src/content/examples/compass/helpers/enumerate/markup.haml new file mode 100644 index 00000000..2566776e --- /dev/null +++ b/doc-src/content/examples/compass/helpers/enumerate/markup.haml @@ -0,0 +1,6 @@ +.example + .class-1 .class-1 + .class-2 .class-2 + .class-3 .class-3 + .class-4 .class-4 + .class-5 .class-5 \ No newline at end of file diff --git a/doc-src/content/examples/compass/helpers/enumerate/stylesheet.sass b/doc-src/content/examples/compass/helpers/enumerate/stylesheet.sass new file mode 100644 index 00000000..196910b5 --- /dev/null +++ b/doc-src/content/examples/compass/helpers/enumerate/stylesheet.sass @@ -0,0 +1,8 @@ +.example + #{enumerate(".class", 2, 4)} + background-color: #aaa + border: 2px solid #777 + margin: 1em + @for $i from 2 through 4 + .class-#{$i} + margin-left: 1em * ($i - 1) \ No newline at end of file diff --git a/doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate.haml b/doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate.haml new file mode 100644 index 00000000..0f4f8e64 --- /dev/null +++ b/doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate.haml @@ -0,0 +1,7 @@ +--- +title: "Using @extend in place of the enumerate() helper." +description: Using @extend in place of the enumerate() helper. +framework: compass +example: true +--- += render "partials/example" diff --git a/doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate/markup.haml b/doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate/markup.haml new file mode 100644 index 00000000..34ab65c4 --- /dev/null +++ b/doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate/markup.haml @@ -0,0 +1,6 @@ +.example + .class-1 .class-1 + .class-2 .class-2 + .class-3 .class-3 + .class-4 .class-4 + .class-5 .class-5 diff --git a/doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate/stylesheet.sass b/doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate/stylesheet.sass new file mode 100644 index 00000000..e795ccc3 --- /dev/null +++ b/doc-src/content/examples/compass/helpers/using-extend-in-place-of-enumerate/stylesheet.sass @@ -0,0 +1,9 @@ +.example + .base-class + background-color: #aaa + border: 2px solid #777 + margin: 1em + @for $i from 2 through 4 + .class-#{$i} + @extend .base-class + margin-left: 1em * ($i - 1) diff --git a/doc-src/content/reference/compass/helpers.haml b/doc-src/content/reference/compass/helpers.haml index 87bef527..6087712e 100644 --- a/doc-src/content/reference/compass/helpers.haml +++ b/doc-src/content/reference/compass/helpers.haml @@ -14,3 +14,8 @@ layout: core :markdown The compass helpers are functions that augment the [functions provided by Sass](http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html). + + All Helpers: + + * [elements-of-type](/docs/reference/compass/helpers/display/) + * [enumerate](/docs/reference/compass/helpers/enumerate/) diff --git a/doc-src/content/reference/compass/helpers/display.haml b/doc-src/content/reference/compass/helpers/display.haml index 0ca3c202..d242e8d0 100644 --- a/doc-src/content/reference/compass/helpers/display.haml +++ b/doc-src/content/reference/compass/helpers/display.haml @@ -22,7 +22,7 @@ classnames: the elements listed to the right. %dl %dg.head - %dt Default Display + %dt Display Value %dd Elements Returned - display_map = Compass::SassExtensions::Functions::Display::DEFAULT_DISPLAY - display_map.keys.each do |key| diff --git a/doc-src/content/reference/compass/helpers/enumerate.haml b/doc-src/content/reference/compass/helpers/enumerate.haml new file mode 100644 index 00000000..0612d83e --- /dev/null +++ b/doc-src/content/reference/compass/helpers/enumerate.haml @@ -0,0 +1,30 @@ +--- +title: Compass Enumeration Helpers +crumb: Enumerate +framework: compass +meta_description: Helper functions for enumerating. +layout: core +classnames: + - reference + - core + - helpers +--- +%h1 Compass Enumerate Helper + +#enumerate.helper + %h3 + %a(href="#enumerate") + enumerate($prefix, $from, $through, $separator) + .details + %p + Enumerate the given $prefix from $from through $through. + %p Note: Using the @extend directive is usually preferred to this helper, which was created before @extend existed. + .examples + %h4 Examples + %ul + %li + %a(href="/docs/examples/compass/helpers/enumerate/") Example of enumerate + %li + %a(href="/docs/examples/compass/helpers/using-extend-in-place-of-enumerate/") Example of using @extend in place of enumerate + +