From d8a02423e968b3cac4f4165876f96f368352d539 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Sun, 2 Nov 2008 12:37:48 +0100 Subject: [PATCH] rake task for generating rubyforge website; assets (logo, CSS) --- .gitignore | 4 +- Rakefile | 15 ++++- doc/website/favicon.ico | 0 doc/website/index.tpl | 28 ++++++++++ doc/website/master.css | 103 +++++++++++++++++++++++++++++++++++ doc/website/sinatra-logo.gif | Bin 0 -> 5337 bytes 6 files changed, 148 insertions(+), 2 deletions(-) create mode 100755 doc/website/favicon.ico create mode 100644 doc/website/index.tpl create mode 100644 doc/website/master.css create mode 100644 doc/website/sinatra-logo.gif diff --git a/.gitignore b/.gitignore index c8799d05..28ae51a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ -doc +doc/api +doc/website/index.html +doc/website/tmp/* *.log .DS_Store /dist diff --git a/Rakefile b/Rakefile index 630a9921..4077cc8c 100644 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,7 @@ +require 'rubygems' require 'rake/clean' +require 'fileutils' +require 'hpricot' task :default => :test @@ -98,7 +101,7 @@ task :doc => ['doc/api/index.html'] file 'doc/api/index.html' => FileList['lib/**/*.rb','README.rdoc'] do |f| rb_files = f.prerequisites sh((<<-end).gsub(/\s+/, ' ')) - hanna --charset utf8 \ + rdoc --charset utf8 \ --fmt html \ --inline-source \ --line-numbers \ @@ -109,3 +112,13 @@ file 'doc/api/index.html' => FileList['lib/**/*.rb','README.rdoc'] do |f| end end CLEAN.include 'doc/api' + +desc "Generate simple website" +task :website do + `rdoc --force-update -o doc/website/tmp README.rdoc` + readme = Hpricot( open("doc/website/tmp/files/README_rdoc.html") ).at('#bodyContent').inner_html + # Replace placeholder with Readme content + html = File.read("doc/website/index.tpl").sub(Regexp.new(Regexp.escape("{{REPLACE}}")), readme) + # TODO: Fix RDoc links + File.open( "doc/website/index.html", 'w+' ) { |f| f << html } +end diff --git a/doc/website/favicon.ico b/doc/website/favicon.ico new file mode 100755 index 00000000..e69de29b diff --git a/doc/website/index.tpl b/doc/website/index.tpl new file mode 100644 index 00000000..7a29964c --- /dev/null +++ b/doc/website/index.tpl @@ -0,0 +1,28 @@ + + + + + + Sinatra.rb + + + + + +
+ Sinatra Logo + +
+{{REPLACE}} +
+
+ + diff --git a/doc/website/master.css b/doc/website/master.css new file mode 100644 index 00000000..ff0ca1a3 --- /dev/null +++ b/doc/website/master.css @@ -0,0 +1,103 @@ +body { + font-size: 100%; + font-family: Helvetica, Arial, sans-serif; + margin: auto 10em; } + +body + { color: #222; + background: #fafafa; + font-family: Helvetica, Arial, sans-serif; + margin: auto 8em; + padding: 0; } + +a { + color: #1177DD; + text-decoration: none; } +a:hover { + text-decoration: underline; } + +a img + { border: none; } + +#navigation ul { + text-align: right; + list-style-type: none; + padding: 0; + margin: 0; + clear: both; + position: relative; } +#navigation ul li { + background: #e0e0e0; + padding: 0.4em; + margin-right: 0.5em; + display: inline; } + +#content + { background: #fff; + padding: 1em 2em; + margin: auto 2em; + border: 1px solid #ccc; + border-top: none; border-bottom: none; } + +#content .inner { + position: relative; + border-top: 4px solid #222; + margin-top: 0.2em; } + +#content h1, #content h2, #content h3, #content h4, #content h5, #content h6 { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } + +body #content h1:first-child { + color: #222; + background: #fff; + font: bold 300% Georgia, "Times New Roman", serif; + position: absolute; + left: 180px; + top: -2.7em; } + +#content h1 a { + color: #222; } + +#content p.first { /* TODO */ + font-size: 200%; } + +#content h2 { + color: #333; + font-size: 150%; + margin-top: 1.5em; + border-top: 4px solid #e0e0e0; + padding-top: .5em; } + +#content h3 { + font-weight: bold; + font-size: 120%; + color: #4e4e4e; + margin: 1em 0 .2em; } + +/* code */ +#content code, #content pre, #content textarea { + font-family: "Deja Vu Sans Mono", "Bitstream Vera Sans Mono", "Inconsolata", "Consolas", monospace; } +#content pre { + margin: .5em 0; + padding: .5em; } +#content pre { + margin: 1em 0; + font-size: 90%; + background-color: #f8f8ff; + border: 1px solid #dedede; + padding: .5em; + line-height: 1.5em; + color: #444; } + +#content pre code { + padding: 0; + font-size: 100%; + background-color: #f8f8ff; + border: none; } + +#content code { + font-size: 90%; + background-color: #f8f8ff; + color: #444; + padding: 0 .2em; + border: 1px solid #dedede; } diff --git a/doc/website/sinatra-logo.gif b/doc/website/sinatra-logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..b213dfbe442b452279e30e5053a9858ef6505fca GIT binary patch literal 5337 zcmeH}_czrK;QwEDbFb`qMU?DBDl)RlDus}dGP6s`UN3t`_PDs_wJz7@8eP|3Wo4(U z;tGi(N#4HS&tLKR<@5Xt9_Mk+Iwe|J&+qZQN4-bF*_@Qu3L0(?|!+1A^ zOx#{y8R%|&*WcV;j~^QwTUl9YCgM*19rt$;sclsQ{ryveY1@9J#3EGa1>B<%9kfm~nMN9lC1u^u1p4Gs#(c#~xL(6qKJ&FJo(f!?kc z9&XhYOqR<0fD^o12BW9BWGp z31NwXysV?6qd zEBRx`Bmd0E5ry~j4K6Uu>;@-js~W`qD@^K8(wgY|{bfFm$2Dq{OPtQ=`HJN99?HZo zvrBkoH(*NNv=FdpcsfS9?6&UuFgZ-E(ChN}g}<7GpW=T@xI^j#X=sWU(*$62k;gt9Oe=p;INyOKQN_BNM!zbe`Au``PGhdxH@UI^o1Kdcx-xE{HL+~s*yFl=jtt09gT7PaS z;y^F-vyDM|5}5NB21-tEC$j!n^VLxl65H#1{)`hWSY-rDG}vx?mw0J#ms{`m3kf* zErGd(RZjB|8+CP*!kCg9QDHgP4TX)|+N#S4w~=9pJ)f(E4B_&1uP8R|-!^y@_cZ$@ zadD!DxV*UOQM&3XE7Puw%c~{b5W#sO?fl~}boLrGZ+FV?8P#PV|60<*dwpVUs%=K;p&**^Sr_%Ig5NE-j~VtMpb^S@IR4_nCtzu26;bi z2{*aUmm1yncDiMQ*}hVI>>?WeX!|^`ytwv3N`0bP-;&8h+aT<*kX(2Jrb${1R9KOH zZJYQxD#ULPU@%G!*rt7D764tSCn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