diff --git a/doc-src/content/help/tutorials/extending.markdown b/doc-src/content/help/tutorials/extending.markdown new file mode 100644 index 00000000..4bc17e9b --- /dev/null +++ b/doc-src/content/help/tutorials/extending.markdown @@ -0,0 +1,49 @@ +--- +title: Extending Compass +layout: tutorial +crumb: Extending Compass +classnames: + - tutorial +--- + +# Extending Compass + +## Sprite engine + +The sprite engine is the work horse of sprite generation it's the interface for assembling and writing the image file to disk. + +## Requirments + +A sprite engine requires only one method and that is `construct_sprite` which must return an object that responds to `save(filepath)` + +Once inside this method you have access to `images` which is a collection of [Compass::SassExtensions::Sprites::Image](http://rdoc.info/github/chriseppstein/compass/dda7c9/Compass/SassExtensions/Sprites/Image) + +Since the Engine module extends base you also have access to all methods in [Compass::SassExtensions::Sprites::Base](http://rdoc.info/github/chriseppstein/compass/dda7c9/Compass/SassExtensions/Sprites/Base) + +### Configuration + +To enable your sprite engine from the config file set + + sprite_engine = : + +The example below will load `Compass::SassExtension::Sprites::ChunkyPngEngine` + + sprite_engine = :chunky_png + + +### Class Definition + + module Compass + module SassExtensions + module Sprites + module Engine + + # Returns an object + def construct_sprite + #must return a image object that responds to save(filename) + end + + end + end + end + end