README.md in vitrine-0.0.16 vs README.md in vitrine-0.0.17
- old
+ new
@@ -1,9 +1,11 @@
A nimble web server one-liner for modern web-apps, a bit in the style of
-[lineman](https://github.com/testdouble/lineman), [serve](https://github.com/visionmedia/serve),
-another [serve](https://github.com/jlong/serve) and such. Will display your precious stuff on port 9292.
+[lineman](https://github.com/testdouble/lineman), [middleman](https://github.com/middleman/middleman), [serve](https://github.com/visionmedia/serve), another [serve](https://github.com/jlong/serve)
+and such. Will display your precious stuff on port 9292.
+It does some of what those other projects - only the stuff I need, with less.
+
## Core idea of Vitrine
You want a server that will automatically wrap your CoffeeScript and SASS assets, and allow
some rudimentary templating. This is practically enough for putting together MVP prototypes,
especially as far as single-page apps go. You want this server to not coerce you into a specific
@@ -32,40 +34,35 @@
* 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.
## Asset caching
-Succesfully compiled assets will be cached to save time on next reload, and ETagged based on their
-mtime.
+Succesfully compiled assets will be ETagged based on their mtime. You should run an HTTP caching
+proxy on top of a Vitrine app in production.
## 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.
+### The "catch-all" template for single-page apps
+
+If you are writing an SPA, you can make a template called `catch_all.erb` (or `.haml` or whatever really)
+in your `views` 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.
## Sensible caching
Vitrine will `etag` all the precompiled assets for faster reloading.
-## Packaging and baking
+## Using the whole Vitrine as Rack middleware
-At this point the best way to bake a Vitrine site is to crawl it externally, but we are going to implement
-baking at some point. The idea is that you will end up upgrading the site to either a Node app or a Ruby app
-with it's own `config.ru` - if after that point you still wish to use Vitrine, you can use it like a Rack
-middleware.
-
-## Using as a middleware
-
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 |
@@ -78,9 +75,21 @@
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
+
+But you can also choose to have your JSON-serving API backend at the end of the Rack stack, and `Vitrine`
+on top of it for assets and templating - the choice is entirelly up to you.
+
+## Packaging and baking of assets
+
+This is on the TODO list, primarilly because it's notoriously difficult to splice assets for minification
+preserving their source maps.
+
+The idea is that you will end up upgrading the site to either a Node app or a Ruby app
+with it's own `config.ru` - if after that point you still wish to use Vitrine, you can use it like a Rack
+middleware.
## Contributing to vitrine
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.