]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
web: better formatting of manual pages
authorVincent Bernat <bernat@luffy.cx>
Sun, 13 Jan 2013 13:48:37 +0000 (14:48 +0100)
committerVincent Bernat <bernat@luffy.cx>
Sun, 13 Jan 2013 13:48:37 +0000 (14:48 +0100)
content/media/css/lldpd.3.code.less
extensions/text.py

index 3ebfcf40d4be97c9a8e92b0e07a87513d7773f98..38bc49eb74472f250a7aede1750e84a4e0273ef2 100644 (file)
@@ -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 */
index a4b4344c30ea6a98be924650d9e9eb9b127608cf..63eca37d89a2116a2122485925bc0579d5dd24cd 100644 (file)
@@ -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 "<div class='manpage'>%s</div>" % self.man(output)
+            return "<div class='manpage'><div>%s</div></div>" % self.man(output)
 
         link = re.compile(r'\[\[manpage:([^\]]+)\]\]', re.UNICODE|re.MULTILINE)
         text = link.sub(replace_content, text)