diff options
| author | Thomas Gleixner <tglx@kernel.org> | 2026-05-18 12:01:07 +0300 |
|---|---|---|
| committer | Thomas Gleixner <tglx@kernel.org> | 2026-05-18 12:01:07 +0300 |
| commit | 09d6818d3bdc1ea6e49a425040528cbdbc97bc0a (patch) | |
| tree | 989f9d94c592294e4ae5421c9cbcbad99eee996c /tools/docs/kernel-doc | |
| parent | 1655f6895a896eb632ca8a019259bc5d358a9712 (diff) | |
| parent | 5200f5f493f79f14bbdc349e402a40dfb32f23c8 (diff) | |
| download | linux-09d6818d3bdc1ea6e49a425040528cbdbc97bc0a.tar.xz | |
Merge branch 'linus' into timers/clocksource
... to bring it up to date for new changes.
Diffstat (limited to 'tools/docs/kernel-doc')
| -rwxr-xr-x | tools/docs/kernel-doc | 49 |
1 files changed, 40 insertions, 9 deletions
diff --git a/tools/docs/kernel-doc b/tools/docs/kernel-doc index aed09f9a54dd..d9192c3f1645 100755 --- a/tools/docs/kernel-doc +++ b/tools/docs/kernel-doc @@ -210,7 +210,6 @@ def main(): help="Enable debug messages") parser.add_argument("-M", "-modulename", "--modulename", - default="Kernel API", help="Allow setting a module name at the output.") parser.add_argument("-l", "-enable-lineno", "--enable_lineno", @@ -241,11 +240,9 @@ def main(): help=EXPORT_FILE_DESC) # - # Output format mutually-exclusive group + # Output format # - out_group = parser.add_argument_group("Output format selection (mutually exclusive)") - - out_fmt = out_group.add_mutually_exclusive_group() + out_fmt = parser.add_argument_group("Output format selection (mutually exclusive)") out_fmt.add_argument("-m", "-man", "--man", action="store_true", help="Output troff manual page format.") @@ -254,6 +251,12 @@ def main(): out_fmt.add_argument("-N", "-none", "--none", action="store_true", help="Do not output documentation, only warnings.") + out_fmt.add_argument("-y", "--yaml-file", "--yaml", + help="Stores kernel-doc output on a yaml file.") + out_fmt.add_argument("-k", "--kdoc-item", "--kdoc", action="store_true", + help="Store KdocItem inside yaml file. Ued together with --yaml.") + + # # Output selection mutually-exclusive group # @@ -324,14 +327,42 @@ def main(): from kdoc.kdoc_files import KernelFiles # pylint: disable=C0415 from kdoc.kdoc_output import RestFormat, ManFormat # pylint: disable=C0415 - if args.man: - out_style = ManFormat(modulename=args.modulename) - elif args.none: + yaml_content = set() + if args.yaml_file: out_style = None + + if args.man: + yaml_content |= {"man"} + + if args.rst: + yaml_content |= {"rst"} + + if args.kdoc_item or not yaml_content: + yaml_content |= {"KdocItem"} + else: - out_style = RestFormat() + n_outputs = 0 + + if args.man: + out_style = ManFormat(modulename=args.modulename) + n_outputs += 1 + + if args.none: + out_style = None + n_outputs += 1 + + if args.rst or n_outputs == 0: + n_outputs += 1 + out_style = RestFormat() + + if n_outputs > 1: + parser.error("Those arguments are muttually exclusive: --man, --rst, --none, except when generating a YAML file.") + + elif not n_outputs: + out_style = RestFormat() kfiles = KernelFiles(verbose=args.verbose, + yaml_file=args.yaml_file, yaml_content=yaml_content, out_style=out_style, werror=args.werror, wreturn=args.wreturn, wshort_desc=args.wshort_desc, wcontents_before_sections=args.wcontents_before_sections) |
