From 4990a793470a1454d1ac06ad888c872e4ec50f9b Mon Sep 17 00:00:00 2001 From: David Verhasselt Date: Thu, 17 Oct 2013 14:26:00 +0300 Subject: Add Sass gobbling info to asset pipeline docs [ci skip] --- guides/source/asset_pipeline.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'guides/source/asset_pipeline.md') diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index 72aff1e0dd..7cb42f18d9 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -503,7 +503,11 @@ NOTE. If you want to use multiple Sass files, you should generally use the [Sass rule](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import) instead of these Sprockets directives. Using Sprockets directives all Sass files exist within their own scope, making variables or mixins only available within the -document they were defined in. +document they were defined in. You can do file globbing as well using +`@import "*"`, and `@import "**/*"` to add the whole tree equivalent to how +`require_tree` works. Check the [sass-rails +documentation](https://github.com/rails/sass-rails#features) for more info and +important caveats. You can have as many manifest files as you need. For example, the `admin.css` and `admin.js` manifest could contain the JS and CSS files that are used for the -- cgit v1.2.3 From eb6defbae90510732038e546dd773bb5433fadec Mon Sep 17 00:00:00 2001 From: David Verhasselt Date: Mon, 21 Oct 2013 20:34:11 +0300 Subject: Update docs on Tilt::Template in Asset Pipeline guide --- guides/source/asset_pipeline.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'guides/source/asset_pipeline.md') diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index 7cb42f18d9..40a6f3ebc7 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -1044,17 +1044,22 @@ Making Your Library or Gem a Pre-Processor As Sprockets uses [Tilt](https://github.com/rtomayko/tilt) as a generic interface to different templating engines, your gem should just implement the Tilt template protocol. Normally, you would subclass `Tilt::Template` and -reimplement `evaluate` method to return final output. Template source is stored -at `@code`. Have a look at +reimplement the `prepare` method, which initializes your template, and the +`evaluate` method, which returns the processed source. The original source is +stored in `data`. Have a look at [`Tilt::Template`](https://github.com/rtomayko/tilt/blob/master/lib/tilt/template.rb) sources to learn more. ```ruby module BangBang class Template < ::Tilt::Template + def prepare + # Do any initialization here + end + # Adds a "!" to original template. def evaluate(scope, locals, &block) - "#{@code}!" + "#{data}!" end end end -- cgit v1.2.3 From eaed8220c2e1c5d4f350a213de93de75ca4b3c69 Mon Sep 17 00:00:00 2001 From: Evgeniy Date: Wed, 23 Oct 2013 20:42:30 +0400 Subject: [ci skip] second parameter of asset-url is depricated --- guides/source/asset_pipeline.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'guides/source/asset_pipeline.md') diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index 40a6f3ebc7..e9d3712a2a 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -405,11 +405,10 @@ JavaScript and stylesheet. * `image-url("rails.png")` becomes `url(/assets/rails.png)` * `image-path("rails.png")` becomes `"/assets/rails.png"`. -The more generic form can also be used but the asset path and class must both be -specified: +The more generic form can also be used: -* `asset-url("rails.png", image)` becomes `url(/assets/rails.png)` -* `asset-path("rails.png", image)` becomes `"/assets/rails.png"` +* `asset-url("rails.png")` becomes `url(/assets/rails.png)` +* `asset-path("rails.png")` becomes `"/assets/rails.png"` #### JavaScript/CoffeeScript and ERB -- cgit v1.2.3 From 2476f9fcd35bdd14afc9b0d75046e376c4716a88 Mon Sep 17 00:00:00 2001 From: Gaurish Sharma Date: Fri, 8 Nov 2013 23:57:07 +0530 Subject: :scissors: fix broken url [ci skip] --- guides/source/asset_pipeline.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'guides/source/asset_pipeline.md') diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index e9d3712a2a..39448e92d5 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -151,8 +151,7 @@ environments. You can enable or disable it in your configuration through the More reading: * [Optimize caching](http://code.google.com/speed/page-speed/docs/caching.html) -* [Revving Filenames: don't use -* querystring](http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/) +* [Revving Filenames: don't use querystring](http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/) How to Use the Asset Pipeline -- cgit v1.2.3