templates_docsdir = $(templatesdir)/docs
templates_docs_modules_DATA = \
+ src/templates/docs/modules/diff.html \
src/templates/docs/modules/header.html
templates_docs_modulesdir = $(templates_docsdir)/modules
templates_wiki_messagesdir = $(templates_wikidir)/messages
templates_wiki_modules_DATA = \
- src/templates/wiki/modules/diff.html \
src/templates/wiki/modules/list.html
templates_wiki_modulesdir = $(templates_wikidir)/modules
</div>
{% end %}
- {% module WikiDiff(a, b) %}
+ {% module DocsDiff(a, b) %}
</div>
</div>
{% end block %}
"BootMenuSeparator" : boot.MenuSeparatorModule,
# Docs
+ "DocsDiff" : docs.DiffModule,
"DocsHeader" : docs.HeaderModule,
# Nopaste
"VoIPRegistrations" : voip.RegistrationsModule,
# Wiki
- "WikiDiff" : wiki.WikiDiffModule,
"WikiList" : wiki.WikiListModule,
# Misc
return self.render_string("docs/modules/header.html",
breadcrumbs=breadcrumbs, page=self.page, page_title=title, suffix=suffix)
+
+
+class DiffModule(ui_modules.UIModule):
+ differ = difflib.Differ()
+
+ def render(self, a, b):
+ diff = self.differ.compare(
+ a.markdown.splitlines(),
+ b.markdown.splitlines(),
+ )
+
+ return self.render_string("docs/modules/diff.html", diff=diff)
#!/usr/bin/python3
-import difflib
import tornado.web
from . import base
self.render("wiki/watchlist.html", pages=pages)
-class WikiDiffModule(ui_modules.UIModule):
- differ = difflib.Differ()
-
- def render(self, a, b):
- diff = self.differ.compare(
- a.markdown.splitlines(),
- b.markdown.splitlines(),
- )
-
- return self.render_string("wiki/modules/diff.html", diff=diff)
-
-
class WikiListModule(ui_modules.UIModule):
def render(self, pages, link_revision=False, show_breadcrumbs=True,
show_author=True, show_changes=False):