From: Carlos Bilbao <carlos.bilbao@amd.com>
To: <corbet@lwn.net>, <ojeda@kernel.org>
Cc: <linux-doc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<bilbao@vt.edu>, Carlos Bilbao <carlos.bilbao@amd.com>
Subject: [PATCH] docs: Integrate rustdoc-generated output to Rust docs
Date: Mon, 28 Nov 2022 14:19:32 -0600 [thread overview]
Message-ID: <20221128201932.168313-1-carlos.bilbao@amd.com> (raw)
Include HTML output generated from rustdoc into the Linux kernel
documentation on Rust. Add Makefile target `make htmlrust` to combine
make htmldocs and the generation of Rust documentation.
Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
---
Documentation/Makefile | 11 +++++++++++
Documentation/rust/index.rst | 1 +
Documentation/rust/rustdoc.rst | 10 ++++++++++
Makefile | 2 +-
4 files changed, 23 insertions(+), 1 deletion(-)
create mode 100644 Documentation/rust/rustdoc.rst
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 64d44c1ecad3..02ed01fa3499 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -95,6 +95,17 @@ htmldocs:
@$(srctree)/scripts/sphinx-pre-install --version-check
@+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
+ifdef CONFIG_RUST
+htmlrust:
+ @make rustavailable
+ @make LLVM=1 rustdoc
+ @cp -r rust/doc/* Documentation/output/
+ @make htmldocs
+else
+htmlrust:
+ @echo "Error: CONFIG_RUST must be defined (see .config)"
+endif
+
linkcheckdocs:
@$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var)))
diff --git a/Documentation/rust/index.rst b/Documentation/rust/index.rst
index 4ae8c66b94fa..5e7a9d39af90 100644
--- a/Documentation/rust/index.rst
+++ b/Documentation/rust/index.rst
@@ -13,6 +13,7 @@ in the kernel, please read the quick-start.rst guide.
general-information
coding-guidelines
arch-support
+ rustdoc
.. only:: subproject and html
diff --git a/Documentation/rust/rustdoc.rst b/Documentation/rust/rustdoc.rst
new file mode 100644
index 000000000000..74581367417b
--- /dev/null
+++ b/Documentation/rust/rustdoc.rst
@@ -0,0 +1,10 @@
+.. SPDX-License-Identifier: GPL-2.0
+
+Rustdoc output
+==============
+
+If this documentation includes rustdoc-generated HTML, this is the
+entry point.
+
+.. raw:: html
+ :file: doc/kernel/index.html
diff --git a/Makefile b/Makefile
index f41ec8c8426b..c7e00bf928ed 100644
--- a/Makefile
+++ b/Makefile
@@ -1785,7 +1785,7 @@ $(help-board-dirs): help-%:
# Documentation targets
# ---------------------------------------------------------------------------
DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
- linkcheckdocs dochelp refcheckdocs
+ linkcheckdocs dochelp refcheckdocs htmlrust
PHONY += $(DOC_TARGETS)
$(DOC_TARGETS):
$(Q)$(MAKE) $(build)=Documentation $@
--
2.34.1
next reply other threads:[~2022-11-28 20:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-28 20:19 Carlos Bilbao [this message]
2022-11-28 21:06 ` Miguel Ojeda
2022-11-28 22:23 ` Jonathan Corbet
2022-11-30 14:18 ` Carlos Bilbao
2022-11-30 3:57 ` kernel test robot
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=20221128201932.168313-1-carlos.bilbao@amd.com \
--to=carlos.bilbao@amd.com \
--cc=bilbao@vt.edu \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.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
all inboxes | Powered by JetHome®