Merge commit 'giskard/master'
authorBernie Innocenti <bernie@codewiz.org>
Wed, 19 Aug 2009 10:11:20 +0000 (12:11 +0200)
committerBernie Innocenti <bernie@codewiz.org>
Wed, 19 Aug 2009 10:11:20 +0000 (12:11 +0200)
Conflicts:
sys/footer

12 files changed:
EditPage [deleted file]
FindPage
GeekiGeeki
Pictures
WikiSandBox2 [new file with mode: 0644]
sys/EditPage [new file with mode: 0644]
sys/footer
sys/macros/CgiVar.py [new file with mode: 0644]
sys/macros/HttpGet.py [new file with mode: 0644]
sys/macros/HttpPost.py [new file with mode: 0644]
sys/macros/TitleIndex.py [new file with mode: 0644]
sys/macros/WordIndex.py [new file with mode: 0644]

diff --git a/EditPage b/EditPage
deleted file mode 100644 (file)
index 56bcf98..0000000
--- a/EditPage
+++ /dev/null
@@ -1,16 +0,0 @@
-**Editing <<HttpGet|edit>> for <<CgiVar|REMOTE_USER>> from <<CgiVar|REMOTE_HOST>>**
-<div class="editor">
-<form method="post" enctype="multipart/form-data" action="<<CgiVar|QUERY_STRING>>" >
-<input type="hidden" name="edit2" value="<<HttpGet|edit2>>">
-<textarea wrap="off" spellcheck="true" id="editor" name="savetext" rows="17" cols="100"><<HttpPost|savetext>></textarea>
-Or upload a file: <input type="file" name="file" value="<<HttpPost|file>>" />
-\\
-<input type="submit" name="save" value="Save" />
-<input type="submit" name="preview" value="Preview" />
-<input type="reset" value="Reset" />
-<input type="submit" name="cancel" value="Cancel" />
-\\
-</form></div>
-[[EditingTips]]
-
-<<HttpPost|savetext>>
index 71543eb098e2b40bf346ed4d3fb05b634c882c5c..0e9edba520befc55fa36081a3fb6af48bb7791f8 100644 (file)
--- a/FindPage
+++ b/FindPage
@@ -9,14 +9,16 @@ Here are some good starting points for browsing:
 Here's a title search.  Try something like //wiki//:
 
  <form method="get">
-   <input name="titlesearch" size="30" value="<<HttpGet|search>>" />
+   <input name="q" size="30" value="<<HttpGet|search|>>" />
+   <input type="hidden" name="a" value="titlesearch" />
    <input type="submit" value="Search" />
  </form>
 
 Here's a full-text search:
 
  <form method="get">
-   <input name="fullsearch" size="30" value="<<HttpGet|search>>" />
+   <input name="q" size="30" value="<<HttpGet|search|>>" />
+   <input type="hidden" name="a" value="fullsearch" />
    <input type="submit" value="Search" />
  </form>
 
index 425731c89141e53449f2dd01758586e386284495..bfbaa955708ab8618db6e1ea6f7367302e9f476c 100644 (file)
@@ -1,6 +1,6 @@
-== Geeki Geeki, the Stupid Stupid Wiki Wiki ==
+<div style="float: right">{{GerryStich.png}}</div>
 
-<div style="float: right">GerryStich.png</div>
+== Geeki Geeki, the Stupid Stupid Wiki Wiki ==
 
 GeekiGeeki is a minimalistic wiki with a [[http://git.or.cz/ | Git]]
 backend, a high features/complexity ratio and a clean syntax.
@@ -66,7 +66,7 @@ git clone git://www.codewiz.org/~bernie/geekigeeki.git/
 
 ===== Revision history =====
 
-Browse it online with GitWeb: http://www.codewiz.org/wikigit/geekigeeki.git
+Browse it with [[http://www.codewiz.org/wikigit/geekigeeki.git|GitWeb]]
 
 ===== Individual source files =====
 
index 6ed69abe5cfc6dfd686a0a445a190b5bfdb811cd..bde13e014014794076af1ffd99e85eb9c93d16a3 120000 (symlink)
--- a/Pictures
+++ b/Pictures
@@ -1 +1 @@
-../../../Pictures/
\ No newline at end of file
+../../../Pictures
\ No newline at end of file
diff --git a/WikiSandBox2 b/WikiSandBox2
new file mode 100644 (file)
index 0000000..887ae93
--- /dev/null
@@ -0,0 +1 @@
+ciao
diff --git a/sys/EditPage b/sys/EditPage
new file mode 100644 (file)
index 0000000..bd84e30
--- /dev/null
@@ -0,0 +1,22 @@
+**Editing <<HttpGet|q>> for <<CgiVar|REMOTE_USER>> from <<CgiVar|REMOTE_HOST>>**
+<div class="editor">
+<form method="post" enctype="multipart/form-data" action="<<HttpGet|q>>" >
+<input type="hidden" name="a" value="edit">
+<input type="hidden" name="q" value="<<HttpGet|q>>">
+<input type="input" id="editor" name="changelog" value="Edit page <<HttpGet|q>>" accesskey="c" />
+\\
+<textarea wrap="off" spellcheck="true" id="editor" name="savetext" rows="17" cols="100" accesskey="e"><<EDIT_BODY>></textarea>
+<label for="file" accesskey="u">Or upload a file:</label> <input type="file" name="file" value="<<HttpPost|file>>" />
+\\
+<input type="submit" name="save" value="Save" accesskey="s" />
+<input type="submit" name="preview" value="Preview" accesskey="p" />
+<input type="reset" value="Reset" />
+<input type="submit" name="cancel" value="Cancel" />
+\\
+</form></div>
+
+<script language="javascript">
+document.editform.savetext.focus()
+</script>
+
+[[EditingTips]]
index f20e48bb105e6362694cfe01290b69a75cb739e8..7500dbad4fb151e2b26d1a802298187b41f4b67d 100644 (file)
@@ -1,7 +1,8 @@
 <div id="footer"><hr />
 <p class="copyright">
-<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/"><img class="license" alt="Creative Commons License" src="%s" /></a>
-<span class="benchmark">generated in FIXME</span> by <a href="http://www.codewiz.org/wiki/GeekiGeeki">GeekiGeeki</a> version FIXME 
+[[http://creativecommons.org/licenses/by-sa/3.0/|sys/cc-by-sa.png|Creative Commons License|rel=license]]
+<span class="benchmark">generated in <<ELAPSED_TIME>>s</span>
+by [[http://www.codewiz.org/wiki/GeekiGeeki|GeekiGeeki]] version <<VERSION>>
 </p>
-<p class="modified">last modified %s</p>
-</div></body></html>
+<p class="modified">last modified <<LAST_MODIFIED>></p>
+</div>
diff --git a/sys/macros/CgiVar.py b/sys/macros/CgiVar.py
new file mode 100644 (file)
index 0000000..c2ba707
--- /dev/null
@@ -0,0 +1,9 @@
+#acl bernie:read,write All:read
+
+def _macro_CgiVar(*args, **kvargs):
+    return {
+        'REMOTE_USER': remote_user(),
+        'REMOTE_HOST': get_hostname(remote_host()),
+        'REMOTE_ADDR': remote_host(),
+        'QUERY_STRING': relative_url(query_string()),
+    }[args[1]]
diff --git a/sys/macros/HttpGet.py b/sys/macros/HttpGet.py
new file mode 100644 (file)
index 0000000..dfe1dfb
--- /dev/null
@@ -0,0 +1,8 @@
+#acl bernie:read,write All:read
+
+def _macro_HttpGet(*args, **kvargs):
+    if args[1] in form:
+        return form[args[1]].value
+    elif len(args) > 2:
+        return args[2] # default value
+    raise Exception("Undefined argument " + args[1])
diff --git a/sys/macros/HttpPost.py b/sys/macros/HttpPost.py
new file mode 100644 (file)
index 0000000..fbe277a
--- /dev/null
@@ -0,0 +1,8 @@
+#acl bernie:read,write All:read
+
+def _macro_HttpPost(*args, **kvargs):
+    if args[1] in form:
+        return form[argv[1]].value
+    elif len(args) > 2:
+        return args[2] # default value
+    raise Exception("Undefined argument " + args[1])
diff --git a/sys/macros/TitleIndex.py b/sys/macros/TitleIndex.py
new file mode 100644 (file)
index 0000000..9f5c25b
--- /dev/null
@@ -0,0 +1,16 @@
+#acl bernie:read,write All:read
+
+def _macro_TitleIndex(*args, **kvargs):
+    s = make_index_key()
+    pages = list(page_list())
+    pages.sort()
+    current_letter = None
+    for name in pages:
+        letter = name[0].lower()
+        if letter != current_letter:
+            s += '<a name="%s"><h3>%s</h3></a>' % (letter, letter)
+            current_letter = letter
+        else:
+            s += '<br />'
+        s += link_tag(name)
+    return s
diff --git a/sys/macros/WordIndex.py b/sys/macros/WordIndex.py
new file mode 100644 (file)
index 0000000..635ef6b
--- /dev/null
@@ -0,0 +1,33 @@
+#acl bernie:read,write All:read
+
+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