linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Schier <nsc@kernel.org>
To: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: "Linux Doc Mailing List" <linux-doc@vger.kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Akira Yokosawa" <akiyks@gmail.com>,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Tamir Duberstein" <tamird@gmail.com>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v8 19/24] docs: add support to build manpages from kerneldoc output
Date: Sat, 27 Sep 2025 22:35:00 +0200	[thread overview]
Message-ID: <aNhKdCrSM29uwvpn@levanger> (raw)
In-Reply-To: <3d248d724e7f3154f6e3a227e5923d7360201de9.1758196090.git.mchehab+huawei@kernel.org>

Please note that @kernel.org receipients are still not addressed
correctly:

> Date: Thu, 18 Sep 2025 13:54:53 +0200
> From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> To: Linux Doc Mailing List <linux-doc@vger.kernel.org>, Jonathan Corbet <corbet@lwn.net>
> Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Akira Yokosawa <akiyks@gmail.com>,
>     Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Thomas Weißschuh <thomas.weissschuh@linutronix.de>,
>     Alice Ryhl <aliceryhl@google.com>, Masahiro Yamada <mchehab+huawei@kernel.org>,
>     Miguel Ojeda <mchehab+huawei@kernel.org>, Nathan Chancellor <mchehab+huawei@kernel.org>,
>     Nicolas Schier <nicolas.schier@linux.dev>, Randy Dunlap <rdunlap@infradead.org>,
>     Tamir Duberstein <tamird@gmail.com>, linux-kbuild@vger.kernel.org,
>     linux-kernel@vger.kernel.org


On Thu, Sep 18, 2025 at 01:54:53PM +0200, Mauro Carvalho Chehab wrote:
> Generating man files currently requires running a separate
> script. The target also doesn't appear at the docs Makefile.
> 
> Add support for mandocs at the Makefile, adding the build
> logic inside sphinx-build-wrapper, updating documentation
> and dropping the ancillary script.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  Documentation/Makefile                 |  3 +-
>  Documentation/doc-guide/kernel-doc.rst | 29 ++++-----
>  Makefile                               |  2 +-
>  scripts/split-man.pl                   | 28 ---------
>  tools/docs/sphinx-build-wrapper        | 81 ++++++++++++++++++++++++--
>  5 files changed, 95 insertions(+), 48 deletions(-)
>  delete mode 100755 scripts/split-man.pl
> 
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 05397b9d844d..aa42b2cb7030 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -53,7 +53,7 @@ ifeq ($(HAVE_SPHINX),0)
>  else # HAVE_SPHINX
>  
>  # Common documentation targets
> -infodocs texinfodocs latexdocs epubdocs xmldocs pdfdocs linkcheckdocs:
> +mandocs infodocs texinfodocs latexdocs epubdocs xmldocs pdfdocs linkcheckdocs:
>  	$(Q)@$(srctree)/tools/docs/sphinx-pre-install --version-check
>  	+$(Q)$(PYTHON3) $(BUILD_WRAPPER) $@ \
>  		--sphinxdirs="$(SPHINXDIRS)" --conf="$(SPHINX_CONF)" \
> @@ -104,6 +104,7 @@ dochelp:
>  	@echo  '  htmldocs        - HTML'
>  	@echo  '  texinfodocs     - Texinfo'
>  	@echo  '  infodocs        - Info'
> +	@echo  '  mandocs         - Man pages'
>  	@echo  '  latexdocs       - LaTeX'
>  	@echo  '  pdfdocs         - PDF'
>  	@echo  '  epubdocs        - EPUB'
> diff --git a/Documentation/doc-guide/kernel-doc.rst b/Documentation/doc-guide/kernel-doc.rst
> index af9697e60165..4370cc8fbcf5 100644
> --- a/Documentation/doc-guide/kernel-doc.rst
> +++ b/Documentation/doc-guide/kernel-doc.rst
> @@ -579,20 +579,23 @@ source.
>  How to use kernel-doc to generate man pages
>  -------------------------------------------
>  
> -If you just want to use kernel-doc to generate man pages you can do this
> -from the kernel git tree::
> +To generate man pages for all files that contain kernel-doc markups, run::
>  
> -  $ scripts/kernel-doc -man \
> -    $(git grep -l '/\*\*' -- :^Documentation :^tools) \
> -    | scripts/split-man.pl /tmp/man
> +  $ make mandocs
>  
> -Some older versions of git do not support some of the variants of syntax for
> -path exclusion.  One of the following commands may work for those versions::
> +Or calling ``script-build-wrapper`` directly::

For this very patch, there is no 'scripts-build-wrapper' but
'sphinx-build-wrapper'.  Or am I missing something?

>  
> -  $ scripts/kernel-doc -man \
> -    $(git grep -l '/\*\*' -- . ':!Documentation' ':!tools') \
> -    | scripts/split-man.pl /tmp/man
> +  $ ./tools/docs/sphinx-build-wrapper mandocs
>  
> -  $ scripts/kernel-doc -man \
> -    $(git grep -l '/\*\*' -- . ":(exclude)Documentation" ":(exclude)tools") \
> -    | scripts/split-man.pl /tmp/man
> +The output will be at ``/man`` directory inside the output directory
> +(by default: ``Documentation/output``).
> +
> +Optionally, it is possible to generate a partial set of man pages by
> +using SPHINXDIRS:
> +
> +  $ make SPHINXDIRS=driver-api/media mandocs
> +
> +.. note::
> +
> +   When SPHINXDIRS={subdir} is used, it will only generate man pages for
> +   the files explicitly inside a ``Documentation/{subdir}/.../*.rst`` file.
> diff --git a/Makefile b/Makefile
> index 6bfe776bf3c5..9bd44afeda26 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1800,7 +1800,7 @@ $(help-board-dirs): help-%:
>  # Documentation targets
>  # ---------------------------------------------------------------------------
>  DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
> -	       linkcheckdocs dochelp refcheckdocs texinfodocs infodocs
> +	       linkcheckdocs dochelp refcheckdocs texinfodocs infodocs mandocs
>  PHONY += $(DOC_TARGETS)
>  $(DOC_TARGETS):
>  	$(Q)$(MAKE) $(build)=Documentation $@

Acked-by: Nicolas Schier <nsc@kernel.org>

  reply	other threads:[~2025-09-28  5:24 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-18 11:54 [PATCH v8 00/24] Split sphinx call logic from docs Makefile Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 01/24] scripts/jobserver-exec: move the code to a class Mauro Carvalho Chehab
2025-09-18 16:58   ` Jonathan Corbet
2025-09-18 17:33     ` Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 02/24] scripts/jobserver-exec: move its class to the lib directory Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 03/24] scripts/jobserver-exec: add a help message Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 04/24] scripts: check-variable-fonts.sh: convert to Python Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 05/24] tools/docs: check-variable-fonts.py: split into a lib and an exec file Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 06/24] check-variable-fonts.py: add a helper to display instructions Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 07/24] scripts: sphinx-pre-install: move it to tools/docs Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 08/24] tools/docs: sphinx-pre-install: drop a debug print Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 09/24] tools/docs: sphinx-pre-install: allow check for alternatives and bail out Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 10/24] tools/docs: python_version: move version check from sphinx-pre-install Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 11/24] tools/docs: sphinx-build-wrapper: add a wrapper for sphinx-build Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 12/24] docs: parallel-wrapper.sh: remove script Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 13/24] docs: Makefile: document latex/PDF PAPER= parameter Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 14/24] docs: Makefile: document FONTS_CONF_DENY_VF= parameter Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 15/24] tools/docs: sphinx-build-wrapper: add an argument for LaTeX interactive mode Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 16/24] tools/docs: sphinx-build-wrapper: allow building PDF files in parallel Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 17/24] tools/docs,scripts: sphinx-*: prevent sphinx-build crashes Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 18/24] tools/docs: sphinx-build-wrapper: Fix output for duplicated names Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 19/24] docs: add support to build manpages from kerneldoc output Mauro Carvalho Chehab
2025-09-27 20:35   ` Nicolas Schier [this message]
2025-09-29  0:44     ` Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 20/24] tools: kernel-doc: add a see also section at man pages Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 21/24] scripts: kdoc_parser.py: warn about Python version only once Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 22/24] tools/docs: sphinx-build-wrapper: move rust doc builder to wrapper Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 23/24] tools/docs: sphinx-* break documentation bulds on openSUSE Mauro Carvalho Chehab
2025-09-18 11:54 ` [PATCH v8 24/24] tools/docs: sphinx-build-wrapper: add support to run inside venv Mauro Carvalho Chehab
2025-09-18 17:47 ` [PATCH v8 00/24] Split sphinx call logic from docs Makefile Jonathan Corbet
2025-09-18 19:23   ` Mauro Carvalho Chehab
2025-09-18 19:33     ` Jonathan Corbet
2025-09-18 23:39       ` Mauro Carvalho Chehab
2025-10-17 20:13 ` Jonathan Corbet
2025-10-18 10:41   ` Mauro Carvalho Chehab

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=aNhKdCrSM29uwvpn@levanger \
    --to=nsc@kernel.org \
    --cc=akiyks@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=tamird@gmail.com \
    --cc=thomas.weissschuh@linutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).