Skip to content

Commit 6850e94

Browse files
committed
Replace BlueCloth by rtomayko's RDiscount
Also tweaks the README a bit
1 parent ad04791 commit 6850e94

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

README.markdown

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ git-wiki is a wiki that relies on git to keep pages' history
55
and [Sinatra][] to serve them.
66

77
I wrote git-wiki as a quick and dirty hack, mostly to play with Sinatra.
8-
It turned out that Sinatra is an awesome little web framework and that this hack
9-
isn't as useless as I first though since I now use it daily.
8+
It turned out that Sinatra is an awesome little web framework and that this
9+
hack isn't as useless as I first though since I now use it daily.
1010

1111
However, it is definitely not feature rich and will probably never be because
1212
I mostly use it as a web frontend for `git`, `ls` and `vim`.
@@ -19,12 +19,10 @@ especially [al3x][]'s one.
1919

2020
The fellowing [gems][] are required to run git-wiki:
2121

22-
- sinatra
23-
- mojombo-grit
24-
- haml
25-
- git
26-
- BlueCloth
27-
- rubypants
22+
- [Sinatra][]
23+
- [mojombo-grit](http://github.com/mojombo/grit)
24+
- [HAML](http://haml.hamptoncatlin.com)
25+
- [RDiscount](http://github.com/rtomayko/rdiscount)
2826

2927
Run with `mkdir ~/wiki && ./run.ru -sthin -p4567` and point your
3028
browser at <http://0.0.0.0:4567/>. Enjoy!
@@ -84,8 +82,8 @@ then sync your changes back when you're done.</p>
8482
Git is the next Unix</a></cite></p>
8583
</blockquote>
8684

87-
[Sinatra]: http://sinatrarb.com
85+
[Sinatra]: http://www.sinatrarb.com
8886
[GitHub]: http://github.com/sr/git-wiki
8987
[forks]: http://github.com/sr/git-wiki/network
90-
[al3x]: http://github.com/al3x/github
88+
[al3x]: http://github.com/al3x/gitwiki
9189
[gems]: http://www.rubygems.org/

git-wiki.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
require "sinatra/base"
55
require "grit"
6-
require "bluecloth"
6+
require "rdiscount"
77

88
module GitWiki
99
class << self
@@ -77,8 +77,7 @@ def initialize(blob)
7777
end
7878

7979
def to_html
80-
linked = auto_link(wiki_link(content))
81-
BlueCloth.new(linked).to_html
80+
RDiscount.new(wiki_link(content)).to_html
8281
end
8382

8483
def to_s
@@ -119,10 +118,6 @@ def commit_message
119118
new? ? "Created #{name}" : "Updated #{name}"
120119
end
121120

122-
def auto_link(str)
123-
str.gsub(/<((https?|ftp|irc):[^'">\s]+)>/xi, %Q{<a href="\\1">\\1</a>})
124-
end
125-
126121
def wiki_link(str)
127122
str.gsub(/([A-Z][a-z]+[A-Z][A-Za-z0-9]+)/) { |page|
128123
%Q{<a class="#{self.class.css_class_for(page)}"} +

0 commit comments

Comments
 (0)