Skip to content

Commit

Permalink
gitfaq: use mediawiki compatible gitlink format
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Clemens Buchacher committed Mar 14, 2010
1 parent 77bbb15 commit 4a394d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions plugins/gitfaq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -84,4 +84,4 @@ def hook_privmsg_chan(irc, msg)
handle_faq(irc, msg, page)
end

end
end
8 changes: 4 additions & 4 deletions test/faq-test.html
Original file line number Diff line number Diff line change
@@ -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.