[master] ed27a26 Improve manpage formatting

Federico G. Schwindt fgsch at lodoss.net
Mon Feb 17 09:53:57 CET 2014


commit ed27a2634576f9911e01b23db05065833a924abe
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Mon Feb 17 08:44:13 2014 +0000

    Improve manpage formatting
    
    Add a second parameter to $Module to specify the manpage section
    and change how the description is printed.

diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index 959f203..be6cff6 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -93,11 +93,12 @@ class token(object):
 #######################################################################
 
 class vmod(object):
-	def __init__(self, nam, dnam):
+	def __init__(self, nam, dnam, sec):
 		if not is_c_name(nam):
 			raise Exception("Module name '%s' is illegal" % nam)
 		self.nam = nam
 		self.dnam = dnam
+		self.sec = sec
 		self.init = None
 		self.funcs = list()
 		self.objs = list()
@@ -243,11 +244,18 @@ class vmod(object):
 		self.doc_str.append(l)
 
 	def doc_dump(self, fo, suf):
-		i = "vmod_" + self.nam + " -- " + self.dnam
+		i = "vmod_" + self.nam
 		fo.write("=" * len(i) + "\n")
 		fo.write(i + "\n")
 		fo.write("=" * len(i) + "\n")
 		fo.write("\n")
+		i = self.dnam
+		fo.write("-" * len(i) + "\n")
+		fo.write(i + "\n")
+		fo.write("-" * len(i) + "\n")
+		fo.write("\n")
+		fo.write(":Manual section: %s\n" % self.sec)
+		fo.write("\n")
 		fo.write("SYNOPSIS\n")
 		fo.write("========\n")
 		fo.write("\n")
@@ -529,11 +537,12 @@ def parse_enum2(tl):
 
 def parse_module(tl):
 	nm = tl.get_token().str
+	sec = tl.get_token().str
 	s = ""
 	while len(tl.tl) > 0:
 		s += " " + tl.get_token().str
 	dnm = s[1:]
-	return vmod(nm, dnm)
+	return vmod(nm, dnm, sec)
 
 #######################################################################
 #



More information about the varnish-commit mailing list