[svn r38213] Some small cleanups, made fonts a bit smaller and more consistent.
--HG-- branch : trunk
This commit is contained in:
parent
0f37c632ac
commit
999da7a376
|
@ -112,12 +112,13 @@ class H(html):
|
||||||
super(H.SourceSnippet, self).__init__(
|
super(H.SourceSnippet, self).__init__(
|
||||||
link, H.div(*sourceels))
|
link, H.div(*sourceels))
|
||||||
|
|
||||||
class SourceDef(html.div):
|
class PythonSource(Content):
|
||||||
|
style = html.Style(font_size='0.8em')
|
||||||
def __init__(self, *sourceels):
|
def __init__(self, *sourceels):
|
||||||
super(H.SourceDef, self).__init__(
|
super(H.PythonSource, self).__init__(
|
||||||
H.div(*sourceels))
|
H.div(*sourceels))
|
||||||
|
|
||||||
class SourceCode(html.div):
|
class SourceBlock(html.div):
|
||||||
style = html.Style(margin_top='1em', margin_bottom='1em')
|
style = html.Style(margin_top='1em', margin_bottom='1em')
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.linenotable = lntable = H.table(style='float: left')
|
self.linenotable = lntable = H.table(style='float: left')
|
||||||
|
@ -128,7 +129,7 @@ class H(html):
|
||||||
self.linetbody = ltbody = H.tbody()
|
self.linetbody = ltbody = H.tbody()
|
||||||
ltable.append(ltbody)
|
ltable.append(ltbody)
|
||||||
|
|
||||||
super(H.SourceCode, self).__init__(lntable, ltable)
|
super(H.SourceBlock, self).__init__(lntable, ltable)
|
||||||
|
|
||||||
def add_line(self, lineno, els):
|
def add_line(self, lineno, els):
|
||||||
if els == []:
|
if els == []:
|
||||||
|
@ -136,10 +137,11 @@ class H(html):
|
||||||
self.linenotbody.append(H.tr(H.td(lineno, class_='lineno')))
|
self.linenotbody.append(H.tr(H.td(lineno, class_='lineno')))
|
||||||
self.linetbody.append(H.tr(H.td(class_='code', *els)))
|
self.linetbody.append(H.tr(H.td(class_='code', *els)))
|
||||||
|
|
||||||
class NonPythonSource(html.pre):
|
class NonPythonSource(Content):
|
||||||
pass # style = html.Style(margin_left='15em')
|
def __init__(self, *args):
|
||||||
|
super(H.NonPythonSource, self).__init__(H.pre(*args))
|
||||||
|
|
||||||
class DirList(html.div):
|
class DirList(Content):
|
||||||
def __init__(self, dirs, files):
|
def __init__(self, dirs, files):
|
||||||
dirs = [H.DirListItem(text, href) for (text, href) in dirs]
|
dirs = [H.DirListItem(text, href) for (text, href) in dirs]
|
||||||
files = [H.DirListItem(text, href) for (text, href) in files]
|
files = [H.DirListItem(text, href) for (text, href) in files]
|
||||||
|
|
|
@ -124,7 +124,7 @@ def wrap_page(project, title, contentel, navel, relbase, basepath,
|
||||||
return page
|
return page
|
||||||
|
|
||||||
def enumerate_and_color(codelines, firstlineno, enc):
|
def enumerate_and_color(codelines, firstlineno, enc):
|
||||||
snippet = H.SourceCode()
|
snippet = H.SourceBlock()
|
||||||
tokenizer = source_color.Tokenizer(source_color.PythonSchema)
|
tokenizer = source_color.Tokenizer(source_color.PythonSchema)
|
||||||
for i, line in enumerate(codelines):
|
for i, line in enumerate(codelines):
|
||||||
try:
|
try:
|
||||||
|
@ -230,7 +230,7 @@ class SourcePageBuilder(AbstractPageBuilder):
|
||||||
source = fspath.read()
|
source = fspath.read()
|
||||||
sep = get_linesep(source)
|
sep = get_linesep(source)
|
||||||
colored = enumerate_and_color(source.split(sep), 0, enc)
|
colored = enumerate_and_color(source.split(sep), 0, enc)
|
||||||
tag = H.SourceDef(colored)
|
tag = H.PythonSource(colored)
|
||||||
nav = self.build_navigation(fspath)
|
nav = self.build_navigation(fspath)
|
||||||
return tag, nav
|
return tag, nav
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@ class ApiPageBuilder(AbstractPageBuilder):
|
||||||
return cslinks
|
return cslinks
|
||||||
|
|
||||||
def build_callsite(self, dotted_name, call_site, index):
|
def build_callsite(self, dotted_name, call_site, index):
|
||||||
tbtag = self.gen_traceback(dotted_name, reversed(call_site))
|
tbtag = H.Content(self.gen_traceback(dotted_name, reversed(call_site)))
|
||||||
parent_dotted_name, _ = split_of_last_part(dotted_name)
|
parent_dotted_name, _ = split_of_last_part(dotted_name)
|
||||||
nav = self.build_navigation(parent_dotted_name, False)
|
nav = self.build_navigation(parent_dotted_name, False)
|
||||||
id = 'callsite_%s_%s' % (dotted_name, index)
|
id = 'callsite_%s_%s' % (dotted_name, index)
|
||||||
|
|
|
@ -80,10 +80,6 @@ ul li {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.property {
|
|
||||||
font-size: 1.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.callstackitem {
|
.callstackitem {
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
|
|
Loading…
Reference in New Issue