forked from gollum/gollum
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
325 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
require 'rubygems' | ||
|
||
require 'sinatra' | ||
require 'gollum' | ||
require 'mustache/sinatra' | ||
|
||
require 'gollum/frontend/views/layout' | ||
|
||
$path = "~/dev/mojombo/gollum/test/examples/lotr.git" | ||
|
||
module Precious | ||
class App < Sinatra::Base | ||
register Mustache::Sinatra | ||
|
||
dir = File.dirname(File.expand_path(__FILE__)) | ||
|
||
# We want to serve public assets for now | ||
set :public, "#{dir}/public" | ||
set :static, true | ||
|
||
set :mustache, { | ||
# Tell mustache where the Views constant lives | ||
:namespace => Precious, | ||
|
||
# Mustache templates live here | ||
:templates => "#{dir}/templates", | ||
|
||
# Tell mustache where the views are | ||
:views => "#{dir}/views" | ||
} | ||
|
||
# Sinatra error handling | ||
configure :development, :staging do | ||
set :raise_errors, false | ||
set :show_exceptions, true | ||
set :dump_errors, true | ||
set :clean_trace, false | ||
end | ||
|
||
get '/' do | ||
show_page_or_file('Home') | ||
end | ||
|
||
get '/*' do | ||
show_page_or_file(params[:splat].first) | ||
end | ||
|
||
def show_page_or_file(name) | ||
wiki = Gollum::Wiki.new($path) | ||
if page = wiki.page(name) | ||
@content = page.formatted_data | ||
mustache :page | ||
elsif file = wiki.file(name) | ||
file.raw_data | ||
else | ||
halt 404 | ||
end | ||
end | ||
end | ||
end | ||
|
||
Precious::App.run! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
h1, h2, h3, h4, h5, h6 { | ||
color: #f90; | ||
font-weight: bold; | ||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||
} | ||
|
||
h1 { | ||
font-size: 36pt; | ||
} | ||
|
||
h2 { | ||
font-size: 32pt; | ||
} | ||
|
||
h3 { | ||
font-size: 28pt; | ||
} | ||
|
||
h4 { | ||
font-size: 24pt; | ||
} | ||
|
||
h5 { | ||
font-size: 20pt; | ||
} | ||
|
||
h6 { | ||
font-size: 16pt; | ||
} | ||
|
||
p { | ||
font-family: Georgia, serif; | ||
font-size: 14pt; | ||
line-height: 22pt; | ||
} | ||
|
||
#content { | ||
width: 60em; | ||
margin: 0 auto; | ||
color: #666; | ||
} | ||
|
||
/***********************/ | ||
|
||
.frame { | ||
margin: 1em 0; | ||
display: inline-block; | ||
} | ||
|
||
.frame img { | ||
display: block; | ||
} | ||
|
||
.frame > span { | ||
display: block; | ||
border: 1px solid #aaa; | ||
padding: 4px; | ||
} | ||
|
||
.frame span span { | ||
display: block; | ||
font-size: 10pt; | ||
margin: 0; | ||
padding: 4px 0 2px 0; | ||
text-align: center; | ||
line-height: 10pt; | ||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | ||
} | ||
|
||
.float-left { | ||
float: left; | ||
padding: .5em 1em .25em 0; | ||
} | ||
|
||
.float-right { | ||
float: right; | ||
padding: .5em 0 .25em 1em; | ||
} | ||
|
||
.align-left { | ||
display: block; | ||
text-align: left; | ||
} | ||
|
||
.align-center { | ||
display: block; | ||
text-align: center; | ||
} | ||
|
||
.align-right { | ||
display: block; | ||
text-align: right; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | ||
<title>Gollum - {{title}}</title> | ||
<link rel="stylesheet" href="/css/global.css" type="text/css" charset="utf-8" /> | ||
</head> | ||
|
||
<body> | ||
<div id="content"> | ||
{{{yield}}} | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{{content}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Precious | ||
module Views | ||
class Layout < Mustache | ||
include Rack::Utils | ||
alias_method :h, :escape_html | ||
|
||
def title | ||
"Home" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Precious | ||
module Views | ||
class Page < Layout | ||
attr_reader :content | ||
|
||
def title | ||
"A Page" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<style> | ||
div.frame { | ||
margin: 1em 0; | ||
} | ||
|
||
div.frame div { | ||
display: inline-block; | ||
border: 1px solid #aaa; | ||
padding: 4px; | ||
} | ||
|
||
div div p { | ||
font-size: 9px; | ||
margin: 0; | ||
padding: 4px 0 0 0; | ||
text-align: center; | ||
} | ||
|
||
.float-left { | ||
float: left; | ||
padding-right: 1em; | ||
} | ||
|
||
.float-right { | ||
float: right; | ||
padding-left: 1em; | ||
} | ||
|
||
.align-left { | ||
text-align: left; | ||
} | ||
|
||
.align-center { | ||
text-align: center; | ||
} | ||
|
||
.align-right { | ||
text-align: right; | ||
} | ||
</style> | ||
|
||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas hendrerit eros felis. Nunc non enim at dolor malesuada pellentesque a quis nibh. Aliquam sit amet pretium ante. <img src="http://www.google.com/images/nav_logo8.png" style="max-width: 16px;" /> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas hendrerit eros felis. Nunc non enim at dolor malesuada pellentesque a quis nibh. Aliquam sit amet pretium ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas hendrerit eros felis. Nunc non enim at dolor malesuada pellentesque a quis nibh. Aliquam sit amet pretium ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas hendrerit eros felis. Nunc non enim at dolor malesuada pellentesque a quis nibh. Aliquam sit amet pretium ante. | ||
|
||
<div class="frame float-left"> | ||
<div> | ||
<img src="http://www.google.com/images/nav_logo8.png" style="max-width: 100px;" /> | ||
<p>Google</p> | ||
</div> | ||
</div> | ||
|
||
Fusce ullamcorper orci enim. Duis lectus elit, convallis ac convallis sit amet, euismod imperdiet dolor. Nunc egestas nisi quis magna feugiat vitae fringilla elit fermentum. | ||
|
||
<div class="frame float-right"> | ||
<div> | ||
<img src="http://www.google.com/images/nav_logo8.png" style="max-width: 100px;" /> | ||
<p>Google</p> | ||
</div> | ||
</div> | ||
|
||
Vivamus sollicitudin dolor sit amet elit mollis ultricies. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas hendrerit eros felis. Nunc non enim at dolor malesuada pellentesque a quis nibh. Aliquam sit amet pretium ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas hendrerit eros felis. Nunc non enim at dolor malesuada pellentesque a quis nibh. Aliquam sit amet pretium ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas hendrerit eros felis. Nunc non enim at dolor malesuada pellentesque a quis nibh. Aliquam sit amet pretium ante.<p> | ||
|
||
<div class="frame align-left"> | ||
<div> | ||
<img src="http://www.google.com/images/nav_logo8.png" /> | ||
<p>Google</p> | ||
</div> | ||
</div> | ||
|
||
<p>Phasellus porta dignissim leo vel hendrerit. Nulla pellentesque nisi ac nunc malesuada aliquam. Nullam et cursus augue. Sed rhoncus pharetra odio, vel dictum diam facilisis et. Etiam molestie justo ut purus elementum rhoncus. Fusce nec augue lectus. Proin a nisl ac lectus facilisis tempus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent blandit tempus libero, in interdum odio dignissim quis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec quis arcu a metus tincidunt scelerisque eget sed mauris. Nullam pellentesque faucibus sodales. Integer ullamcorper enim id nibh tempor ultricies.</p> | ||
|
||
<div class="frame align-center"> | ||
<div> | ||
<img src="http://www.google.com/images/nav_logo8.png" /> | ||
<p>Google</p> | ||
</div> | ||
</div> | ||
|
||
<p>Phasellus porta dignissim leo vel hendrerit. Nulla pellentesque nisi ac nunc malesuada aliquam. Nullam et cursus augue. Sed rhoncus pharetra odio, vel dictum diam facilisis et. Etiam molestie justo ut purus elementum rhoncus. Fusce nec augue lectus. Proin a nisl ac lectus facilisis tempus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent blandit tempus libero, in interdum odio dignissim quis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec quis arcu a metus tincidunt scelerisque eget sed mauris. Nullam pellentesque faucibus sodales. Integer ullamcorper enim id nibh tempor ultricies.</p> | ||
|
||
<p> | ||
<div class="frame align-right"> | ||
<div> | ||
<img src="http://www.google.com/images/nav_logo8.png" /> | ||
</div> | ||
</div> | ||
</p> | ||
|
||
<p>Phasellus porta dignissim leo vel hendrerit. Nulla pellentesque nisi ac nunc malesuada aliquam. Nullam et cursus augue. Sed rhoncus pharetra odio, vel dictum diam facilisis et. Etiam molestie justo ut purus elementum rhoncus. Fusce nec augue lectus. Proin a nisl ac lectus facilisis tempus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent blandit tempus libero, in interdum odio dignissim quis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec quis arcu a metus tincidunt scelerisque eget sed mauris. Nullam pellentesque faucibus sodales. Integer ullamcorper enim id nibh tempor ultricies. <div class="frame align-right"> | ||
<div> | ||
<img src="http://www.google.com/images/nav_logo8.png" /> | ||
</div> | ||
</div> Phasellus porta dignissim leo vel hendrerit. Nulla pellentesque nisi ac nunc malesuada aliquam. Nullam et cursus augue. Sed rhoncus pharetra odio, vel dictum diam facilisis et. Etiam molestie justo ut purus elementum rhoncus. Fusce nec augue lectus. Proin a nisl ac lectus facilisis tempus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent blandit tempus libero, in interdum odio dignissim quis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Donec quis arcu a metus tincidunt scelerisque eget sed mauris. Nullam pellentesque faucibus sodales. Integer ullamcorper enim id nibh tempor ultricies.</p> |
Binary file added
BIN
+195 Bytes
test/examples/lotr.git/objects/01/676dc56d35c1999c6fe9043fe8b78d52a0e797
Binary file not shown.
Binary file added
BIN
+747 Bytes
test/examples/lotr.git/objects/07/9a5887755dc6fbacfdb672abc168b0cce698fa
Binary file not shown.
Binary file added
BIN
+196 Bytes
test/examples/lotr.git/objects/11/5bbf9fe8004aa6a06274b44ab93a84a06e3204
Binary file not shown.
Binary file added
BIN
+195 Bytes
test/examples/lotr.git/objects/14/78ebf7ad4dc6a06c76cdb4aca0eba7f78796aa
Binary file not shown.
Binary file added
BIN
+164 Bytes
test/examples/lotr.git/objects/1e/716a3178a76fe39ee7b88f0cf2dc4a447566f6
Binary file not shown.
Binary file added
BIN
+171 Bytes
test/examples/lotr.git/objects/28/bb2f40d2e4c82a4ae62ef619a80a4b555e23ee
Binary file not shown.
Binary file added
BIN
+399 Bytes
test/examples/lotr.git/objects/2c/b9156ad383914561a8502fc70f5a1d887e48ad
Binary file not shown.
Binary file added
BIN
+195 Bytes
test/examples/lotr.git/objects/37/fcc52509fb09142cafccaada0252f3de81873c
Binary file not shown.
Binary file added
BIN
+195 Bytes
test/examples/lotr.git/objects/4c/770a352f1e86071b680f879a89874bf59008fa
Binary file not shown.
3 changes: 3 additions & 0 deletions
3
test/examples/lotr.git/objects/4f/de706c7c8d3b30b6caec8c82ff4c01261350f2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
x��K | ||
1]�}��ɯ{"���:���i������y�� | ||
^�������̐�vI��ِ��CɖBXB�����R��y��4F�i���m`��,u�Ք�s�+���p����!�t�q�Ӑvi�䘥�AZ9����Y�t9v��^յ3�F}ɆJ� |
Binary file added
BIN
+9.37 KB
test/examples/lotr.git/objects/71/4323c104239440a5c66ab12a67ed07a83c404f
Binary file not shown.
1 change: 1 addition & 0 deletions
1
test/examples/lotr.git/objects/79/8f6564abb42d7ed34621d53595cbbe84638949
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+125 Bytes
test/examples/lotr.git/objects/7c/7251d713278633fbe506e1b74aba6c91ddd562
Binary file not shown.
Binary file added
BIN
+759 Bytes
test/examples/lotr.git/objects/93/633112529b0d0bdf25c2206682e59e9f5572e5
Binary file not shown.
Binary file added
BIN
+195 Bytes
test/examples/lotr.git/objects/a3/46f056d6d8e89f034489e403b3924fbc95f201
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
test/examples/lotr.git/objects/af/e2034d400ba21e13361f38f74900c51dbc7fde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
x��M | ||
�0F]�s�J:��D<������B:%ƅ��gp�=ރo�Z��ѡ7�)璊Dk�ٳ�(qN�#�[Z27Y;�d��%e�CI���'XM.�9�b�����M�]��.m����R��5�q�z�C�0Z?�`��f��˾������+�=���o#J |
Binary file added
BIN
+167 Bytes
test/examples/lotr.git/objects/b0/d108328459e44fff4a76cd19b10ddc34adce4b
Binary file not shown.
Binary file added
BIN
+194 Bytes
test/examples/lotr.git/objects/b3/14b19c56ee272a7c9dc379996d9a32f5c463d7
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
test/examples/lotr.git/objects/bc/d5c99495011915971b2c9e38da8e5aacfe875d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+124 Bytes
test/examples/lotr.git/objects/d9/e379fdea55b6ff3b71c110b3d2d7b55bbfd5ee
Binary file not shown.
Binary file added
BIN
+124 Bytes
test/examples/lotr.git/objects/e3/415337d9ae2c0b4b00054a93727f4a7d3c3ca5
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
test/examples/lotr.git/objects/f2/5eccd98e9b667f9e22946f3e2f945378b8a72d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
x��Kj�0@��)�)#{$�����@���h��d����������&,k|�C���iuK���͞�q��#��EDn�<ҐmB�j�ׅ�E!j�Q | ||
�T��Z�J��l�1�u�U;|٧n�/�x��?��h��Z���]���Y�`@4'=/�)�����zs�m�p<`�.�ϣ5��,L� |
1 change: 1 addition & 0 deletions
1
test/examples/lotr.git/objects/f4/46205ac9df5b6a40c00785f06827f4a4dbd727
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
test/examples/lotr.git/objects/fa/e7ef5344202bba4129abdc13060d9297d99465
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
x�� | ||
�0=�+�r�^�&4 Rz�ȦY�YH���O30�zX{<Dk�"�<�n�apQ*��褝�����HL%����<J��Ur]h��ߒ��c | ||
�R+�{�[�?~*A | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
f01428b3138994aab19d5f880b6f37336ddf1f24 | ||
4fde706c7c8d3b30b6caec8c82ff4c01261350f2 |
Oops, something went wrong.