Skip to content
Browse files

gitfaq: use mediawiki compatible gitlink format

Mediawiki removes all HTML comments from the expanded article text
[1]. It is therefore not possible to use the <!-- Gitlink[hint]
description --> format at the new git wiki on
http://git.wiki.kernel.org/.

Instead, use a format similar to the {{anchor}} template:

 <span id="hint" title="description">

The wiki will define a corresponding template which can be used as
follows.

== FAQ entry {{Gitlink|hint|description}} ==

[1] http://meta.wikimedia.org/wiki/Help:Comment_tags

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
  • Loading branch information...
1 parent 77bbb15 commit 4a394d0c7199e2124da9777e9983d85b3f07d904 @drizzd drizzd committed
Showing with 6 additions and 6 deletions.
  1. +2 −2 plugins/gitfaq.rb
  2. +4 −4 test/faq-test.html
View
4 plugins/gitfaq.rb
@@ -37,7 +37,7 @@ def load_entries
begin
a = open(FAQ_URL).read
@new_entries = {}
- a.scan(/<!-- GitLink\[(.*)\] (.*) -->/) do |x|
+ a.scan(/<span id="(.*)" title="(.*)">/) do |x|
@new_entries[x[0]] = x[1]
end
@entries = @new_entries
@@ -84,4 +84,4 @@ def hook_privmsg_chan(irc, msg)
handle_faq(irc, msg, page)
end
-end
+end
View
8 test/faq-test.html
@@ -1,10 +1,10 @@
<html><body>
- <!-- GitLink[ssh-config] You can setup a new entry in ~/.ssh/config with the right key -->
+ <span id="ssh-config" title="You can setup a new entry in ~/.ssh/config with the right key"></span>
<a href='#ssh-config'></a>
- <!-- GitLink[push-f] If you use push -f, others might get into problem when pulling -->
+ <span id="push-f" title="If you use push -f, others might get into problem when pulling"></span>
<a href='#push-f'></a>
- <!-- GitLink[non-bare] You shouldn't push to a non-bare repository -->
+ <span id="non-bare" title="You shouldn't push to a non-bare repository"></span>
<a href='#non-bare'></a>
- <!-- GitLink[space command] this is an entry with a space in it -->
+ <span id="space command" title="this is an entry with a space in it"></span>
<a href='#space command'></a>
</body></html>

0 comments on commit 4a394d0

Please sign in to comment.
Something went wrong with that request. Please try again.