diff options
author | Ulrike Uhlig <u@451f.org> | 2014-09-15 19:14:21 +0000 |
---|---|---|
committer | Ulrike Uhlig <u@451f.org> | 2014-09-15 19:14:21 +0000 |
commit | 6abe9015bf946aa728951634ad1ec6c36c6f4430 (patch) | |
tree | 4b251a8af7a8afc5b2d8d6771e514ab17ec72283 /lib | |
parent | d512b7f70c9834e1e87197c644d2e44d1f28d0ad (diff) |
use modern html5 css. switch to external stylesheet.
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@28798 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/web_support.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/python/web_support.py b/lib/python/web_support.py index 1e220505c8..ac6200cb9c 100644 --- a/lib/python/web_support.py +++ b/lib/python/web_support.py @@ -379,6 +379,8 @@ def STYLE(contents, type='text/css'): return tag('style', contents, type=type) def SCRIPT(contents, type="text/javascript", language="JavaScript"): return tag('script', contents, type=type, language=language) +def LINK(contents, type="text/css", rel="stylesheet", href=""): + return tag('link', contents, type=type, rel=rel, href=href) def TITLE(contents): return tag('title', contents) def HTML(head, body): @@ -391,6 +393,8 @@ def H1(contents): return tag('h1', contents) def H2(contents): return tag('h2', contents) +def H3(contents): + return tag('h3', contents) def P(*contents): return Tag('p', contents) def SPAN(*__contents, **__attribs): @@ -419,6 +423,10 @@ def INPUT(*__contents, **__attribs): return Tag('input', __contents, __attribs) def LI(*__contents, **__attribs): return Tag('li', __contents, __attribs) +def HEADER(*__contents, **__attribs): + return Tag('header', __contents, __attribs) +def FOOTER(*__contents, **__attribs): + return Tag('footer', __contents, __attribs) def _linkify(match): extra = match.group(2) @@ -696,7 +704,7 @@ class WebServiceBase: def html_dtd(self): """Returns the DOCTYPE declaration to be used for HTML documents. Can be overridden.""" - return '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' + return '<!DOCTYPE html>' def add_title(self, title, body, head_contents=None, body_attribs={}): """Takes a sequence of HTML objects and wraps them in 'body' @@ -716,7 +724,7 @@ class WebServiceBase: body_list = [body] else: body_list = list(body) - body_list[:0] = (H1(title),) + body_list[:0] = (HEADER(H1(title)),) return tag('html', (HEAD(head_list), Tag('body', body_list, body_attribs))) |