mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
kernel-doc: output source file name at SEE ALSO
for man pages, it is helpful to know from where the man page were generated. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <ac25496a27a0c90494a634d342207ef1ff6216e9.1759327966.git.mchehab+huawei@kernel.org>
This commit is contained in:
committed by
Jonathan Corbet
parent
0a4cd1c65e
commit
2bd22194b2
@@ -5,8 +5,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
class KdocItem:
|
class KdocItem:
|
||||||
def __init__(self, name, type, start_line, **other_stuff):
|
def __init__(self, name, fname, type, start_line, **other_stuff):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
self.fname = fname
|
||||||
self.type = type
|
self.type = type
|
||||||
self.declaration_start_line = start_line
|
self.declaration_start_line = start_line
|
||||||
self.sections = {}
|
self.sections = {}
|
||||||
|
|||||||
@@ -630,10 +630,11 @@ class ManFormat(OutputFormat):
|
|||||||
"""Adds a tail for all man pages"""
|
"""Adds a tail for all man pages"""
|
||||||
|
|
||||||
# SEE ALSO section
|
# SEE ALSO section
|
||||||
|
self.data += f'.SH "SEE ALSO"' + "\n.PP\n"
|
||||||
|
self.data += (f"Kernel file \\fB{args.fname}\\fR\n")
|
||||||
if len(self.symbols) >= 2:
|
if len(self.symbols) >= 2:
|
||||||
cur_name = self.arg_name(args, name)
|
cur_name = self.arg_name(args, name)
|
||||||
|
|
||||||
self.data += f'.SH "SEE ALSO"' + "\n.PP\n"
|
|
||||||
related = []
|
related = []
|
||||||
for arg in self.symbols:
|
for arg in self.symbols:
|
||||||
out_name = self.arg_name(arg, arg.name)
|
out_name = self.arg_name(arg, arg.name)
|
||||||
|
|||||||
@@ -254,8 +254,9 @@ SECTION_DEFAULT = "Description" # default section
|
|||||||
|
|
||||||
class KernelEntry:
|
class KernelEntry:
|
||||||
|
|
||||||
def __init__(self, config, ln):
|
def __init__(self, config, fname, ln):
|
||||||
self.config = config
|
self.config = config
|
||||||
|
self.fname = fname
|
||||||
|
|
||||||
self._contents = []
|
self._contents = []
|
||||||
self.prototype = ""
|
self.prototype = ""
|
||||||
@@ -422,7 +423,8 @@ class KernelDoc:
|
|||||||
The actual output and output filters will be handled elsewhere
|
The actual output and output filters will be handled elsewhere
|
||||||
"""
|
"""
|
||||||
|
|
||||||
item = KdocItem(name, dtype, self.entry.declaration_start_line, **args)
|
item = KdocItem(name, self.fname, dtype,
|
||||||
|
self.entry.declaration_start_line, **args)
|
||||||
item.warnings = self.entry.warnings
|
item.warnings = self.entry.warnings
|
||||||
|
|
||||||
# Drop empty sections
|
# Drop empty sections
|
||||||
@@ -445,7 +447,7 @@ class KernelDoc:
|
|||||||
variables used by the state machine.
|
variables used by the state machine.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
self.entry = KernelEntry(self.config, ln)
|
self.entry = KernelEntry(self.config, self.fname, ln)
|
||||||
|
|
||||||
# State flags
|
# State flags
|
||||||
self.state = state.NORMAL
|
self.state = state.NORMAL
|
||||||
|
|||||||
Reference in New Issue
Block a user