+ except (IndexError, OSError), exc:
+ import traceback
+ traceback.print_exc()
+
+ raise Http404
+
+@never_cache
+def document_diff(request, name, revA, revB):
+ storage = getstorage()
+ docA = storage.get(name, int(revA))
+ docB = storage.get(name, int(revB))
+
+
+ return HttpResponse(nice_diff.html_diff_table(docA.plain_text.splitlines(),
+ docB.plain_text.splitlines()) )
+
+@never_cache
+def document_history(request, name):
+ storage = getstorage()
+
+ return HttpResponse(
+ json.dumps(storage.history(name), cls=DateTimeEncoder),
+ mimetype='application/json')
+
+
+@never_cache
+def document_publish(request, name, version):
+ storage = getstorage()
+
+ # get the document
+ try:
+ document = storage.get(name, revision = int(version))
+ except DocumentNotFound: