[display theorems raph.levien@gmail.com**20070107003414] { hunk ./app/log_what.py 8 + +# Decide whether a given "what" lives in theorem space +def thmspace(what): + lwhat = what.split('/') + return len(lwhat) > 1 and lwhat[0] not in ('wiki', 'bib', 'user') hunk ./app/templates/base.html 57 + hunk ./app/templates/edit.html 14 - - {{ form }} -
+
{{ form.ldata }}
addfile ./app/templates/theorem.html hunk ./app/templates/theorem.html 1 +{% load ghmarkup %} +{% extends "wikibase.html" %} + +{% block content %} +

{{ title }}

+ +{{ norm.ldata|ghmarkup:"mm/set/" }} +
+{{ thm.ldata|escape }}
+
+ +

Last edited: {{ norm.mtime }} by {% filter ghlink %}user/{{ norm.muser }}{% endfilter %}

+ +

+Edit +History +{{ norm.what|talklink }} +

+{% endblock %} hunk ./app/templatetags/ghmarkup.py 4 -from ghestalt.app.log_what import wikiwhat +from ghestalt.app.log_what import wikiwhat, thmspace hunk ./app/templatetags/ghmarkup.py 30 - return Log.objects.filter(what=what).count() > 0 + if thmspace(what): + return Log.objects.filter(what=what+'/_thm').count() > 0 + else: + return Log.objects.filter(what=what).count() > 0 hunk ./app/templatetags/ghmarkup.py 50 -def wikilink(str, exists = None, ispreblock = False): +def wikilink(str, exists = None, ispreblock = False, ctx = None): hunk ./app/templatetags/ghmarkup.py 59 - url = link - elif re.match('user/[^/]+$', link): + url = linktext = link + elif re.match(r'user/[^/]+$', link): hunk ./app/templatetags/ghmarkup.py 63 + m = re.search(r'/_[a-z]+$', link) + if m: link = link[:m.start()] + linktext = link + if ctx and link.find('/') < 0: link = ctx + link hunk ./app/templatetags/ghmarkup.py 75 - if re.match('wiki/', link): - body = link[5:] - elif re.match('bib/', link): - body = '[' + link[4:] + ']' + if re.match('wiki/', linktext): + body = linktext[5:] + elif re.match('bib/', linktext): + body = '[' + linktext[4:] + ']' hunk ./app/templatetags/ghmarkup.py 80 - body = link + body = linktext hunk ./app/templatetags/ghmarkup.py 108 -def process_ghmarkup(str): +def process_ghmarkup(str, ctx): hunk ./app/templatetags/ghmarkup.py 123 - (?[\w\-_]+)/', 'ghestalt.app.views.wiki_showpage'), hunk ./urls.py 17 + (r'^(?Pmm/.+)$', 'show_theorem'), }