Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minimal working frontend.

  • Loading branch information...
commit 2e49f2c9e7c603572e24ffac0cbf96260c305407 1 parent b770089
@mojombo mojombo authored
Showing with 325 additions and 20 deletions.
  1. +3 −0  gollum.gemspec
  2. +62 −0 lib/gollum/frontend/app.rb
  3. +93 −0 lib/gollum/frontend/public/css/global.css
  4. +15 −0 lib/gollum/frontend/templates/layout.mustache
  5. +1 −0  lib/gollum/frontend/templates/page.mustache
  6. +12 −0 lib/gollum/frontend/views/layout.rb
  7. +11 −0 lib/gollum/frontend/views/page.rb
  8. +6 −6 lib/gollum/markup.rb
  9. +92 −0 templates/formatting.html
  10. BIN  test/examples/lotr.git/objects/01/676dc56d35c1999c6fe9043fe8b78d52a0e797
  11. BIN  test/examples/lotr.git/objects/07/9a5887755dc6fbacfdb672abc168b0cce698fa
  12. BIN  test/examples/lotr.git/objects/11/5bbf9fe8004aa6a06274b44ab93a84a06e3204
  13. BIN  test/examples/lotr.git/objects/14/78ebf7ad4dc6a06c76cdb4aca0eba7f78796aa
  14. BIN  test/examples/lotr.git/objects/1e/716a3178a76fe39ee7b88f0cf2dc4a447566f6
  15. BIN  test/examples/lotr.git/objects/28/bb2f40d2e4c82a4ae62ef619a80a4b555e23ee
  16. BIN  test/examples/lotr.git/objects/2c/b9156ad383914561a8502fc70f5a1d887e48ad
  17. BIN  test/examples/lotr.git/objects/37/fcc52509fb09142cafccaada0252f3de81873c
  18. BIN  test/examples/lotr.git/objects/4c/770a352f1e86071b680f879a89874bf59008fa
  19. +3 −0  test/examples/lotr.git/objects/4f/de706c7c8d3b30b6caec8c82ff4c01261350f2
  20. BIN  test/examples/lotr.git/objects/71/4323c104239440a5c66ab12a67ed07a83c404f
  21. +1 −0  test/examples/lotr.git/objects/79/8f6564abb42d7ed34621d53595cbbe84638949
  22. BIN  test/examples/lotr.git/objects/7c/7251d713278633fbe506e1b74aba6c91ddd562
  23. BIN  test/examples/lotr.git/objects/93/633112529b0d0bdf25c2206682e59e9f5572e5
  24. BIN  test/examples/lotr.git/objects/a3/46f056d6d8e89f034489e403b3924fbc95f201
  25. +2 −0  test/examples/lotr.git/objects/af/e2034d400ba21e13361f38f74900c51dbc7fde
  26. BIN  test/examples/lotr.git/objects/b0/d108328459e44fff4a76cd19b10ddc34adce4b
  27. BIN  test/examples/lotr.git/objects/b3/14b19c56ee272a7c9dc379996d9a32f5c463d7
  28. +2 −0  test/examples/lotr.git/objects/bc/d5c99495011915971b2c9e38da8e5aacfe875d
  29. BIN  test/examples/lotr.git/objects/d9/e379fdea55b6ff3b71c110b3d2d7b55bbfd5ee
  30. BIN  test/examples/lotr.git/objects/e3/415337d9ae2c0b4b00054a93727f4a7d3c3ca5
  31. +2 −0  test/examples/lotr.git/objects/f2/5eccd98e9b667f9e22946f3e2f945378b8a72d
  32. +1 −0  test/examples/lotr.git/objects/f4/46205ac9df5b6a40c00785f06827f4a4dbd727
  33. +3 −0  test/examples/lotr.git/objects/fa/e7ef5344202bba4129abdc13060d9297d99465
  34. +1 −1  test/examples/lotr.git/refs/heads/master
  35. +5 −5 test/test_markup.rb
  36. +1 −1  test/test_page.rb
  37. +9 −7 test/test_wiki.rb
View
3  gollum.gemspec
@@ -24,7 +24,10 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = %w[README.md LICENSE]
s.add_dependency('grit', [">= 2.0.0", "< 3.0.0"])
+ s.add_dependency('github-markup', [">= 0.4.0", "< 1.0.0"])
s.add_dependency('albino', "~> 1.0.0")
+ s.add_dependency('sinatra', "~> 1.0.0")
+ s.add_dependency('mustache', [">= 0.11.2", "< 1.0.0"])
s.add_development_dependency('shoulda')
s.add_development_dependency('mocha')
View
62 lib/gollum/frontend/app.rb
@@ -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!
View
93 lib/gollum/frontend/public/css/global.css
@@ -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;
+}
View
15 lib/gollum/frontend/templates/layout.mustache
@@ -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>
View
1  lib/gollum/frontend/templates/page.mustache
@@ -0,0 +1 @@
+{{{content}}}
View
12 lib/gollum/frontend/views/layout.rb
@@ -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
View
11 lib/gollum/frontend/views/page.rb
@@ -0,0 +1,11 @@
+module Precious
+ module Views
+ class Page < Layout
+ attr_reader :content
+
+ def title
+ "A Page"
+ end
+ end
+ end
+end
View
12 lib/gollum/markup.rb
@@ -100,7 +100,7 @@ def process_image_tag(tag)
containered = true
align ||= 'left'
if %w{left right}.include?(align)
- classes << "float-#{align};"
+ classes << "float-#{align}"
end
elsif %w{top texttop middle absmiddle bottom absbottom baseline}.include?(align)
attrs << %{align="#{align}"}
@@ -136,12 +136,12 @@ def process_image_tag(tag)
if opts['frame'] || containered
classes << 'frame' if opts['frame']
- %{<div class="#{classes.join(' ')}">} +
- %{<div>} +
+ %{<span class="#{classes.join(' ')}">} +
+ %{<span>} +
%{<img src="/#{file.path}"#{style_string} #{attr_string}/>} +
- (alt ? %{<p>#{alt}</p>} : '') +
- %{</div>} +
- %{</div>}
+ (alt ? %{<span>#{alt}</span>} : '') +
+ %{</span>} +
+ %{</span>}
else
%{<img src="/#{file.path}"#{style_string} #{attr_string}/>}
end
View
92 templates/formatting.html
@@ -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>
View
BIN  test/examples/lotr.git/objects/01/676dc56d35c1999c6fe9043fe8b78d52a0e797
Binary file not shown
View
BIN  test/examples/lotr.git/objects/07/9a5887755dc6fbacfdb672abc168b0cce698fa
Binary file not shown
View
BIN  test/examples/lotr.git/objects/11/5bbf9fe8004aa6a06274b44ab93a84a06e3204
Binary file not shown
View
BIN  test/examples/lotr.git/objects/14/78ebf7ad4dc6a06c76cdb4aca0eba7f78796aa
Binary file not shown
View
BIN  test/examples/lotr.git/objects/1e/716a3178a76fe39ee7b88f0cf2dc4a447566f6
Binary file not shown
View
BIN  test/examples/lotr.git/objects/28/bb2f40d2e4c82a4ae62ef619a80a4b555e23ee
Binary file not shown
View
BIN  test/examples/lotr.git/objects/2c/b9156ad383914561a8502fc70f5a1d887e48ad
Binary file not shown
View
BIN  test/examples/lotr.git/objects/37/fcc52509fb09142cafccaada0252f3de81873c
Binary file not shown
View
BIN  test/examples/lotr.git/objects/4c/770a352f1e86071b680f879a89874bf59008fa
Binary file not shown
View
3  test/examples/lotr.git/objects/4f/de706c7c8d3b30b6caec8c82ff4c01261350f2
@@ -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�
View
BIN  test/examples/lotr.git/objects/71/4323c104239440a5c66ab12a67ed07a83c404f
Binary file not shown
View
1  test/examples/lotr.git/objects/79/8f6564abb42d7ed34621d53595cbbe84638949
@@ -0,0 +1 @@
+x��A��@ �9ϯ�����MO ı� 8P�8TrObe2�<�����d[��R.�<�3u�޽}���j�=v��ܳ8A� &���DN���Z���9�0$�J��iq8M�����U�M�-���.m!/r�b� �p?DYbi�N_+8��% L�|�$�3� ,ʹ�T�{ʢ�d�0�j�kB�R@�R�ЂW �e�I)f�H�DM�G*��c�S&]G��)�'�Z�$�W�l+驅#J�s_,���FT�կ��m1^znzC �[����6н�.�@�m�Lw�@�e�`^m���y6Z�� %�#�6p0���P�߆=�6��z��+�9��/n�6���O��!�x��P����j�'j+�nW����\�����k�T�/��
View
BIN  test/examples/lotr.git/objects/7c/7251d713278633fbe506e1b74aba6c91ddd562
Binary file not shown
View
BIN  test/examples/lotr.git/objects/93/633112529b0d0bdf25c2206682e59e9f5572e5
Binary file not shown
View
BIN  test/examples/lotr.git/objects/a3/46f056d6d8e89f034489e403b3924fbc95f201
Binary file not shown
View
2  test/examples/lotr.git/objects/af/e2034d400ba21e13361f38f74900c51dbc7fde
@@ -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
View
BIN  test/examples/lotr.git/objects/b0/d108328459e44fff4a76cd19b10ddc34adce4b
Binary file not shown
View
BIN  test/examples/lotr.git/objects/b3/14b19c56ee272a7c9dc379996d9a32f5c463d7
Binary file not shown
View
2  test/examples/lotr.git/objects/bc/d5c99495011915971b2c9e38da8e5aacfe875d
@@ -0,0 +1,2 @@
+x]�A��@ �9ϯ�ġ uSq��" 8P�8Tr'�2Gw��{<�V��r����{���������k�s����r���l �U {I� ����>K]��0f� Gʀ��p� S�N��h[~-nN}ނ-r�L�� ��0&YRi�N_+8�/%�L�|�d�0�+,�Vl��=���YGhu�-�G)�A�$�ЩL��rבR2�I�L����a��H�?.���R-��+u�+��#F�U_<�3��&T�կ�۶/7���u�=G���m��Wg.P
+%�]7`���K��������{� O/�7pp���X�ߎ=�6��v��+ŋ �/n�>���O���1�x���? f��ݎR���3���h�+�n}Dno���m��l��
View
BIN  test/examples/lotr.git/objects/d9/e379fdea55b6ff3b71c110b3d2d7b55bbfd5ee
Binary file not shown
View
BIN  test/examples/lotr.git/objects/e3/415337d9ae2c0b4b00054a93727f4a7d3c3ca5
Binary file not shown
View
2  test/examples/lotr.git/objects/f2/5eccd98e9b667f9e22946f3e2f945378b8a72d
@@ -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�
View
1  test/examples/lotr.git/objects/f4/46205ac9df5b6a40c00785f06827f4a4dbd727
@@ -0,0 +1 @@
+x��Kj�0@��)�)#i,KPJ��E�k}fh��d����������&8�^�`��).��9&AO��#)5-�КG�M(�,F�"-�E"By ��T,�V=�V������W��9x��]�xl<�mj����k��֭�BX \�I��y���ÿ��o�/ص3��1O��L�
View
3  test/examples/lotr.git/objects/fa/e7ef5344202bba4129abdc13060d9297d99465
@@ -0,0 +1,3 @@
+x��
+�0=�+�r�^�&4 Rz�ȦY�YH���O30�zX{<Dk�"�<� n�apQ*�褝���� �HL%��� �<J��Ur]h��ߒ��c
+�R+�{�[ � ?~*A
View
2  test/examples/lotr.git/refs/heads/master
@@ -1 +1 @@
-f01428b3138994aab19d5f880b6f37336ddf1f24
+4fde706c7c8d3b30b6caec8c82ff4c01261350f2
View
10 test/test_markup.rb
@@ -81,34 +81,34 @@
test "image with horizontal align" do
%w{left center right}.each do |align|
content = "a [[alpha.jpg|align=#{align}]] b"
- output = "<p>a <div class=\"align-#{align}\"><div><img src=\"/greek/alpha.jpg\" /></div></div> b</p>\n"
+ output = "<p>a <span class=\"align-#{align}\"><span><img src=\"/greek/alpha.jpg\" /></span></span> b</p>\n"
relative_image(content, output)
end
end
test "image with float" do
content = "a\n\n[[alpha.jpg|float]]\n\nb"
- output = "<p>a</p>\n\n<p><div class=\"float-left;\"><div><img src=\"/greek/alpha.jpg\" /></div></div></p>\n\n<p>b</p>\n"
+ output = "<p>a</p>\n\n<p><span class=\"float-left\"><span><img src=\"/greek/alpha.jpg\" /></span></span></p>\n\n<p>b</p>\n"
relative_image(content, output)
end
test "image with float and align" do
%w{left right}.each do |align|
content = "a\n\n[[alpha.jpg|float|align=#{align}]]\n\nb"
- output = "<p>a</p>\n\n<p><div class=\"float-#{align};\"><div><img src=\"/greek/alpha.jpg\" /></div></div></p>\n\n<p>b</p>\n"
+ output = "<p>a</p>\n\n<p><span class=\"float-#{align}\"><span><img src=\"/greek/alpha.jpg\" /></span></span></p>\n\n<p>b</p>\n"
relative_image(content, output)
end
end
test "image with frame" do
content = "a\n\n[[alpha.jpg|frame]]\n\nb"
- output = "<p>a</p>\n\n<p><div class=\"frame\"><div><img src=\"/greek/alpha.jpg\" /></div></div></p>\n\n<p>b</p>\n"
+ output = "<p>a</p>\n\n<p><span class=\"frame\"><span><img src=\"/greek/alpha.jpg\" /></span></span></p>\n\n<p>b</p>\n"
relative_image(content, output)
end
test "image with frame and alt" do
content = "a\n\n[[alpha.jpg|frame|alt=Alpha]]\n\nb"
- output = "<p>a</p>\n\n<p><div class=\"frame\"><div><img src=\"/greek/alpha.jpg\" alt=\"Alpha\" /><p>Alpha</p></div></div></p>\n\n<p>b</p>\n"
+ output = "<p>a</p>\n\n<p><span class=\"frame\"><span><img src=\"/greek/alpha.jpg\" alt=\"Alpha\" /><span>Alpha</span></span></span></p>\n\n<p>b</p>\n"
relative_image(content, output)
end
View
2  test/test_page.rb
@@ -28,7 +28,7 @@
test "page versions" do
page = @wiki.page('Bilbo Baggins')
- assert_equal ['5bc1aaec6149e854078f1d0f8b71933bbc6c2e43'],
+ assert_equal ["f25eccd98e9b667f9e22946f3e2f945378b8a72d", "5bc1aaec6149e854078f1d0f8b71933bbc6c2e43"],
page.versions.map { |v| v.id }
end
View
16 test/test_wiki.rb
@@ -17,25 +17,27 @@
test "shows paginated log with no page" do
Gollum::Wiki.per_page = 3
assert_equal %w(
- f01428b3138994aab19d5f880b6f37336ddf1f24
- fbabba862dfa7ac35b39042dd4ad780c9f67b8cb
- df26e61e707116f81ebc6b935ec6d1676b7e96c4),
+ 4fde706c7c8d3b30b6caec8c82ff4c01261350f2
+ 1e716a3178a76fe39ee7b88f0cf2dc4a447566f6
+ afe2034d400ba21e13361f38f74900c51dbc7fde),
@wiki.log.map { |c| c.id }
end
test "shows paginated log with 1st page" do
Gollum::Wiki.per_page = 3
assert_equal %w(
- f01428b3138994aab19d5f880b6f37336ddf1f24
- fbabba862dfa7ac35b39042dd4ad780c9f67b8cb
- df26e61e707116f81ebc6b935ec6d1676b7e96c4),
+ 4fde706c7c8d3b30b6caec8c82ff4c01261350f2
+ 1e716a3178a76fe39ee7b88f0cf2dc4a447566f6
+ afe2034d400ba21e13361f38f74900c51dbc7fde),
@wiki.log(:page => 1).map { |c| c.id }
end
test "shows paginated log with next page" do
Gollum::Wiki.per_page = 3
assert_equal %w(
- 5bc1aaec6149e854078f1d0f8b71933bbc6c2e43),
+ f25eccd98e9b667f9e22946f3e2f945378b8a72d
+ b0d108328459e44fff4a76cd19b10ddc34adce4b
+ f01428b3138994aab19d5f880b6f37336ddf1f24),
@wiki.log(:page => 2).map { |c| c.id }
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.