From: Jani Nikula <jani.nikula@intel.com>
To: Mike Rapoport <rppt@linux.vnet.ibm.com>,
Jonathan Corbet <corbet@lwn.net>
Cc: Matthew Wilcox <willy@infradead.org>,
linux-doc <linux-doc@vger.kernel.org>,
Mike Rapoport <rppt@linux.vnet.ibm.com>
Subject: Re: [PATCH v2 1/2] Documentation/sphinx: allow "functions" with no parameters
Date: Wed, 20 Jun 2018 10:19:36 +0300 [thread overview]
Message-ID: <878t79x6uv.fsf@intel.com> (raw)
In-Reply-To: <1529468469-10088-2-git-send-email-rppt@linux.vnet.ibm.com>
On Wed, 20 Jun 2018, Mike Rapoport <rppt@linux.vnet.ibm.com> wrote:
> When kernel-doc:: specified in .rst document without explicit directives,
> it outputs both comment and DOC: sections. If a DOC: section was explicitly
> included in the same document it will be duplicated. For example, the
> output generated for Documentation/core-api/idr.rst [1] has "IDA
> description" in the "IDA usage" section and in the middle of the API
> reference.
>
> This patch enables using "functions" directive without parameters to output
> all the documentation excluding DOC: sections.
>
> [1] https://www.kernel.org/doc/html/v4.17/core-api/idr.html
>
> Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
> Acked-by: Matthew Wilcox <willy@infradead.org>
Looks good to me. Though I do realize now that I overlooked that this
applies to not only functions, but also to other non-DOC documentation
comments. I guess up to Jon to decide.
Please do give the cobbler's children some shoes, and document this in
Documentation/doc-guide/kernel-doc.rst.
Thanks,
Jani.
> ---
> Documentation/sphinx/kerneldoc.py | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
> index fbedcc3..9d0a7f0 100644
> --- a/Documentation/sphinx/kerneldoc.py
> +++ b/Documentation/sphinx/kerneldoc.py
> @@ -47,7 +47,7 @@ class KernelDocDirective(Directive):
> optional_arguments = 4
> option_spec = {
> 'doc': directives.unchanged_required,
> - 'functions': directives.unchanged_required,
> + 'functions': directives.unchanged,
> 'export': directives.unchanged,
> 'internal': directives.unchanged,
> }
> @@ -75,8 +75,12 @@ class KernelDocDirective(Directive):
> elif 'doc' in self.options:
> cmd += ['-function', str(self.options.get('doc'))]
> elif 'functions' in self.options:
> - for f in str(self.options.get('functions')).split():
> - cmd += ['-function', f]
> + functions = self.options.get('functions').split()
> + if functions:
> + for f in functions:
> + cmd += ['-function', f]
> + else:
> + cmd += ['-no-doc-sections']
>
> for pattern in export_file_patterns:
> for f in glob.glob(env.config.kerneldoc_srctree + '/' + pattern):
--
Jani Nikula, Intel Open Source Graphics Center
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-06-20 8:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 4:21 [PATCH v2 0/2] Documentation/sphinx: add kind of "nodocs" directive Mike Rapoport
2018-06-20 4:21 ` [PATCH v2 1/2] Documentation/sphinx: allow "functions" with no parameters Mike Rapoport
2018-06-20 7:19 ` Jani Nikula [this message]
2018-06-20 8:49 ` Mike Rapoport
2018-06-26 14:59 ` Jonathan Corbet
2018-06-20 4:21 ` [PATCH v2 2/2] docs/idr: use empty "functions" directive Mike Rapoport
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878t79x6uv.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=rppt@linux.vnet.ibm.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox