Move macros into the wiki
[geekigeeki.git] / macros / WordIndex.py
diff --git a/macros/WordIndex.py b/macros/WordIndex.py
deleted file mode 100644 (file)
index b64a317..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-def _macro_WordIndex(*args, **kvargs):
-    s = make_index_key()
-    pages = list(page_list())
-    map = {}
-    word_re = re.compile('[A-Z][a-z]+')
-    for name in pages:
-        for word in word_re.findall(name):
-            try:
-                map[word].append(name)
-            except KeyError:
-                map[word] = [name]
-
-    all_words = list(map.keys())
-    all_words.sort()
-    last_letter = None
-    # set title
-    for word in all_words:
-        letter = word[0].lower()
-        if letter != last_letter:
-            s += '<a name="%s"><h3>%s</h3></a>' % (letter, letter)
-            last_letter = letter
-
-        s += '<b>%s</b><ul>' % word
-        links = map[word]
-        links.sort()
-        last_page = None
-        for name in links:
-            if name == last_page: continue
-            s += '<li>' + link_tag(name) + '</li>'
-        s += '</ul>'
-    return s