diff --git a/HISTORY.md b/HISTORY.md index 6938de58..e4f977dc 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,7 @@ # HEAD +* Major Enhancements + * Add Page sidebars, similar to Page footers. * Minor Enhancements * Add `:sanitization` and `:history_sanitization` options for customizing how `Sanitize.clean` modifies formatted wiki content. diff --git a/lib/gollum/page.rb b/lib/gollum/page.rb index 5ec7cfb5..5b888964 100644 --- a/lib/gollum/page.rb +++ b/lib/gollum/page.rb @@ -55,7 +55,7 @@ module Gollum # Returns a newly initialized Gollum::Page. def initialize(wiki) @wiki = wiki - @blob = nil + @blob = @footer = @sidebar = nil end # Public: The on-disk filename of the page including extension. @@ -196,7 +196,14 @@ module Gollum # # Returns the footer Page or nil if none exists. def footer - find_sub_page :footer + @footer ||= find_sub_page(:footer) + end + + # Public: The sidebar Page. + # + # Returns the sidebar Page or nil if none exists. + def sidebar + @sidebar ||= find_sub_page(:sidebar) end # Gets a Boolean determining whether this page is a historical version. @@ -352,6 +359,7 @@ module Gollum # # Returns the Page or nil if none exists. def find_sub_page(name) + return nil if self.filename =~ /^_/ name = "_#{name.to_s.capitalize}" return nil if page_match(name, self.filename) diff --git a/test/examples/lotr.git/COMMIT_EDITMSG b/test/examples/lotr.git/COMMIT_EDITMSG new file mode 100644 index 00000000..25541c25 --- /dev/null +++ b/test/examples/lotr.git/COMMIT_EDITMSG @@ -0,0 +1 @@ +add sidebars diff --git a/test/examples/lotr.git/config b/test/examples/lotr.git/config index c53d818d..ec3337a4 100644 --- a/test/examples/lotr.git/config +++ b/test/examples/lotr.git/config @@ -1,5 +1,12 @@ [core] repositoryformatversion = 0 filemode = true - bare = true + bare = false + logallrefupdates = true ignorecase = true +[remote "origin"] + fetch = +refs/heads/*:refs/remotes/origin/* + url = /Users/rick/p/gollum/test/examples/lotr.git +[branch "master"] + remote = origin + merge = refs/heads/master diff --git a/test/examples/lotr.git/hooks/commit-msg.sample b/test/examples/lotr.git/hooks/commit-msg.sample index 6ef1d29d..b58d1184 100755 --- a/test/examples/lotr.git/hooks/commit-msg.sample +++ b/test/examples/lotr.git/hooks/commit-msg.sample @@ -1,7 +1,7 @@ #!/bin/sh # # An example hook script to check the commit log message. -# Called by git-commit with one argument, the name of the file +# Called by "git commit" with one argument, the name of the file # that has the commit message. The hook should exit with non-zero # status after issuing an appropriate message if it wants to stop the # commit. The hook is allowed to edit the commit message file. diff --git a/test/examples/lotr.git/hooks/post-update.sample b/test/examples/lotr.git/hooks/post-update.sample index 5323b56b..ec17ec19 100755 --- a/test/examples/lotr.git/hooks/post-update.sample +++ b/test/examples/lotr.git/hooks/post-update.sample @@ -5,4 +5,4 @@ # # To enable this hook, rename this file to "post-update". -exec git-update-server-info +exec git update-server-info diff --git a/test/examples/lotr.git/hooks/pre-commit.sample b/test/examples/lotr.git/hooks/pre-commit.sample index 439eefda..b187c4bb 100755 --- a/test/examples/lotr.git/hooks/pre-commit.sample +++ b/test/examples/lotr.git/hooks/pre-commit.sample @@ -1,13 +1,13 @@ #!/bin/sh # # An example hook script to verify what is about to be committed. -# Called by git-commit with no arguments. The hook should +# Called by "git commit" with no arguments. The hook should # exit with non-zero status after issuing an appropriate message if # it wants to stop the commit. # # To enable this hook, rename this file to "pre-commit". -if git-rev-parse --verify HEAD >/dev/null 2>&1 +if git rev-parse --verify HEAD >/dev/null 2>&1 then against=HEAD else diff --git a/test/examples/lotr.git/hooks/pre-rebase.sample b/test/examples/lotr.git/hooks/pre-rebase.sample index be1b06e2..9773ed4c 100755 --- a/test/examples/lotr.git/hooks/pre-rebase.sample +++ b/test/examples/lotr.git/hooks/pre-rebase.sample @@ -2,7 +2,7 @@ # # Copyright (c) 2006, 2008 Junio C Hamano # -# The "pre-rebase" hook is run just before "git-rebase" starts doing +# The "pre-rebase" hook is run just before "git rebase" starts doing # its job, and can prevent the command from running by exiting with # non-zero status. # @@ -43,7 +43,7 @@ git show-ref -q "$topic" || { } # Is topic fully merged to master? -not_in_master=`git-rev-list --pretty=oneline ^master "$topic"` +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` if test -z "$not_in_master" then echo >&2 "$topic is fully merged to master; better remove it." @@ -51,11 +51,11 @@ then fi # Is topic ever merged to next? If so you should not be rebasing it. -only_next_1=`git-rev-list ^master "^$topic" ${publish} | sort` -only_next_2=`git-rev-list ^master ${publish} | sort` +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` if test "$only_next_1" = "$only_next_2" then - not_in_topic=`git-rev-list "^$topic" master` + not_in_topic=`git rev-list "^$topic" master` if test -z "$not_in_topic" then echo >&2 "$topic is already up-to-date with master" @@ -64,8 +64,8 @@ then exit 0 fi else - not_in_next=`git-rev-list --pretty=oneline ^${publish} "$topic"` - perl -e ' + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' my $topic = $ARGV[0]; my $msg = "* $topic has commits already merged to public branch:\n"; my (%not_in_next) = map { @@ -157,13 +157,13 @@ B to be deleted. To compute (1): - git-rev-list ^master ^topic next - git-rev-list ^master next + git rev-list ^master ^topic next + git rev-list ^master next if these match, topic has not merged in next at all. To compute (2): - git-rev-list master..topic + git rev-list master..topic if this is empty, it is fully merged to "master". diff --git a/test/examples/lotr.git/hooks/prepare-commit-msg.sample b/test/examples/lotr.git/hooks/prepare-commit-msg.sample index 36524249..f093a02e 100755 --- a/test/examples/lotr.git/hooks/prepare-commit-msg.sample +++ b/test/examples/lotr.git/hooks/prepare-commit-msg.sample @@ -1,7 +1,7 @@ #!/bin/sh # # An example hook script to prepare the commit log message. -# Called by git-commit with the name of the file that has the +# Called by "git commit" with the name of the file that has the # commit message, followed by the description of the commit # message's source. The hook's purpose is to edit the commit # message file. If the hook fails with a non-zero status, @@ -22,10 +22,10 @@ case "$2,$3" in merge,) - perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; # ,|template,) -# perl -i.bak -pe ' +# /usr/bin/perl -i.bak -pe ' # print "\n" . `git diff --cached --name-status -r` # if /^#/ && $first++ == 0' "$1" ;; diff --git a/test/examples/lotr.git/hooks/update.sample b/test/examples/lotr.git/hooks/update.sample index fd63b2d6..71ab04ed 100755 --- a/test/examples/lotr.git/hooks/update.sample +++ b/test/examples/lotr.git/hooks/update.sample @@ -1,7 +1,7 @@ #!/bin/sh # # An example hook script to blocks unannotated tags from entering. -# Called by git-receive-pack with arguments: refname sha1-old sha1-new +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new # # To enable this hook, rename this file to "update". # @@ -64,7 +64,7 @@ zero="0000000000000000000000000000000000000000" if [ "$newrev" = "$zero" ]; then newrev_type=delete else - newrev_type=$(git-cat-file -t $newrev) + newrev_type=$(git cat-file -t $newrev) fi case "$refname","$newrev_type" in diff --git a/test/examples/lotr.git/index b/test/examples/lotr.git/index new file mode 100644 index 00000000..cc6fa46e Binary files /dev/null and b/test/examples/lotr.git/index differ diff --git a/test/examples/lotr.git/info/exclude b/test/examples/lotr.git/info/exclude index 2c87b72d..a5196d1b 100644 --- a/test/examples/lotr.git/info/exclude +++ b/test/examples/lotr.git/info/exclude @@ -1,4 +1,4 @@ -# git-ls-files --others --exclude-from=.git/info/exclude +# git ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. # For a project mostly in C, the following would be a good set of # exclude patterns (uncomment them if you want to use them): diff --git a/test/examples/lotr.git/info/refs b/test/examples/lotr.git/info/refs deleted file mode 100644 index 23535fff..00000000 --- a/test/examples/lotr.git/info/refs +++ /dev/null @@ -1 +0,0 @@ -d61c3de65957b5997c236393b3ad4d70b5cd8931 refs/heads/master diff --git a/test/examples/lotr.git/logs/HEAD b/test/examples/lotr.git/logs/HEAD new file mode 100644 index 00000000..99c12840 --- /dev/null +++ b/test/examples/lotr.git/logs/HEAD @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 60f12f4254f58801b9ee7db7bca5fa8aeefaa56b rick 1291341857 -0800 clone: from /Users/rick/p/gollum/test/examples/lotr.git +60f12f4254f58801b9ee7db7bca5fa8aeefaa56b a8ad3c09dd842a3517085bfadd37718856dee813 rick 1291341922 -0800 commit: add sidebars diff --git a/test/examples/lotr.git/logs/refs/heads/master b/test/examples/lotr.git/logs/refs/heads/master new file mode 100644 index 00000000..99c12840 --- /dev/null +++ b/test/examples/lotr.git/logs/refs/heads/master @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 60f12f4254f58801b9ee7db7bca5fa8aeefaa56b rick 1291341857 -0800 clone: from /Users/rick/p/gollum/test/examples/lotr.git +60f12f4254f58801b9ee7db7bca5fa8aeefaa56b a8ad3c09dd842a3517085bfadd37718856dee813 rick 1291341922 -0800 commit: add sidebars diff --git a/test/examples/lotr.git/objects/84/0ec5b1ba1320e8ec443f28f99566f615d5af10 b/test/examples/lotr.git/objects/84/0ec5b1ba1320e8ec443f28f99566f615d5af10 new file mode 100644 index 00000000..a1e90909 Binary files /dev/null and b/test/examples/lotr.git/objects/84/0ec5b1ba1320e8ec443f28f99566f615d5af10 differ diff --git a/test/examples/lotr.git/objects/a3/1ca2a7c352c92531a8b99815d15843b259e814 b/test/examples/lotr.git/objects/a3/1ca2a7c352c92531a8b99815d15843b259e814 new file mode 100644 index 00000000..3876f6c3 Binary files /dev/null and b/test/examples/lotr.git/objects/a3/1ca2a7c352c92531a8b99815d15843b259e814 differ diff --git a/test/examples/lotr.git/objects/a8/ad3c09dd842a3517085bfadd37718856dee813 b/test/examples/lotr.git/objects/a8/ad3c09dd842a3517085bfadd37718856dee813 new file mode 100644 index 00000000..efd0cc98 Binary files /dev/null and b/test/examples/lotr.git/objects/a8/ad3c09dd842a3517085bfadd37718856dee813 differ diff --git a/test/examples/lotr.git/packed-refs b/test/examples/lotr.git/packed-refs index 0a68312a..093dfa7f 100644 --- a/test/examples/lotr.git/packed-refs +++ b/test/examples/lotr.git/packed-refs @@ -1,2 +1,2 @@ # pack-refs with: peeled -d61c3de65957b5997c236393b3ad4d70b5cd8931 refs/heads/master +60f12f4254f58801b9ee7db7bca5fa8aeefaa56b refs/remotes/origin/master diff --git a/test/examples/lotr.git/refs/heads/master b/test/examples/lotr.git/refs/heads/master index 3f114d47..c64ca983 100644 --- a/test/examples/lotr.git/refs/heads/master +++ b/test/examples/lotr.git/refs/heads/master @@ -1 +1 @@ -60f12f4254f58801b9ee7db7bca5fa8aeefaa56b \ No newline at end of file +a8ad3c09dd842a3517085bfadd37718856dee813 diff --git a/test/examples/lotr.git/refs/remotes/origin/HEAD b/test/examples/lotr.git/refs/remotes/origin/HEAD new file mode 100644 index 00000000..6efe28ff --- /dev/null +++ b/test/examples/lotr.git/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/test/examples/lotr/Bilbo-Baggins.md b/test/examples/lotr/Bilbo-Baggins.md new file mode 100644 index 00000000..2cb9156a --- /dev/null +++ b/test/examples/lotr/Bilbo-Baggins.md @@ -0,0 +1,13 @@ +# Bilbo Baggins + +Bilbo Baggins is the protagonist of The [[Hobbit]] and also makes a few +appearances in The Lord of the Rings, two of the most well-known of [[J. R. R. +Tolkien]]'s fantasy writings. The story of The Hobbit featuring Bilbo is also +retold from a different perspective in the Chapter The Quest of Erebor in +Unfinished Tales. + +In Tolkien's narrative conceit, in which all the writings of Middle-earth are +'really' translations from the fictitious volume of The Red Book of Westmarch, +Bilbo is the author of The Hobbit and translator of The Silmarillion. + +From [http://en.wikipedia.org/wiki/Bilbo_Baggins](http://en.wikipedia.org/wiki/Bilbo_Baggins). diff --git a/test/examples/lotr/Data.csv b/test/examples/lotr/Data.csv new file mode 100644 index 00000000..c3b43e9f --- /dev/null +++ b/test/examples/lotr/Data.csv @@ -0,0 +1,3 @@ +FirstName,LastName +Bilbo,Baggins +Frodo,Baggins diff --git a/test/examples/lotr/Home.textile b/test/examples/lotr/Home.textile new file mode 100644 index 00000000..fae7ef53 --- /dev/null +++ b/test/examples/lotr/Home.textile @@ -0,0 +1,3 @@ +h1. The LOTR Wiki + +This wiki is awesome. You can learn about [[Bilbo Baggins]] or some [[evil|Eye Of Sauron]] stuff. diff --git a/test/examples/lotr/Mordor/Eye-Of-Sauron.md b/test/examples/lotr/Mordor/Eye-Of-Sauron.md new file mode 100644 index 00000000..936b83ee --- /dev/null +++ b/test/examples/lotr/Mordor/Eye-Of-Sauron.md @@ -0,0 +1,37 @@ +# Eye **Of** Sauron + +Here are some pictures of the Eye of Sauron! + +Just the photo. + +[[/Mordor/eye.jpg]] + +With alt. + +[[/Mordor/eye.jpg|alt=Eye of Sauron]] + +With frame and caption. + +[[/Mordor/eye.jpg|frame|alt=Eye of Sauron]] + +Align left. + +[[/Mordor/eye.jpg|align=left]] + +Alight center. + +[[/Mordor/eye.jpg|align=center]] + +Alight right. + +[[/Mordor/eye.jpg|align=right]] + +Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas interdum velit eu justo rutrum vitae semper urna porttitor. Sed viverra bibendum tincidunt. Curabitur vel mi sed nisl vestibulum lobortis eu ac nisl. Morbi fringilla adipiscing felis. Mauris luctus interdum accumsan. Integer leo mauris, dapibus a sollicitudin non, varius non erat. Donec eu dictum orci. Morbi viverra eleifend felis, et adipiscing neque consequat a. Vestibulum accumsan ligula suscipit mi rhoncus ac gravida lectus tincidunt. Donec interdum, [[/Mordor/eye.jpg|float|frame|alt=FIRE FIRE FIRE]] lorem sed interdum molestie, est ipsum pharetra est, sit amet eleifend purus eros at ligula. Aliquam erat volutpat. Sed dignissim interdum ipsum, et pulvinar lectus faucibus et. Ut at lacus risus, non lobortis erat. Proin malesuada sagittis mauris, in posuere turpis tincidunt eu. Nunc accumsan, ligula ut rutrum aliquet, neque metus suscipit ligula, in aliquam augue velit vel orci. Aliquam diam lectus, posuere id faucibus sed, aliquam vel erat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas interdum velit eu justo rutrum vitae semper urna porttitor. Sed viverra bibendum tincidunt. Curabitur vel mi sed nisl vestibulum lobortis eu ac nisl. Morbi fringilla adipiscing felis. Mauris luctus interdum accumsan. Integer leo mauris, dapibus a sollicitudin non, varius non erat. Donec eu dictum orci. [[/Mordor/eye.jpg|float|align=right]] Morbi viverra eleifend felis, et adipiscing neque consequat a. Vestibulum accumsan ligula suscipit mi rhoncus ac gravida lectus tincidunt. Donec interdum, lorem sed interdum molestie, est ipsum pharetra est, sit amet eleifend purus eros at ligula. Aliquam erat volutpat. Sed dignissim interdum ipsum, et pulvinar lectus faucibus et. Ut at lacus risus, non lobortis erat. Proin malesuada sagittis mauris, in posuere turpis tincidunt eu. Nunc accumsan, ligula ut rutrum aliquet, neque metus suscipit ligula, in aliquam augue velit vel orci. Aliquam diam lectus, posuere id faucibus sed, aliquam vel erat. + +Smaller width. + +[[/Mordor/eye.jpg|width=100px]] + +Smaller height. + +[[/Mordor/eye.jpg|height=100px]] diff --git a/test/examples/lotr/Mordor/_Footer.md b/test/examples/lotr/Mordor/_Footer.md new file mode 100644 index 00000000..9697dc65 --- /dev/null +++ b/test/examples/lotr/Mordor/_Footer.md @@ -0,0 +1 @@ +Ones does not simply **walk** into Mordor! diff --git a/test/examples/lotr/Mordor/_Sidebar.md b/test/examples/lotr/Mordor/_Sidebar.md new file mode 100644 index 00000000..9697dc65 --- /dev/null +++ b/test/examples/lotr/Mordor/_Sidebar.md @@ -0,0 +1 @@ +Ones does not simply **walk** into Mordor! diff --git a/test/examples/lotr/Mordor/eye.jpg b/test/examples/lotr/Mordor/eye.jpg new file mode 100644 index 00000000..714323c1 Binary files /dev/null and b/test/examples/lotr/Mordor/eye.jpg differ diff --git a/test/examples/lotr/Mordor/todo.txt b/test/examples/lotr/Mordor/todo.txt new file mode 100644 index 00000000..0ade1e29 --- /dev/null +++ b/test/examples/lotr/Mordor/todo.txt @@ -0,0 +1 @@ +[ ] Write section on Ents diff --git a/test/examples/lotr/My-Precious.md b/test/examples/lotr/My-Precious.md new file mode 100644 index 00000000..aab61fe8 --- /dev/null +++ b/test/examples/lotr/My-Precious.md @@ -0,0 +1 @@ +One ring to rule them all! diff --git a/test/examples/lotr/_Footer.md b/test/examples/lotr/_Footer.md new file mode 100644 index 00000000..ecda3205 --- /dev/null +++ b/test/examples/lotr/_Footer.md @@ -0,0 +1 @@ +Lord of the Rings wiki \ No newline at end of file diff --git a/test/examples/lotr/_Sidebar.md b/test/examples/lotr/_Sidebar.md new file mode 100644 index 00000000..ecda3205 --- /dev/null +++ b/test/examples/lotr/_Sidebar.md @@ -0,0 +1 @@ +Lord of the Rings wiki \ No newline at end of file diff --git a/test/static/default/Bilbo-Baggins.html b/test/static/default/Bilbo-Baggins.html new file mode 100644 index 00000000..9dd2c777 --- /dev/null +++ b/test/static/default/Bilbo-Baggins.html @@ -0,0 +1,41 @@ + + + + + + + Bilbo Baggins + + + +
+
+
+
+
+

Bilbo Baggins

+ +

Bilbo Baggins is the protagonist of The Hobbit and also makes a few +appearances in The Lord of the Rings, two of the most well-known of J. R. R. +Tolkien's fantasy writings. The story of The Hobbit featuring Bilbo is also +retold from a different perspective in the Chapter The Quest of Erebor in +Unfinished Tales.

+ +

In Tolkien's narrative conceit, in which all the writings of Middle-earth are +'really' translations from the fictitious volume of The Red Book of Westmarch, +Bilbo is the author of The Hobbit and translator of The Silmarillion.

+ +

From http://en.wikipedia.org/wiki/Bilbo_Baggins.

+
+
+
+ +
+ +
+ + + + diff --git a/test/static/default/Eye-Of-Sauron.html b/test/static/default/Eye-Of-Sauron.html new file mode 100644 index 00000000..6619be30 --- /dev/null +++ b/test/static/default/Eye-Of-Sauron.html @@ -0,0 +1,65 @@ + + + + + + + Eye Of Sauron + + + +
+
+
+
+
+

Eye Of Sauron

+ +

Here are some pictures of the Eye of Sauron!

+ +

Just the photo.

+ +

+ +

With alt.

+ +

Eye of Sauron

+ +

With frame and caption.

+ +

Eye of SauronEye of Sauron

+ +

Align left.

+ +

+ +

Alight center.

+ +

+ +

Alight right.

+ +

+ +

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas interdum velit eu justo rutrum vitae semper urna porttitor. Sed viverra bibendum tincidunt. Curabitur vel mi sed nisl vestibulum lobortis eu ac nisl. Morbi fringilla adipiscing felis. Mauris luctus interdum accumsan. Integer leo mauris, dapibus a sollicitudin non, varius non erat. Donec eu dictum orci. Morbi viverra eleifend felis, et adipiscing neque consequat a. Vestibulum accumsan ligula suscipit mi rhoncus ac gravida lectus tincidunt. Donec interdum, FIRE FIRE FIREFIRE FIRE FIRE lorem sed interdum molestie, est ipsum pharetra est, sit amet eleifend purus eros at ligula. Aliquam erat volutpat. Sed dignissim interdum ipsum, et pulvinar lectus faucibus et. Ut at lacus risus, non lobortis erat. Proin malesuada sagittis mauris, in posuere turpis tincidunt eu. Nunc accumsan, ligula ut rutrum aliquet, neque metus suscipit ligula, in aliquam augue velit vel orci. Aliquam diam lectus, posuere id faucibus sed, aliquam vel erat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas interdum velit eu justo rutrum vitae semper urna porttitor. Sed viverra bibendum tincidunt. Curabitur vel mi sed nisl vestibulum lobortis eu ac nisl. Morbi fringilla adipiscing felis. Mauris luctus interdum accumsan. Integer leo mauris, dapibus a sollicitudin non, varius non erat. Donec eu dictum orci. Morbi viverra eleifend felis, et adipiscing neque consequat a. Vestibulum accumsan ligula suscipit mi rhoncus ac gravida lectus tincidunt. Donec interdum, lorem sed interdum molestie, est ipsum pharetra est, sit amet eleifend purus eros at ligula. Aliquam erat volutpat. Sed dignissim interdum ipsum, et pulvinar lectus faucibus et. Ut at lacus risus, non lobortis erat. Proin malesuada sagittis mauris, in posuere turpis tincidunt eu. Nunc accumsan, ligula ut rutrum aliquet, neque metus suscipit ligula, in aliquam augue velit vel orci. Aliquam diam lectus, posuere id faucibus sed, aliquam vel erat.

+ +

Smaller width.

+ +

+ +

Smaller height.

+ +

+
+
+
+ +
+ +
+ + + + diff --git a/test/static/default/My-Precious.html b/test/static/default/My-Precious.html new file mode 100644 index 00000000..588bc404 --- /dev/null +++ b/test/static/default/My-Precious.html @@ -0,0 +1,29 @@ + + + + + + + My Precious + + + +
+
+
+
+
+

One ring to rule them all!

+
+
+
+ +
+ +
+ + + + diff --git a/test/static/default/css/gollum.css b/test/static/default/css/gollum.css new file mode 100644 index 00000000..627d98ef --- /dev/null +++ b/test/static/default/css/gollum.css @@ -0,0 +1,408 @@ +/* + gollum.css + A basic stylesheet for Gollum +*/ + +/* @section core */ +body, html { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 10px; /* -> 1em */ + margin: 0; + padding: 0; +} + +#wiki-wrapper { + margin: 0 auto; + overflow: visible; + width: 80%; +} + +a:link { + color: #4183c4; + text-decoration: none; +} + +a:hover, a:visited { + text-decoration: underline; +} + + +/* @section head */ +#head { + border-bottom: 1px solid #ccc; + margin: 4.5em 0 0.5em; + padding: 0.5em 0; + overflow: hidden; +} + + #head h1 { + font-size: 3.3em; + float: left; + line-height: normal; + margin: 0; + padding: 0.08em 0 0 0; + } + + #head ul.actions { + float: right; + } + + +/* @section content */ +#wiki-content { + height: 1%; + overflow: visible; +} + + #wiki-content .wrap { + height: 1%; + overflow: auto; + } + + /* @section comments */ + #wiki-body #inline-comment { + display: none; /* todo */ + } + + /* @section body */ + #wiki-body { + float: left; + margin-right: 3%; + width: 70%; + } + + /* @section rightbar */ + #wiki-rightbar { + float: right; + width: 27%; + } + + #wiki-rightbar #nav { + background-color: #f7f7f7; + border: 1px solid #ddd; + margin-top: 1.5em; + padding: 1em; + + border-radius: 0.5em; + -moz-border-radius: 0.5em; + -webkit-border-radius: 0.5em; + } + + #wiki-rightbar #nav { + font-size: 1.2em; + line-height: 1.5em; + } + + #wiki-rightbar #nav p.parent { + border-bottom: 1px solid #bbb; + font-weight: bold; + margin: 0 0 0.5em 0; + padding: 0 0 0.5em 0; + text-shadow: 0 1px 0 #fff; + } + + /* Back arrow */ + #wiki-rightbar #nav p.parent:before { + color: #666; + content: "← "; + } + + #wiki-rightbar #nav h3 { + font-size: 1.2em; + color: #333; + margin: 1.2em 0 0; + padding: 0; + text-shadow: 0 1px 0 #fff; + } + + #wiki-rightbar #nav ul { + margin: 0.5em 0 1em; + padding: 0; + } + + #wiki-rightbar #nav ul li { + color: #bbb; + list-style-position: outside; + list-style-type: none; + margin: 0 0 0 1em; + padding: 0; + line-height: 1.75em; + } + + #wiki-rightbar #nav ul li:hover { + list-style-type: square; + } + + #wiki-rightbar #nav ul li a { + font-weight: bold; + text-shadow: 0 1px 0 #fff; + } + + /* @section footer */ + #wiki-footer { + clear: both; + margin: 2em 0 5em; + } + + .has-rightbar #wiki-footer { + width: 70%; + } + + #wiki-footer #footer-content { + background-color: #f7f7f7; + border: 1px solid #ddd; + font-size: 1.2em; + line-height: 1.5em; + margin-top: 1.5em; + padding: 1em; + + border-radius: 0.5em; + -moz-border-radius: 0.5em; + -webkit-border-radius: 0.5em; + } + + #wiki-footer #footer-content h3 { + font-size: 1.2em; + color: #333; + margin: 0; + padding: 0 0 0.2em; + text-shadow: 0 1px 0 #fff; + } + + #wiki-footer #footer-content p { + margin: 0.5em 0 0; + padding: 0; + } + + #wiki-footer #footer-content ul.links { + margin: 0.5em 0 0; + overflow: hidden; + padding: 0; + } + + #wiki-footer #footer-content ul.links li { + color: #999; + float: left; + list-style-position: inside; + list-style-type: square; + padding: 0; + margin-left: 0.75em; + } + + #wiki-footer #footer-content ul.links li a { + font-weight: bold; + text-shadow: 0 1px 0 #fff; + } + + #wiki-footer #footer-content ul.links li:first-child { + list-style-type: none; + margin: 0; + } + + .ff #wiki-footer #footer-content ul.links li:first-child { + margin: 0 -0.75em 0 0; + } + + /* @section page-footer */ + .page #footer { + border-top: 1px solid #ccc; + margin: 1em 0 7em; + } + + #footer p#last-edit { + font-size: 1.2em; + line-height: 1.6em; + color: #999; + margin: 0.9em 0; + } + + #footer p#last-edit span.username { + font-weight: bold; + } + + +/* @section history */ +.history h1 { + color: #999; + font-weight: normal; +} + + .history h1 strong { + color: #000; + font-weight: bold; + } + +#wiki-history { + margin-top: 3em; +} + + #wiki-history fieldset { + border: 0; + margin: 2em 0; + padding: 0; + } + + #wiki-history table, #wiki-history tbody { + border-collapse: collapse; + padding: 0; + margin: 0; + width: 100%; + } + + #wiki-history table tr { + padding: 0; + margin: 0; + } + + #wiki-history table tr { + background-color: #ebf2f6; + } + + #wiki-history table tr td { + border: 1px solid #c0dce9; + font-size: 1.2em; + line-height: 1.6em; + margin: 0; + padding: 0.3em 0.7em; + } + + #wiki-history table tr td.checkbox { + padding: 0.3em; + } + + #wiki-history table tr td.checkbox input { + cursor: pointer; + display: block; + padding-right: 0; + padding-top: 0.4em; + margin-right: -0.2em; + } + + #wiki-history table tr:nth-child(2n), + #wiki-history table tr.alt-row { + background-color: #f3f7fa; + } + + #wiki-history table tr.selected { + background-color: #ffffea !important; + z-index: 100; + } + + #wiki-history table tr td.commit-name { + border-right: none; + } + + #wiki-history table tr td.commit-name span.time-elapsed { + color: #999; + } + + #wiki-history table tr td.author { + width: 20%; + } + + #wiki-history table tr td.author a { + color: #000; + font-weight: bold; + } + + #wiki-history table tr td.author a span.username { + display: block; + padding-top: 3px; + } + + #wiki-history table tr td img { + background-color: #fff; + border: 1px solid #999; + display: block; + float: left; + height: 18px; + overflow: hidden; + margin: 0 0.5em 0 0; + width: 18px; + padding: 2px; + } + + #wiki-history table tr td.commit-name a { + font-size: 0.9em; + font-family: 'Monaco', 'Andale Mono', Consolas, 'Courier New', monospace; + padding: 0 0.2em; + } + + #wiki-history table tr td.revert-action { + border-left: 0; + text-align: right; + } + + #wiki-history table tr td.revert-action a { + font-weight: bold; + } + + #wiki-history table tr td.revert-action a span { + font-size: 0.9em; + font-family: 'Monaco', 'Andale Mono', Consolas, 'Courier New', monospace; + } + +.history #wiki-history ul.actions li, +.history #footer ul.actions li { + margin: 0 0.6em 0 0; +} + + +/* @section edit */ +.edit h1 { + color: #999; + font-weight: normal; +} + + .edit h1 strong { + color: #000; + font-weight: bold; + } + + + +/* @control minibutton */ +ul.actions { + display: block; + list-style-type: none; + overflow: hidden; + padding: 0; + } + + ul.actions li { + float: left; + font-size: 1.2em; + margin-left: 0.6em; + } + +.minibutton a { + background-color: #f7f7f7; + border: 1px solid #d4d4d4; + color: #333; + display: block; + font-weight: bold; + margin: 0; + padding: 0.4em 1em; + + text-shadow: 0 1px 0 #fff; + + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#f4f4f4', endColorstr='#ececec'); + background: -webkit-gradient(linear, left top, left bottom, from(#f4f4f4), to(#ececec)); + background: -moz-linear-gradient(top, #f4f4f4, #ececec); + + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} + +.minibutton a:hover { + background: #3072b3; + border-color: #518cc6 #518cc6 #2a65a0; + color: #fff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3); + text-decoration: none; + + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#599bdc', endColorstr='#3072b3'); + background: -webkit-gradient(linear, left top, left bottom, from(#599bdc), to(#3072b3)); + background: -moz-linear-gradient(top, #599bdc, #3072b3); +} \ No newline at end of file diff --git a/test/static/default/css/template.css b/test/static/default/css/template.css new file mode 100644 index 00000000..882877ff --- /dev/null +++ b/test/static/default/css/template.css @@ -0,0 +1,146 @@ +/* + template.css + Wiki content formatting + Keeping this file separate so it can be easily swapped out if you + want to format your wiki content differently from the default. +*/ + +#template { + margin-bottom: 4em; /* Give it some breathing room */ +} + +.has-footer #template { + margin: 0; +} + +#template p { + font-size: 1.4em; + line-height: 1.6em; +} + + /* See http://webtypography.net/Rhythm_and_Proportion/ */ + #template p + p { + margin: -0.75em 0 0; + text-indent: 1em; + } + + /* Everybody loves type ornaments */ + #template p:last-child:after { + color: #999; + content: " ❈"; + font-size: 0.8em; + } + + #template blockquote p:last-child:after { + content: none; + } + +#template a:link { + color: #4183c4; + text-decoration: none; +} + +#template a:hover, #template a:visited { + text-decoration: underline; +} + +#template ul, #template ol { + margin: 1.0em 0 0 2.0em; + list-style-position: outside; + padding: 0; + +} + +#template p + ul, #template p + ol, +#template ul li > ul, #template ol li > ol { + margin-top: 0; +} + +#template ul li > ul, #template ol li > ol { + margin-left: 0; +} + + #template ul { + list-style-type: square; + } + + #template ol li > ol li { + font-size: 1.0em !important; + list-style-type: lower-roman; + list-style-position: inside; + } + + #template ol li > ol li > ol li { + list-style-type: lower-alpha; + } + + #template ol li > ol li > ol li > ol li { + list-style-type: lower-greek; + } + +#template ul li, #template ol li { + font-size: 1.4em; + line-height: 1.6em; + padding-top: 0.1em; /* Line up ordinals */ +} + +#template blockquote { + margin: 0 4.0em 0 2.0em; + padding: 0; +} + + #template blockquote p { + color: #888; + font-style: italic; + } + + +/* Headings */ +#template h1, #template h2, #template h3, +#template h4, #template h5, #template h6 { + margin: 0; + padding: 0.5em 0 0; +} + +#template h1 { + font-size: 2.6em; + font-weight: bold; +} + +#template h2 { + font-size: 2.2em; + font-weight: bold; +} + +#template h3 { + font-size: 2.0em; + font-weight: bold; +} + +#template h4 { + font-size: 1.8em; + font-weight: bold; +} + +#template h5 { + font-size: 1.6em; + font-weight: bold; + +} + +#template h6 { + font-size: 1.4em; + font-weight: bold; + margin-top: 1.0em; + text-transform: uppercase; /* all caps */ +} + + +/* Code-related */ +#template p code { + background-color: #f7f7f7; + border: 1px solid #ddd; + color: #222; /* This is a little heavy when #000 */ + font-family: Consolas, Monaco, "Courier New", monospace; + padding: 0.15em 0.3em; +} \ No newline at end of file diff --git a/test/static/default/index.html b/test/static/default/index.html new file mode 100644 index 00000000..58d42871 --- /dev/null +++ b/test/static/default/index.html @@ -0,0 +1,30 @@ + + + + + + + The LOTR Wiki + + + +
+
+
+
+
+

The LOTR Wiki

+

This wiki is awesome. You can learn about Bilbo Baggins or some evil stuff.

+
+
+
+ +
+ +
+ + + + diff --git a/test/test_git_access.rb b/test/test_git_access.rb index ef13fbeb..ceb24cc6 100644 --- a/test/test_git_access.rb +++ b/test/test_git_access.rb @@ -25,9 +25,9 @@ context "GitAccess" do assert @access.ref_map.empty? assert @access.tree_map.empty? @access.tree 'master' - assert_equal({"master"=>"60f12f4254f58801b9ee7db7bca5fa8aeefaa56b"}, @access.ref_map) + assert_equal({"master"=>"a8ad3c09dd842a3517085bfadd37718856dee813"}, @access.ref_map) - map = @access.tree_map['60f12f4254f58801b9ee7db7bca5fa8aeefaa56b'] + map = @access.tree_map['a8ad3c09dd842a3517085bfadd37718856dee813'] assert_equal 'Bilbo-Baggins.md', map[0].path assert_equal '', map[0].dir assert_equal map[0].path, map[0].name diff --git a/test/test_page.rb b/test/test_page.rb index 1316c713..ed2e7d5b 100644 --- a/test/test_page.rb +++ b/test/test_page.rb @@ -109,6 +109,25 @@ context "Page" do test "footer itself" do footer = @wiki.page("_Footer") assert_nil footer.footer + assert_nil footer.sidebar + end + + test "top level sidebar" do + sidebar = @wiki.page('Home').sidebar + assert_equal 'Lord of the Rings wiki', sidebar.raw_data + assert_equal '_Sidebar.md', sidebar.path + end + + test "nested sidebar" do + sidebar = @wiki.page('Eye Of Sauron').sidebar + assert_equal "Ones does not simply **walk** into Mordor!\n", sidebar.raw_data + assert_equal "Mordor/_Sidebar.md", sidebar.path + end + + test "sidebar itself" do + sidebar = @wiki.page("_Sidebar") + assert_nil sidebar.footer + assert_nil sidebar.sidebar end test "cannot convert non string to human readable page title" do