From: Vincent Bernat Date: Sun, 13 Jan 2013 13:48:37 +0000 (+0100) Subject: web: better formatting of manual pages X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=475caa70233b0da24dbf72466d24f0bbcb239518;p=thirdparty%2Flldpd.git web: better formatting of manual pages --- diff --git a/content/media/css/lldpd.3.code.less b/content/media/css/lldpd.3.code.less index 3ebfcf40..38bc49eb 100644 --- a/content/media/css/lldpd.3.code.less +++ b/content/media/css/lldpd.3.code.less @@ -5,21 +5,27 @@ pre, code, code .amp, pre .amp, .manpage { line-height: 1.2; } .manpage { - white-space: pre; - b { - font-weight: normal; - color: @theme-color; - } - u { - text-decoration: none; - color: #507090; + text-align: center; + width: 100%; + div { + .inline-block; + white-space: pre; + text-align: left; + b { + font-weight: normal; + color: @theme-color; + } + u { + text-decoration: none; + color: #507090; + } } } -.codehilite, .manpage { +.codehilite, .manpage div { border: 1px solid #E0E0E0; margin: 0.4em auto (@line-height*1em); padding: 0.4em 2%; - width: 94%; + max-width: 94%; overflow-x: auto; pre { margin: 0; } /* Small scrollbar */ @@ -37,6 +43,7 @@ pre, code, code .amp, pre .amp, .manpage { } } .codehilite { + width: 94%; /* Output of HtmlFormatter(linenos=True,style='colorful').get_style_defs() */ .hll { background-color: #ffffcc } .c { color: #808080 } /* Comment */ diff --git a/extensions/text.py b/extensions/text.py index a4b4344c..63eca37d 100644 --- a/extensions/text.py +++ b/extensions/text.py @@ -31,11 +31,11 @@ class IncludeManpagePlugin(Plugin): git = subprocess.Popen(["git", "show", "%s:%s" % (version, path)], stdout=subprocess.PIPE) man = subprocess.Popen(["man", "-l", "-"], stdin=git.stdout, stdout=subprocess.PIPE, env={"MAN_KEEP_FORMATTING": "1", - "MANWIDTH": "66"}) + "MANWIDTH": "78"}) git.stdout.close() output = man.communicate()[0] - return "
%s
" % self.man(output) + return "
%s
" % self.man(output) link = re.compile(r'\[\[manpage:([^\]]+)\]\]', re.UNICODE|re.MULTILINE) text = link.sub(replace_content, text)