README.md in vitrine-0.0.13 vs README.md in vitrine-0.0.14
- old
+ new
@@ -21,40 +21,32 @@
## Automatic compilation
Vitrine is for **development**. It takes runtime compilation to 11 and beyound. Running tasks
is all fine and good when you build out the app for production, but when iterating on UI it's essential
-to be able to just yank the file 3in there and carry on.
+to be able to just yank the file in there and carry on. THe compilation perks include:
-### For SCSS/SASS
+* Any `.scss` file you shove into the `public` directory can be referenced as `.css` from your HTML.
+ Ask for `foo.css` and `foo.scss` will be compiled on the fly.
+* Any `.coffee` file you shove into the `public` directory can be references as `.js` from your HTML.
+ Ask for `bar.js` and `bar.coffee` will be compiled on the fly.
+* CoffeeScript files will have source-maps out of the box for pleasant browser debugging.
+* Decent error messages will be shown for both invalid SCSS and invalid CoffeeScript.
-Any .scss file you shove into the "public" directory can be referenced as ".css" from your HTML code.
-Vitrine will automatically compile it via SASS.
+## Asset caching
-### For CoffeeScript, with source maps
-
-Same thing applies to CoffeeScript - put `.coffee` files in "public", and reference them as `.js` files.
-Vitrine will generate you source maps on the fly for pleasant browser debugging.
-
-## Sensible error messages when automatic compilation fails
-
-Vitrine will try to show you sensible errors if your SCSS or CoffeeScript fail to compile due to syntax errors and
-the like. CoffeeScript errors go to the browser console, and Sass errors go in a generated element on top of your page.
-
-## Do not recompile on every request
-
Succesfully compiled assets will be cached to save time on next reload, and ETagged based on their
mtime.
## Automatic Ruby template pickup
If you have the "views" directory available, Vitrine will try to pick up any usable file for any URL without extensions.
From there on, it's going to try to render it with the automatically picked template engine using the
standard Sinatra facilities. You can use HAML, LESS, Slim, ERB, Builder or anything else you like.
-If you are writing an SPA, you can make a file called "catch_all.erb" which is going to be the fall-through template
-for all missing URLs without extension.
+If you are writing an SPA, you can make a file called "catch_all.erb" which is going to be
+the fall-through template for all missing URLs without extension.
## Automatic reload via Guard
If your project already has a Guardfile, Vitrine will inject live-reloading hooks into your HTML using
[rack-livereload](https://github.com/johnbintz/rack-livereload), so you won't need browser extensions at all.
@@ -75,9 +67,18 @@
Most actions in Vitrine will fall through to 404, so `Vitrine::App` can be used as a middleware handler.
Put Vitrine into your application stack and it will complement your main application very nicely. But don't
forget to set `:root` - like so:
use Vitrine::App.new do | vitrine |
+ vitrine.settings.set :root => File.dirname(__FILE__)
+ end
+
+You can also only opt-in to the asset compilation system of Vitrine only once you have migrated your app from
+the prototype stage into, say, a Sinatra application.
+
+Note that you _need_ to have an `ExecJS` environment on your server for this:
+
+ use Vitrine::AssetCompiler.new do | ac |
vitrine.settings.set :root => File.dirname(__FILE__)
end
## Contributing to vitrine