Permalink
Browse files

a local server for viewing the styleguide

  • Loading branch information...
1 parent afa93f1 commit 33db0067716e29068cdf7fbebcb9954d1956e8c9 Chad Pytel committed Apr 22, 2011
Showing with 35 additions and 10 deletions.
  1. +6 −0 README.md
  2. +14 −10 app/views/flutie/styleguides/show.erb
  3. +15 −0 server.rb
View
@@ -77,6 +77,12 @@ To rebuild the normal scss run:
sass -C --update public/stylesheets/sass:public/stylesheets
+You can run a server which will allow you to view the flutie styleguide locally:
+
+ ruby server.rb
+
+Browsing to localhost at the port output by the above command will show you the styleguide.
+
Credits
-------
@@ -1,10 +1,10 @@
<div>
<div style="padding: 15px; text-align: right;">
- <% if params[:flutie] -%>
- <%= link_to "Application Styles", :flutie => false %>
- <% else -%>
- <%= link_to "Default Styles", :flutie => true %>
- <% end -%>
+ <% if params[:flutie] %>
+ <a href="?flutie=false">Application Styles</a>
+ <% else %>
+ <a href="?flutie=true">Default Styles</a>
+ <% end %>
</div>
<h1>This is an example page of our basic styles</h1>
@@ -731,12 +731,16 @@ end</code></pre>
It should be the same size as &lt;p&gt; text.
</tt>
-<hr />
-<h1>Additional Styleguides</h1>
-<hr />
-<% @styleguides.each do |styleguide| %>
- <%= render :file => styleguide %>
+
+<% if @styleguides %>
+ <hr />
+ <h1>Additional Styleguides</h1>
+ <hr />
+
+ <% @styleguides.each do |styleguide| %>
+ <%= render :file => styleguide %>
+ <% end %>
<% end %>
</div>
View
@@ -0,0 +1,15 @@
+require 'rubygems'
+require 'sinatra'
+
+set :views, ['app/views']
+set :static, true
+
+helpers do
+ def stylesheet_link_tag(name)
+ "<link href='/stylesheets/#{name}.css' media='all' rel='Stylesheet' type='text/css' />"
+ end
+end
+
+get '/' do
+ erb :"flutie/styleguides/show", :layout => :"layouts/flutie"
+end

0 comments on commit 33db006

Please sign in to comment.