From 6040154bde912222528cd84b0d8bec7bc60bb65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Tue, 15 Feb 2011 01:16:18 +0100 Subject: More of this w3c stuff --- controller.py | 2 +- templates/page.mako | 8 +++++--- templates/pages/index.mako | 6 +++--- templates/root.mako | 5 +++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/controller.py b/controller.py index 894cd42..f24b435 100644 --- a/controller.py +++ b/controller.py @@ -9,7 +9,7 @@ class Page: All the general and simple pages. """ def GET(self, name = '/'): - web.header("Content-Type", "application/xhtml+xml;;charset=utf-8", unique = True) + web.header("Content-Type", "text/html;charset=utf-8", unique = True) if not name or name == '/': name = 'index' return render(name) diff --git a/templates/page.mako b/templates/page.mako index aa2aa51..1a43d49 100644 --- a/templates/page.mako +++ b/templates/page.mako @@ -1,4 +1,5 @@ <%! + trans = {ord(" "):u"-", ord("/"):"-", ord("(") : None, ord(")"):None} title = "" uses_toc = False %> @@ -24,15 +25,16 @@ ${page_text} <% if self.attr.uses_toc: c = capture(caller.body) - name = c.replace(" ", "_").replace("/", "_").lower() + name = c.translate(trans) tlist = getattr(self.attr, "tlist", []) tlist.append((str(name), str(c))) self.attr.tlist = tlist + id_tag = "id=\"%s\"" % name else: - name = "#" + id_tag = '' %> - <${tag}>» ${caller.body()} + <${tag}>» ${caller.body()} <%def name="toc()"> diff --git a/templates/pages/index.mako b/templates/pages/index.mako index 02d4a48..9922178 100644 --- a/templates/pages/index.mako +++ b/templates/pages/index.mako @@ -39,8 +39,8 @@ emerge -av portato <%self:h2>Forums

- This project itself does not have any forums. But there are a couple of threads in other forums:
- If you are using Gentoo look into this forum thread (engl) or into the German one. If you are using Sabayon, use this one. + This project itself does not have any forums. But there are a couple of threads in other forums:
+ If you are using Gentoo look into this forum thread (engl) or into the German one. If you are using Sabayon, use this one.

<%self:h2>Similar projects @@ -50,5 +50,5 @@ emerge -av portato diff --git a/templates/root.mako b/templates/root.mako index 46fd88f..936ce57 100644 --- a/templates/root.mako +++ b/templates/root.mako @@ -1,5 +1,6 @@ + - + @@ -10,7 +11,7 @@
-- cgit v1.2.3