From b99435279a281f2c541100b693c96e67d6c1bd62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Sat, 29 Apr 2023 23:18:31 +0200 Subject: Allow to specify the format of the documentation Helps the consumers of the documentation to assume that the documentation is using gtk-doc format or gi-docgen. --- giscanner/scannermain.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'giscanner/scannermain.py') diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py index 1d39ab84..186bfd07 100644 --- a/giscanner/scannermain.py +++ b/giscanner/scannermain.py @@ -220,6 +220,10 @@ match the namespace prefix.""") parser.add_option("", "--compiler", action="store", dest="compiler", default=None, help="the C compiler to use internally") + parser.add_option("", "--doc-format", + action="store", dest="doc_format", + help=("name of the documentation format used in the project, " + "should be on of gtk-doc or gi-docgen")) group = get_preprocessor_option_group(parser) parser.add_option_group(group) @@ -580,6 +584,9 @@ def scanner_main(args): or options.header_only): _error("Must specify --program or --library") + if options.doc_format and options.doc_format != 'gtk-doc' and options.doc_format != 'gi-docgen': + _error("Unknown doc-type: %s" % (options.doc_format, )) + namespace = create_namespace(options) logger = message.MessageLogger.get(namespace=namespace) if options.warn_all: @@ -638,6 +645,7 @@ def scanner_main(args): transformer.namespace.c_includes = options.c_includes transformer.namespace.exported_packages = exported_packages + transformer.namespace.doc_format = options.doc_format sources_top_dirs = get_source_root_dirs(options, filenames) writer = Writer(transformer.namespace, sources_top_dirs) -- cgit v1.2.1