data_dir = '/home/bernie/public_html/wiki/data'
-css_url = ['../wikidata/geekigeeki.css'] # optional stylesheet links
+# default page links
+icon_url = 'hacker-favicon.ico'
+css_url = ['../wikidata/geekigeeki.css']
+
history_url = '../wikigit/wiki.git'
post_edit_hook = './post_edit_hook.sh'
datetime_fmt = '%a %d %b %Y %I:%M %p'
-allow_edit = True # Is it possible to edit pages?
-show_hosts = True # show hostnames?
-nonexist_pfx = '' # prefix before nonexistent link (usually '?')
-image_maxwidth = 800 # maximum image width in pixels
-debug_cgi = False # Set to True for CGI var dump
+
+# Is it possible to edit pages?
+allow_edit = True
+
+# show hostnames?
+show_hosts = True
+
+# prefix before nonexistent link (usually '?')
+nonexist_pfx = ''
+
+# maximum image width in pixels
+image_maxwidth = 800
+
+# Set to True for CGI var dump
+debug_cgi = False
word_re = re.compile(r"^\b((([A-Z][a-z0-9]+){2,}/)*([A-Z][a-z0-9]+){2,})\b$")
# FIXME: we accept stuff like foo/../bar and we shouldn't
file_re = re.compile(r"^\b([A-Za-z0-9_\-][A-Za-z0-9_\.\-/]*)\b$")
-img_re = re.compile(r"^.*\.(png|gif|jpg|jpeg)$", re.IGNORECASE)
+img_re = re.compile(r"^.*\.(png|gif|jpg|jpeg|bmp|ico)$", re.IGNORECASE)
url_re = re.compile(r"^[a-z]{3,8}://[^\s'\"]+\S$")
link_re = re.compile("(?:\[\[|{{)([^\s\|]+)(?:\s*\|\s*([^\]]+)|)(?:\]\]|}})")
print ' <meta name="robots" content="noindex,nofollow" />'
for css in css_url:
print ' <link rel="stylesheet" type="text/css" href="%s" />' % relative_url(css)
+ if icon_url:
+ print ' <link rel="icon" href="%s" />' % relative_url(icon_url)
+
+ if privileged_url is not None:
+ print ' <link rel="alternate" type="application/x-wiki" title="Edit this page" href="%s" \>' \
+ % (privileged_path() + '?edit=' + name)
+
+ if history_url is not None:
+ print ' <link rel="alternate" type="application/rss+xml" title="RSS" href="%s" />' \
+ % (history_url + '?a=rss')
+
print '</head>'
# Body
+ r"|(?P<html><(/|)(br|hr|div|form|iframe|input|span))"
+ r"|(?P<ent>[<>&])"
- # Auto links
- + r"|(?P<img>\b[a-zA-Z0-9_/-]+\.(png|gif|jpg|jpeg|bmp))" # LEGACY
- + r"|(?P<word>\b(?:[A-Z][a-z]+){2,}\b)" # LEGACY
- + r"|(?P<url>(http|https|ftp|mailto)\:[^\s'\"]+\S)" # LEGACY
- + r"|(?P<email>[-\w._+]+\@[\w.-]+)" # LEGACY
+ # Auto links (LEGACY)
+ + r"|(?P<img>\b[a-zA-Z0-9_/-]+\.(png|gif|jpg|jpeg|bmp|ico))"
+ + r"|(?P<word>\b(?:[A-Z][a-z]+){2,}\b)"
+ + r"|(?P<url>(http|https|ftp|mailto)\:[^\s'\"]+\S)"
+ + r"|(?P<email>[-\w._+]+\@[\w.-]+)"
# Lists, divs, spans
+ r"|(?P<li>^\s+[\*#] +)"
+ r"|(?P<pre>\{\{\{|\s*\}\}\})"
- + r"|(?P<inl>\{\{([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\}\})" #TODO
+ + r"|(?P<inl>\{\{([^\s\|]+)(?:\s*\|\s*([^\]]+)|)\}\})"
# Tables
+ r"|(?P<tr>^\s*\|\|(=|)\s*)"