aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Bolognani <abologna@redhat.com>2019-04-15 14:31:11 +0200
committerDaniel P. Berrangé <berrange@redhat.com>2019-04-15 13:40:47 +0100
commit6280c94f306df6a20bbc100ba15a5a81af0366e6 (patch)
tree89228ad712bf3bbdeece8383d44085e1346a7534
parentdf4e56f8fab65ba714ec18f4e7338a966a1620ad (diff)
downloadkeycodemapdb-6280c94f306df6a20bbc100ba15a5a81af0366e6.zip
keycodemapdb-6280c94f306df6a20bbc100ba15a5a81af0366e6.tar.gz
keycodemapdb-6280c94f306df6a20bbc100ba15a5a81af0366e6.tar.bz2
keymap-gen: Name sections in pod output
Properly formatted man pages have at least a NAME section, which tools like apropos(1) parse and index. The current implementation of PodLanguageGenerator doesn't generate this section, and even if the user were to try and work around the limitation by passing --varname=NAME, there would still be nothing in the section to actually parse. Change the generator so that varname will be used as the contents of the NAME section, add a DESCRIPTION section in which values are listed. Signed-off-by: Andrea Bolognani <abologna@redhat.com>
-rwxr-xr-xtools/keymap-gen12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/keymap-gen b/tools/keymap-gen
index 7965d37..78676a9 100755
--- a/tools/keymap-gen
+++ b/tools/keymap-gen
@@ -873,7 +873,11 @@ class PodLanguageGenerator(LanguageDocGenerator):
print("#")
def _array_start_name_doc(self, varname, namemap):
- print("=head1 %s" % varname)
+ print("=head1 NAME")
+ print("")
+ print("%s" % varname)
+ print("")
+ print("=head1 DESCRIPTION")
print("")
print("List of %s key code names, with corresponding key code values" % namemap)
print("")
@@ -881,7 +885,11 @@ class PodLanguageGenerator(LanguageDocGenerator):
print("")
def _array_start_code_doc(self, varname, codemap, namemap):
- print("=head1 %s" % varname)
+ print("=head1 NAME")
+ print("")
+ print("%s" % varname)
+ print("")
+ print("=head1 DESCRIPTION")
print("")
print("List of %s key code values, with corresponding %s key code names" % (codemap, namemap))
print("")