README.textile in endymion-ginsu-0.0.0 vs README.textile in endymion-ginsu-0.1.0
- old
+ new
@@ -22,26 +22,32 @@
Copy your static web into your Rails application's new "static" directory. If your static web site has a root index file called "index.html", then your Rails app should have a file called "static/index.html".
Configure Ginsu to slice sections of pages from the static web site into partial templates in your Rails application by adding slicing instructions to your config/initializers/ginsu.rb:
<pre><code># Create a 'header' partial by plucking header HTML from static/index.html using a CSS selector.
-slice :css => 'h3.r a.l', :static => 'index.html', :partial => 'header'
+configure.slices << { :css => 'h3.r a.l', :static => 'index.html', :partial => 'header' }
# Create a 'header' partial by plucking header HTML from static/index.html using an xpath selector.
-slice :xpath => '//h3/a[@class="l"]', :static => 'index.html', :partial => 'header'
+configure.slices << { slice :xpath => '//h3/a[@class="l"]', :static => 'index.html', :partial => 'header' }
# Just use the 'search' parameter to use either CSS or xpath.
-slice :search => 'h3.r a.l', :static => 'index.html', :partial => 'header'
-slice :search => '//h3/a[@class="m"]', :static => 'index.html', :partial => 'header'</pre></code>
+configure.slices << { :search => 'h3.r a.l', :static => 'index.html', :partial => 'header' }
+configure.slices << { :search => '//h3/a[@class="m"]', :static => 'index.html', :partial => 'header' }
+# Create symbolic links in the public/ directory of the Rails app for selected sections and files.
+configure.links << { :static => 'galleries' }
+configure.links << { :static => 'events' }
+configure.links << { :static => 'holdout.html' }
+</pre></code>
+
Now when you run:
- rake ginsu:update
+ rake ginsu:slice
...Ginsu will find the header in your static/index.html file and create a partial in app/views/_header.html.erb with the contents of the HTML element that it locates using your CSS or xpath selector.
-Using this technique does not require your graphic designer to make any changes to the Dreamweaver project. You don't have to tag the section that you want to slice out, you simply describe where it's located and Ginsu will find it and slice it out.
+Using this technique does not require your graphic designer to make any changes to the Dreamweaver project. You don't have to tag the section that you want to slice out, you simply describe where it's located and Ginsu will find it and slice it out. You bring your graphic designers into the agile process by enabling them to update parts of the web site with their tools, without learning Rails.
h2. Installation
Install the Ginsu gem in your Rails application by adding this to your config/environment.rb:
@@ -52,26 +58,42 @@
Make sure that you have the gem:
rake gems:install
-Create your initializer, for configuring Ginsu:
+Generate your initializer, for configuring Ginsu:
- rake ginsu:setup
+ script/generate ginsu
Optionally, you can vendor the gem:
rake gems:unpack
h2. Configure
The Ginsu configuration is in the initializer file config/initializers/ginsu.rb:
+<pre><code>require 'ginsu'
+Ginsu::Knife.configure do |configure|
+
+ # The default location of the static web site is 'site', but maybe your static
+ # site includes 150 MB worth of Photoshop .psd files and you don't want those
+ # in your Capistrano deployments. Change the source path here if you want.
+ config.source = '/home/webproject/site'
+
+ config.slices << { :search => '#header', :static => 'index.html', :partial => 'header' }
+ config.slices << { :search => '#footer', :static => 'index.html', :partial => 'footer' }
+
+ config.links << { :static => 'galleries' }
+ config.links << { :static => 'news' }
+
+end</code></pre>
+
h2. Features
h3. slice
A slice is the content of an HTML element that Ginsu will slice out of a static HTML document and drop into a Rails partial template.
h3. link
-A link is a page or a folder that you want to be entirely served as static content. Ginsu will create symbolic links in your Rails application's public/ directory for each link.
+A link is a page or a folder that you want to be entirely served as static content. Ginsu will create symbolic links in your Rails application's public/ directory for each link.
\ No newline at end of file