Skip to content

Commit

Permalink
This is bewildering
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Nov 17, 2013
1 parent 667dbd9 commit f115c3b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 39 deletions.
20 changes: 13 additions & 7 deletions lib/uncle_clive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ class Spectrum < Sinatra::Base
use Rack::GoogleAnalytics, :tracker => 'UA-20895204-11'

get '/' do
haml :readme, :locals => {
:text => markdown(File.read('README.md')),
haml :layout, :locals => {
:title => '© 1982 Sinclair Research Ltd.'
}
} do
haml :readme, :locals => {
:text => markdown(File.read('README.md'))
}
end
end

get '/:text' do
Expand All @@ -41,10 +44,13 @@ def respond text

when 'text/html'
cs.formatter = UncleClive::Formatters::HTMLTableFormatter.new
halt haml :tabliser, :locals => {
:title => params[:text],
:table => cs[params[:text]]
}
halt haml :layout, :locals => {
:title => params[:text]
} do
haml :tabliser, :locals => {
:table => cs[params[:text]]
}
end

when 'text/plain'
cs.formatter = UncleClive::Formatters::TextFormatter.new
Expand Down
9 changes: 9 additions & 0 deletions lib/views/layout.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
!!! 5
%html(lang="en")
%head
%title= title
%link{:rel => 'stylesheet', :href => '//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css', :type => "text/css"}
%link{:rel => 'stylesheet', :href => '../uncle-clive.css', :type => "text/css"}

%body
= content
32 changes: 12 additions & 20 deletions lib/views/readme.haml
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
!!! 5
%html(lang="en")
%head
%title= title
%link{:rel => 'stylesheet', :href => '//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css', :type => "text/css"}
%link{:rel => 'stylesheet', :href => '../uncle-clive.css', :type => "text/css"}

%body
.body
%a{:href => "https://github.com/pikesley/uncle-clive"}
%img{:style => "position: absolute; top: 0; right: 0; border: 0;",
.body
%a{:href => "https://github.com/pikesley/uncle-clive"}
%img{:style => "position: absolute; top: 0; right: 0; border: 0;",
:src => "https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png",
:alt => "Fork me on GitHub"}
.container
#readme~ text
.container
#readme~ text

%footer
%p
%a{:href => "http://github.com/pikesley/uncle-clive"}Source on Github
|
%a{:href => "http://travis-ci.org/pikesley/uncle-clive"}Built on Travis
|
%a{:href => "http://heroku.com"}Hosted on Heroku
%footer
%p
%a{:href => "http://github.com/pikesley/uncle-clive"}Source on Github
|
%a{:href => "http://travis-ci.org/pikesley/uncle-clive"}Built on Travis
|
%a{:href => "http://heroku.com"}Hosted on Heroku
16 changes: 4 additions & 12 deletions lib/views/tabliser.haml
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
!!! 5
%html(lang="en")
%head
%title= title
%link{:rel => 'stylesheet', :href => 'http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css', :type => "text/css"}
%link{:rel => 'stylesheet', :href => '../sinclair.css', :type => "text/css"}

%body
.body
.container
.hero-unit
= table
.body
.container
.hero-unit
= table

0 comments on commit f115c3b

Please sign in to comment.