doc: extensions: add kconfig directive and role support

Add a new extension to support the :kconfig: role and .. kconfig::
directive. This removes the need of using :option:.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2021-06-28 16:23:59 +02:00 committed by Anas Nashif
commit 21d01ad7d1

View file

@ -0,0 +1,27 @@
"""
Kconfig role and directive
##########################
Copyright (c) 2021 Nordic Semiconductor ASA
SPDX-License-Identifier: Apache-2.0
Introduction
============
A Sphinx extension that provides a role and directive for Kconfig content. The
``:kconfig:`` role can be used inline to generate references to the page
containing documentation for any Kconfig option. The ``.. kconfig::`` directive
is automatically added to the Kconfig generated pages.
Copyright (c) 2021 Nordic Semiconductor ASA
SPDX-License-Identifier: Apache-2.0
"""
def setup(app):
app.add_crossref_type("kconfig", "kconfig")
return {
"parallel_read_safe": True,
"parallel_write_safe": True,
}