sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget$/translations/zh_CN/doc-guide/sphinxmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/zh_TW/doc-guide/sphinxmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/it_IT/doc-guide/sphinxmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ja_JP/doc-guide/sphinxmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/ko_KR/doc-guide/sphinxmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget$/translations/sp_SP/doc-guide/sphinxmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhtarget)}(h.. _sphinxdoc:h]h}(h]h ]h"]h$]h&]refid sphinxdocuh1hhKhhhhh>/var/lib/git/docbuild/linux/Documentation/doc-guide/sphinx.rstubhsection)}(hhh](htitle)}(h%Using Sphinx for kernel documentationh]h%Using Sphinx for kernel documentation}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXThe Linux kernel uses `Sphinx`_ to generate pretty documentation from `reStructuredText`_ files under ``Documentation``. To build the documentation in HTML or PDF formats, use ``make htmldocs`` or ``make pdfdocs``. The generated documentation is placed in ``Documentation/output``.h](hThe Linux kernel uses }(hhhhhNhNubh reference)}(h `Sphinx`_h]hSphinx}(hhhhhNhNubah}(h]h ]h"]h$]h&]nameSphinxrefurihttp://www.sphinx-doc.org/uh1hhhnjresolvedKubh' to generate pretty documentation from }(hhhhhNhNubh)}(h`reStructuredText`_h]hreStructuredText}(hhhhhNhNubah}(h]h ]h"]h$]h&]namereStructuredTexth(http://docutils.sourceforge.net/rst.htmluh1hhhhKubh files under }(hhhhhNhNubhliteral)}(h``Documentation``h]h Documentation}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh9. To build the documentation in HTML or PDF formats, use }(hhhhhNhNubh)}(h``make htmldocs``h]h make htmldocs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh or }(hhhhhNhNubh)}(h``make pdfdocs``h]h make pdfdocs}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh+. The generated documentation is placed in }(hhhhhNhNubh)}(h``Documentation/output``h]hDocumentation/output}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h&.. _Sphinx: http://www.sphinx-doc.org/h]h}(h]sphinxah ]h"]sphinxah$]h&]hhuh1hhK hhhhhh referencedKubh)}(h>.. _reStructuredText: http://docutils.sourceforge.net/rst.htmlh]h}(h]restructuredtextah ]h"]restructuredtextah$]h&]hhuh1hhK hhhhhhjYKubh)}(hX\The reStructuredText files may contain directives to include structured documentation comments, or kernel-doc comments, from source files. Usually these are used to describe the functions and types and design of the code. The kernel-doc comments have some special structure and formatting, but beyond that they are also treated as reStructuredText.h]hX\The reStructuredText files may contain directives to include structured documentation comments, or kernel-doc comments, from source files. Usually these are used to describe the functions and types and design of the code. The kernel-doc comments have some special structure and formatting, but beyond that they are also treated as reStructuredText.}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hFinally, there are thousands of plain text documentation files scattered around ``Documentation``. Some of these will likely be converted to reStructuredText over time, but the bulk of them will remain in plain text.h](hPFinally, there are thousands of plain text documentation files scattered around }(hjthhhNhNubh)}(h``Documentation``h]h Documentation}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjtubhw. Some of these will likely be converted to reStructuredText over time, but the bulk of them will remain in plain text.}(hjthhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h.. _sphinx_install:h]h}(h]h ]h"]h$]h&]hsphinx-installuh1hhKhhhhhhubh)}(hhh](h)}(hSphinx Installh]hSphinx Install}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hzThe ReST markups currently used by the Documentation/ files are meant to be built with ``Sphinx`` version 2.4.4 or higher.h](hWThe ReST markups currently used by the Documentation/ files are meant to be built with }(hjhhhNhNubh)}(h ``Sphinx``h]hSphinx}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh version 2.4.4 or higher.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hsThere's a script that checks for the Sphinx requirements. Please see :ref:`sphinx-pre-install` for further details.h](hGThere’s a script that checks for the Sphinx requirements. Please see }(hjhhhNhNubh)}(h:ref:`sphinx-pre-install`h]hinline)}(hjh]hsphinx-pre-install}(hjhhhNhNubah}(h]h ](xrefstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocdoc-guide/sphinx refdomainjreftyperef refexplicitrefwarn reftargetsphinx-pre-installuh1hhhhK!hjubh for further details.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK!hjhhubh)}(hMost distributions are shipped with Sphinx, but its toolchain is fragile, and it is not uncommon that upgrading it or some other Python packages on your machine would cause the documentation build to break.h]hMost distributions are shipped with Sphinx, but its toolchain is fragile, and it is not uncommon that upgrading it or some other Python packages on your machine would cause the documentation build to break.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK$hjhhubh)}(hXA way to avoid that is to use a different version than the one shipped with your distributions. In order to do so, it is recommended to install Sphinx inside a virtual environment, using ``virtualenv-3`` or ``virtualenv``, depending on how your distribution packaged Python 3.h](hA way to avoid that is to use a different version than the one shipped with your distributions. In order to do so, it is recommended to install Sphinx inside a virtual environment, using }(hjhhhNhNubh)}(h``virtualenv-3``h]h virtualenv-3}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh or }(hjhhhNhNubh)}(h``virtualenv``h]h virtualenv}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh7, depending on how your distribution packaged Python 3.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK(hjhhubhnote)}(h#) It is recommended to use the RTD theme for html output. Depending on the Sphinx version, it should be installed separately, with ``pip install sphinx_rtd_theme``.h]henumerated_list)}(hhh]h list_item)}(hIt is recommended to use the RTD theme for html output. Depending on the Sphinx version, it should be installed separately, with ``pip install sphinx_rtd_theme``.h]h)}(hIt is recommended to use the RTD theme for html output. Depending on the Sphinx version, it should be installed separately, with ``pip install sphinx_rtd_theme``.h](hIt is recommended to use the RTD theme for html output. Depending on the Sphinx version, it should be installed separately, with }(hjXhhhNhNubh)}(h ``pip install sphinx_rtd_theme``h]hpip install sphinx_rtd_theme}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXubh.}(hjXhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK/hjTubah}(h]h ]h"]h$]h&]uh1jRhjOubah}(h]h ]h"]h$]h&]enumtypearabicprefixhsuffix)uh1jMhjIubah}(h]h ]h"]h$]h&]uh1jGhjhhhNhNubh)}(hPIn summary, if you want to install the latest version of Sphinx, you should do::h]hOIn summary, if you want to install the latest version of Sphinx, you should do:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjhhubh literal_block)}(h$ virtualenv sphinx_latest $ . sphinx_latest/bin/activate (sphinx_latest) $ pip install -r Documentation/sphinx/requirements.txth]h$ virtualenv sphinx_latest $ . sphinx_latest/bin/activate (sphinx_latest) $ pip install -r Documentation/sphinx/requirements.txt}hjsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1jhhhK6hjhhubh)}(hXAfter running ``. sphinx_latest/bin/activate``, the prompt will change, in order to indicate that you're using the new environment. If you open a new shell, you need to rerun this command to enter again at the virtual environment before building the documentation.h](hAfter running }(hjhhhNhNubh)}(h ``. sphinx_latest/bin/activate``h]h. sphinx_latest/bin/activate}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, the prompt will change, in order to indicate that you’re using the new environment. If you open a new shell, you need to rerun this command to enter again at the virtual environment before building the documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK:hjhhubh)}(hhh](h)}(h Image outputh]h Image output}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK@ubh)}(hThe kernel documentation build system contains an extension that handles images in both GraphViz and SVG formats (see :ref:`sphinx_kfigure`).h](hvThe kernel documentation build system contains an extension that handles images in both GraphViz and SVG formats (see }(hjhhhNhNubh)}(h:ref:`sphinx_kfigure`h]j)}(hjh]hsphinx_kfigure}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjsphinx_kfigureuh1hhhhKBhjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKBhjhhubh)}(hFor it to work, you need to install both GraphViz and ImageMagick packages. If those packages are not installed, the build system will still build the documentation, but won't include any images at the output.h]hFor it to work, you need to install both GraphViz and ImageMagick packages. If those packages are not installed, the build system will still build the documentation, but won’t include any images at the output.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKEhjhhubeh}(h] image-outputah ]h"] image outputah$]h&]uh1hhjhhhhhK@ubh)}(hhh](h)}(hPDF and LaTeX buildsh]hPDF and LaTeX builds}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhKKubh)}(hMSuch builds are currently supported only with Sphinx versions 2.4 and higher.h]hMSuch builds are currently supported only with Sphinx versions 2.4 and higher.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhj(hhubh)}(hJFor PDF and LaTeX output, you'll also need ``XeLaTeX`` version 3.14159265.h](h-For PDF and LaTeX output, you’ll also need }(hjGhhhNhNubh)}(h ``XeLaTeX``h]hXeLaTeX}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh version 3.14159265.}(hjGhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKOhj(hhubh)}(hDepending on the distribution, you may also need to install a series of ``texlive`` packages that provide the minimal set of functionalities required for ``XeLaTeX`` to work.h](hHDepending on the distribution, you may also need to install a series of }(hjghhhNhNubh)}(h ``texlive``h]htexlive}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhjgubhG packages that provide the minimal set of functionalities required for }(hjghhhNhNubh)}(h ``XeLaTeX``h]hXeLaTeX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjgubh to work.}(hjghhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKQhj(hhubeh}(h]pdf-and-latex-buildsah ]h"]pdf and latex buildsah$]h&]uh1hhjhhhhhKKubh)}(hhh](h)}(hMath Expressions in HTMLh]hMath Expressions in HTML}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKVubh)}(hX@Some ReST pages contain math expressions. Due to the way Sphinx works, those expressions are written using LaTeX notation. There are two options for Sphinx to render math expressions in html output. One is an extension called `imgmath`_ which converts math expressions into images and embeds them in html pages. The other is an extension called `mathjax`_ which delegates math rendering to JavaScript capable web browsers. The former was the only option for pre-6.1 kernel documentation and it requires quite a few texlive packages including amsfonts and amsmath among others.h](hSome ReST pages contain math expressions. Due to the way Sphinx works, those expressions are written using LaTeX notation. There are two options for Sphinx to render math expressions in html output. One is an extension called }(hjhhhNhNubh)}(h `imgmath`_h]himgmath}(hjhhhNhNubah}(h]h ]h"]h$]h&]nameimgmathhYhttps://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.imgmathuh1hhjhKubhm which converts math expressions into images and embeds them in html pages. The other is an extension called }(hjhhhNhNubh)}(h `mathjax`_h]hmathjax}(hjhhhNhNubah}(h]h ]h"]h$]h&]namemathjaxhYhttps://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathjaxuh1hhjhKubh which delegates math rendering to JavaScript capable web browsers. The former was the only option for pre-6.1 kernel documentation and it requires quite a few texlive packages including amsfonts and amsmath among others.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKXhjhhubh)}(hSince kernel release 6.1, html pages with math expressions can be built without installing any texlive packages. See `Choice of Math Renderer`_ for further info.h](huSince kernel release 6.1, html pages with math expressions can be built without installing any texlive packages. See }(hjhhhNhNubh)}(h`Choice of Math Renderer`_h]hChoice of Math Renderer}(hjhhhNhNubah}(h]h ]h"]h$]h&]nameChoice of Math Rendererhchoice-of-math-rendereruh1hhjhKubh for further info.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKchjhhubh)}(hf.. _imgmath: https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.imgmathh]h}(h]imgmathah ]h"]imgmathah$]h&]hjuh1hhKghjhhhhjYKubh)}(hf.. _mathjax: https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathjaxh]h}(h]mathjaxah ]h"]mathjaxah$]h&]hjuh1hhKhhjhhhhjYKubh)}(h.. _sphinx-pre-install:h]h}(h]h ]h"]h$]h&]hsphinx-pre-installuh1hhKjhjhhhhubeh}(h]math-expressions-in-htmlah ]h"]math expressions in htmlah$]h&]uh1hhjhhhhhKVubh)}(hhh](h)}(h Checking for Sphinx dependenciesh]h Checking for Sphinx dependencies}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8hhhhhKmubh)}(hThere's a script that automatically checks for Sphinx dependencies. If it can recognize your distribution, it will also give a hint about the install command line options for your distro::h]hThere’s a script that automatically checks for Sphinx dependencies. If it can recognize your distribution, it will also give a hint about the install command line options for your distro:}(hjIhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohj8hhubj)}(hX$ ./scripts/sphinx-pre-install Checking if the needed tools for Fedora release 26 (Twenty Six) are available Warning: better to also install "texlive-luatex85". You should run: sudo dnf install -y texlive-luatex85 /usr/bin/virtualenv sphinx_2.4.4 . sphinx_2.4.4/bin/activate pip install -r Documentation/sphinx/requirements.txt Can't build as 1 mandatory dependency is missing at ./scripts/sphinx-pre-install line 468.h]hX$ ./scripts/sphinx-pre-install Checking if the needed tools for Fedora release 26 (Twenty Six) are available Warning: better to also install "texlive-luatex85". You should run: sudo dnf install -y texlive-luatex85 /usr/bin/virtualenv sphinx_2.4.4 . sphinx_2.4.4/bin/activate pip install -r Documentation/sphinx/requirements.txt Can't build as 1 mandatory dependency is missing at ./scripts/sphinx-pre-install line 468.}hjWsbah}(h]h ]h"]h$]h&]jjuh1jhhhKshj8hhubh)}(hXBy default, it checks all the requirements for both html and PDF, including the requirements for images, math expressions and LaTeX build, and assumes that a virtual Python environment will be used. The ones needed for html builds are assumed to be mandatory; the others to be optional.h]hXBy default, it checks all the requirements for both html and PDF, including the requirements for images, math expressions and LaTeX build, and assumes that a virtual Python environment will be used. The ones needed for html builds are assumed to be mandatory; the others to be optional.}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8hhubh)}(h$It supports two optional parameters:h]h$It supports two optional parameters:}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj8hhubhdefinition_list)}(hhh](hdefinition_list_item)}(h%``--no-pdf`` Disable checks for PDF; h](hterm)}(h ``--no-pdf``h]h)}(hjh]h--no-pdf}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubh definition)}(hhh]h)}(hDisable checks for PDF;h]hDisable checks for PDF;}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hX``--no-virtualenv`` Use OS packaging for Sphinx instead of Python virtual environment. h](j)}(h``--no-virtualenv``h]h)}(hjh]h--no-virtualenv}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubj)}(hhh]h)}(hBUse OS packaging for Sphinx instead of Python virtual environment.h]hBUse OS packaging for Sphinx instead of Python virtual environment.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhhhKhjhhubeh}(h]h ]h"]h$]h&]uh1jhj8hhhhhNubeh}(h]( checking-for-sphinx-dependenciesj/eh ]h"]( checking for sphinx dependenciessphinx-pre-installeh$]h&]uh1hhjhhhhhKmexpect_referenced_by_name}jj%sexpect_referenced_by_id}j/j%subeh}(h](jid1eh ]h"](sphinx installsphinx_installeh$]h&]uh1hhhhhhhhKj }jjsj }jjsubh)}(hhh](h)}(h Sphinx Buildh]h Sphinx Build}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXThe usual way to generate the documentation is to run ``make htmldocs`` or ``make pdfdocs``. There are also other formats available: see the documentation section of ``make help``. The generated documentation is placed in format-specific subdirectories under ``Documentation/output``.h](h6The usual way to generate the documentation is to run }(hj+hhhNhNubh)}(h``make htmldocs``h]h make htmldocs}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+ubh or }(hj+hhhNhNubh)}(h``make pdfdocs``h]h make pdfdocs}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+ubhK. There are also other formats available: see the documentation section of }(hj+hhhNhNubh)}(h ``make help``h]h make help}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+ubhP. The generated documentation is placed in format-specific subdirectories under }(hj+hhhNhNubh)}(h``Documentation/output``h]hDocumentation/output}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+ubh.}(hj+hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX To generate documentation, Sphinx (``sphinx-build``) must obviously be installed. For PDF output you'll also need ``XeLaTeX`` and ``convert(1)`` from ImageMagick (https://www.imagemagick.org).\ [#ink]_ All of these are widely available and packaged in distributions.h](h#To generate documentation, Sphinx (}(hjhhhNhNubh)}(h``sphinx-build``h]h sphinx-build}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhB) must obviously be installed. For PDF output you’ll also need }(hjhhhNhNubh)}(h ``XeLaTeX``h]hXeLaTeX}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h``convert(1)``h]h convert(1)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh from ImageMagick (}(hjhhhNhNubh)}(hhttps://www.imagemagick.orgh]hhttps://www.imagemagick.org}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1hhjubh). }(hjhhhNhNubhfootnote_reference)}(h[#ink]_h]h1}(hjhhhNhNubah}(h]id2ah ]h"]h$]h&]autoKhinkdocnamejuh1jhjhKubhA All of these are widely available and packaged in distributions.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hTo pass extra options to Sphinx, you can use the ``SPHINXOPTS`` make variable. For example, use ``make SPHINXOPTS=-v htmldocs`` to get more verbose output.h](h1To pass extra options to Sphinx, you can use the }(hjhhhNhNubh)}(h``SPHINXOPTS``h]h SPHINXOPTS}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh! make variable. For example, use }(hjhhhNhNubh)}(h``make SPHINXOPTS=-v htmldocs``h]hmake SPHINXOPTS=-v htmldocs}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh to get more verbose output.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIt is also possible to pass an extra DOCS_CSS overlay file, in order to customize the html layout, by using the ``DOCS_CSS`` make variable.h](hpIt is also possible to pass an extra DOCS_CSS overlay file, in order to customize the html layout, by using the }(hj"hhhNhNubh)}(h ``DOCS_CSS``h]hDOCS_CSS}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj"ubh make variable.}(hj"hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hBy default, the "Alabaster" theme is used to build the HTML documentation; this theme is bundled with Sphinx and need not be installed separately. The Sphinx theme can be overridden by using the ``DOCS_THEME`` make variable.h](hBy default, the “Alabaster” theme is used to build the HTML documentation; this theme is bundled with Sphinx and need not be installed separately. The Sphinx theme can be overridden by using the }(hjBhhhNhNubh)}(h``DOCS_THEME``h]h DOCS_THEME}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBubh make variable.}(hjBhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXLThere is another make variable ``SPHINXDIRS``, which is useful when test building a subset of documentation. For example, you can build documents under ``Documentation/doc-guide`` by running ``make SPHINXDIRS=doc-guide htmldocs``. The documentation section of ``make help`` will show you the list of subdirectories you can specify.h](hThere is another make variable }(hjbhhhNhNubh)}(h``SPHINXDIRS``h]h SPHINXDIRS}(hjjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbubhl, which is useful when test building a subset of documentation. For example, you can build documents under }(hjbhhhNhNubh)}(h``Documentation/doc-guide``h]hDocumentation/doc-guide}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbubh by running }(hjbhhhNhNubh)}(h&``make SPHINXDIRS=doc-guide htmldocs``h]h"make SPHINXDIRS=doc-guide htmldocs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbubh. The documentation section of }(hjbhhhNhNubh)}(h ``make help``h]h make help}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbubh: will show you the list of subdirectories you can specify.}(hjbhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h>To remove the generated documentation, run ``make cleandocs``.h](h+To remove the generated documentation, run }(hjhhhNhNubh)}(h``make cleandocs``h]hmake cleandocs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubhfootnote)}(hHaving ``inkscape(1)`` from Inkscape (https://inkscape.org) as well would improve the quality of images embedded in PDF documents, especially for kernel releases 5.18 and later. h](hlabel)}(hhh]h1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjhhhNhNubh)}(hHaving ``inkscape(1)`` from Inkscape (https://inkscape.org) as well would improve the quality of images embedded in PDF documents, especially for kernel releases 5.18 and later.h](hHaving }(hjhhhNhNubh)}(h``inkscape(1)``h]h inkscape(1)}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh from Inkscape (}(hjhhhNhNubh)}(hhttps://inkscape.orgh]hhttps://inkscape.org}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurij uh1hhjubhw) as well would improve the quality of images embedded in PDF documents, especially for kernel releases 5.18 and later.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubeh}(h]jah ]h"]inkah$]h&]jajKjjuh1jhhhKhjhhubh)}(hhh](h)}(hChoice of Math Rendererh]hChoice of Math Renderer}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj'hhhhhKubh)}(h`Since kernel release 6.1, mathjax works as a fallback math renderer for html output.\ [#sph1_8]_h](hVSince kernel release 6.1, mathjax works as a fallback math renderer for html output. }(hj8hhhNhNubj)}(h [#sph1_8]_h]h2}(hj@hhhNhNubah}(h]id3ah ]h"]h$]h&]jKhsph1-8jjuh1jhj8hKubeh}(h]h ]h"]h$]h&]uh1hhhhKhj'hhubh)}(hGMath renderer is chosen depending on available commands as shown below:h]hGMath renderer is chosen depending on available commands as shown below:}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj'hhubhtable)}(hhh](h)}(hMath Renderer Choices for HTMLh]hMath Renderer Choices for HTML}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjfubhtgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1j|hjyubj})}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j|hjyubj})}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1j|hjyubhthead)}(hhh]hrow)}(hhh](hentry)}(hhh]h)}(h Math rendererh]h Math renderer}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hRequired commandsh]hRequired commands}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h Image formath]h Image format}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjyubhtbody)}(hhh](j)}(hhh](j)}(hhh]h)}(himgmathh]himgmath}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h latex, dvipngh]h latex, dvipng}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h PNG (raster)h]h PNG (raster)}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj/ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hmathjaxh]hmathjax}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjOubah}(h]h ]h"]h$]h&]uh1jhjLubj)}(hhh]h}(h]h ]h"]h$]h&]uh1jhjLubj)}(hhh]h}(h]h ]h"]h$]h&]uh1jhjLubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjyubeh}(h]h ]h"]h$]h&]colsKuh1jwhjfubeh}(h]id4ah ]h"]h$]h&]uh1jdhj'hhhhhNubh)}(hbThe choice can be overridden by setting an environment variable ``SPHINX_IMGMATH`` as shown below:h](h@The choice can be overridden by setting an environment variable }(hjhhhNhNubh)}(h``SPHINX_IMGMATH``h]hSPHINX_IMGMATH}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh as shown below:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj'hhubje)}(hhh](h)}(h$Effect of Setting ``SPHINX_IMGMATH``h](hEffect of Setting }(hjhhhNhNubh)}(h``SPHINX_IMGMATH``h]hSPHINX_IMGMATH}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubjx)}(hhh](j})}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j|hjubj})}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j|hjubj)}(hhh]j)}(hhh](j)}(hhh]h)}(hSettingh]hSetting}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hRendererh]hRenderer}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h``SPHINX_IMGMATH=yes``h]h)}(hj3 h]hSPHINX_IMGMATH=yes}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1 ubah}(h]h ]h"]h$]h&]uh1hhhhKhj. ubah}(h]h ]h"]h$]h&]uh1jhj+ ubj)}(hhh]h)}(himgmathh]himgmath}(hjQ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjN ubah}(h]h ]h"]h$]h&]uh1jhj+ ubeh}(h]h ]h"]h$]h&]uh1jhj( ubj)}(hhh](j)}(hhh]h)}(h``SPHINX_IMGMATH=no``h]h)}(hjs h]hSPHINX_IMGMATH=no}(hju hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjq ubah}(h]h ]h"]h$]h&]uh1hhhhKhjn ubah}(h]h ]h"]h$]h&]uh1jhjk ubj)}(hhh]h)}(hmathjaxh]hmathjax}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jhjk ubeh}(h]h ]h"]h$]h&]uh1jhj( ubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jwhjubeh}(h]id5ah ]h"]h$]h&]uh1jdhj'hhhhhNubj)}(h2Fallback of math renderer requires Sphinx >=1.8. h](j)}(hhh]h2}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj hhhNhNubh)}(h0Fallback of math renderer requires Sphinx >=1.8.h]h0Fallback of math renderer requires Sphinx >=1.8.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubeh}(h]jOah ]h"]sph1_8ah$]h&]jJajKjjuh1jhhhKhj'hhubeh}(h]jah ]h"]choice of math rendererah$]h&]uh1hhjhhhhhKjYKubeh}(h] sphinx-buildah ]h"] sphinx buildah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hWriting Documentationh]hWriting Documentation}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhKubh)}(h-Adding new documentation can be as simple as:h]h-Adding new documentation can be as simple as:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj hhubjN)}(hhh](jS)}(h:Add a new ``.rst`` file somewhere under ``Documentation``.h]h)}(hj h](h Add a new }(hj hhhNhNubh)}(h``.rst``h]h.rst}(hj! hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh file somewhere under }(hj hhhNhNubh)}(h``Documentation``h]h Documentation}(hj3 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubjS)}(hMRefer to it from the Sphinx main `TOC tree`_ in ``Documentation/index.rst``. h]h)}(hLRefer to it from the Sphinx main `TOC tree`_ in ``Documentation/index.rst``.h](h!Refer to it from the Sphinx main }(hjU hhhNhNubh)}(h `TOC tree`_h]hTOC tree}(hj] hhhNhNubah}(h]h ]h"]h$]h&]nameTOC treeh7http://www.sphinx-doc.org/en/stable/markup/toctree.htmluh1hhjU hKubh in }(hjU hhhNhNubh)}(h``Documentation/index.rst``h]hDocumentation/index.rst}(hjr hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjU ubh.}(hjU hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjQ ubah}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubeh}(h]h ]h"]h$]h&]jjjhj.uh1jMhj hhhhhKubh)}(hE.. _TOC tree: http://www.sphinx-doc.org/en/stable/markup/toctree.htmlh]h}(h]toc-treeah ]h"]toc treeah$]h&]hjm uh1hhKhj hhhhjYKubh)}(hXThis is usually good enough for simple documentation (like the one you're reading right now), but for larger documents it may be advisable to create a subdirectory (or use an existing one). For example, the graphics subsystem documentation is under ``Documentation/gpu``, split to several ``.rst`` files, and has a separate ``index.rst`` (with a ``toctree`` of its own) referenced from the main index.h](hThis is usually good enough for simple documentation (like the one you’re reading right now), but for larger documents it may be advisable to create a subdirectory (or use an existing one). For example, the graphics subsystem documentation is under }(hj hhhNhNubh)}(h``Documentation/gpu``h]hDocumentation/gpu}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh, split to several }(hj hhhNhNubh)}(h``.rst``h]h.rst}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh files, and has a separate }(hj hhhNhNubh)}(h ``index.rst``h]h index.rst}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh (with a }(hj hhhNhNubh)}(h ``toctree``h]htoctree}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh, of its own) referenced from the main index.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hSee the documentation for `Sphinx`_ and `reStructuredText`_ on what you can do with them. In particular, the Sphinx `reStructuredText Primer`_ is a good place to get started with reStructuredText. There are also some `Sphinx specific markup constructs`_.h](hSee the documentation for }(hj hhhNhNubh)}(h `Sphinx`_h]hSphinx}(hj hhhNhNubah}(h]h ]h"]h$]h&]nameSphinxhhuh1hhj hKubh and }(hj hhhNhNubh)}(h`reStructuredText`_h]hreStructuredText}(hj hhhNhNubah}(h]h ]h"]h$]h&]namereStructuredTexthhuh1hhj hKubh9 on what you can do with them. In particular, the Sphinx }(hj hhhNhNubh)}(h`reStructuredText Primer`_h]hreStructuredText Primer}(hj) hhhNhNubah}(h]h ]h"]h$]h&]namereStructuredText Primerh-http://www.sphinx-doc.org/en/stable/rest.htmluh1hhj hKubhK is a good place to get started with reStructuredText. There are also some }(hj hhhNhNubh)}(h$`Sphinx specific markup constructs`_h]h!Sphinx specific markup constructs}(hj> hhhNhNubah}(h]h ]h"]h$]h&]name!Sphinx specific markup constructsh5http://www.sphinx-doc.org/en/stable/markup/index.htmluh1hhj hKubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj hhubh)}(hJ.. _reStructuredText Primer: http://www.sphinx-doc.org/en/stable/rest.htmlh]h}(h]restructuredtext-primerah ]h"]restructuredtext primerah$]h&]hj9 uh1hhKhj hhhhjYKubh)}(h\.. _Sphinx specific markup constructs: http://www.sphinx-doc.org/en/stable/markup/index.htmlh]h}(h]!sphinx-specific-markup-constructsah ]h"]!sphinx specific markup constructsah$]h&]hjN uh1hhKhj hhhhjYKubh)}(hhh](h)}(h0Specific guidelines for the kernel documentationh]h0Specific guidelines for the kernel documentation}(hjt hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjq hhhhhKubh)}(h?Here are some specific guidelines for the kernel documentation:h]h?Here are some specific guidelines for the kernel documentation:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjq hhubh bullet_list)}(hhh](jS)}(hPlease don't go overboard with reStructuredText markup. Keep it simple. For the most part the documentation should be plain text with just enough consistency in formatting that it can be converted to other formats. h]h)}(hPlease don't go overboard with reStructuredText markup. Keep it simple. For the most part the documentation should be plain text with just enough consistency in formatting that it can be converted to other formats.h]hPlease don’t go overboard with reStructuredText markup. Keep it simple. For the most part the documentation should be plain text with just enough consistency in formatting that it can be converted to other formats.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubjS)}(hgPlease keep the formatting changes minimal when converting existing documentation to reStructuredText. h]h)}(hfPlease keep the formatting changes minimal when converting existing documentation to reStructuredText.h]hfPlease keep the formatting changes minimal when converting existing documentation to reStructuredText.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubjS)}(hQAlso update the content, not just the formatting, when converting documentation. h]h)}(hPAlso update the content, not just the formatting, when converting documentation.h]hPAlso update the content, not just the formatting, when converting documentation.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubah}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubjS)}(hXPPlease stick to this order of heading adornments: 1. ``=`` with overline for document title:: ============== Document title ============== 2. ``=`` for chapters:: Chapters ======== 3. ``-`` for sections:: Section ------- 4. ``~`` for subsections:: Subsection ~~~~~~~~~~ Although RST doesn't mandate a specific order ("Rather than imposing a fixed number and order of section title adornment styles, the order enforced will be the order as encountered."), having the higher levels the same overall makes it easier to follow the documents. h](h)}(h1Please stick to this order of heading adornments:h]h1Please stick to this order of heading adornments:}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj ubjN)}(hhh](jS)}(h]``=`` with overline for document title:: ============== Document title ============== h](h)}(h(``=`` with overline for document title::h](h)}(h``=``h]h=}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh" with overline for document title:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj ubj)}(h,============== Document title ==============h]h,============== Document title ==============}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhKhj ubeh}(h]h ]h"]h$]h&]uh1jRhj ubjS)}(h,``=`` for chapters:: Chapters ======== h](h)}(h``=`` for chapters::h](h)}(h``=``h]h=}(hj. hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj* ubh for chapters:}(hj* hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj& ubj)}(hChapters ========h]hChapters ========}hjF sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj& ubeh}(h]h ]h"]h$]h&]uh1jRhj ubjS)}(h*``-`` for sections:: Section ------- h](h)}(h``-`` for sections::h](h)}(h``-``h]h-}(hjb hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^ ubh for sections:}(hj^ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjZ ubj)}(hSection -------h]hSection -------}hjz sbah}(h]h ]h"]h$]h&]jjuh1jhhhM hjZ ubeh}(h]h ]h"]h$]h&]uh1jRhj ubjS)}(h3``~`` for subsections:: Subsection ~~~~~~~~~~ h](h)}(h``~`` for subsections::h](h)}(h``~``h]h~}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh for subsections:}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM hj ubj)}(hSubsection ~~~~~~~~~~h]hSubsection ~~~~~~~~~~}hj sbah}(h]h ]h"]h$]h&]jjuh1jhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jRhj ubeh}(h]h ]h"]h$]h&]jjjhjj uh1jMhj ubh)}(hX Although RST doesn't mandate a specific order ("Rather than imposing a fixed number and order of section title adornment styles, the order enforced will be the order as encountered."), having the higher levels the same overall makes it easier to follow the documents.h]hXAlthough RST doesn’t mandate a specific order (“Rather than imposing a fixed number and order of section title adornment styles, the order enforced will be the order as encountered.”), having the higher levels the same overall makes it easier to follow the documents.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj ubeh}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubjS)}(hXTFor inserting fixed width text blocks (for code examples, use case examples, etc.), use ``::`` for anything that doesn't really benefit from syntax highlighting, especially short snippets. Use ``.. code-block:: `` for longer code blocks that benefit from highlighting. For a short snippet of code embedded in the text, use \`\`. h]h)}(hXRFor inserting fixed width text blocks (for code examples, use case examples, etc.), use ``::`` for anything that doesn't really benefit from syntax highlighting, especially short snippets. Use ``.. code-block:: `` for longer code blocks that benefit from highlighting. For a short snippet of code embedded in the text, use \`\`.h](hXFor inserting fixed width text blocks (for code examples, use case examples, etc.), use }(hj hhhNhNubh)}(h``::``h]h::}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhe for anything that doesn’t really benefit from syntax highlighting, especially short snippets. Use }(hj hhhNhNubh)}(h``.. code-block:: ``h]h.. code-block:: }(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhs for longer code blocks that benefit from highlighting. For a short snippet of code embedded in the text, use ``.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj ubah}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubeh}(h]h ]h"]h$]h&]bullet*uh1j hhhKhjq hhubeh}(h]0specific-guidelines-for-the-kernel-documentationah ]h"]0specific guidelines for the kernel documentationah$]h&]uh1hhj hhhhhKubh)}(hhh](h)}(h The C domainh]h The C domain}(hj+ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj( hhhhhMubh)}(haThe **Sphinx C Domain** (name c) is suited for documentation of C API. E.g. a function prototype:h](hThe }(hj9 hhhNhNubhstrong)}(h**Sphinx C Domain**h]hSphinx C Domain}(hjC hhhNhNubah}(h]h ]h"]h$]h&]uh1jA hj9 ubhJ (name c) is suited for documentation of C API. E.g. a function prototype:}(hj9 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM!hj( hhubj)}(h0.. c:function:: int ioctl( int fd, int request )h]h0.. c:function:: int ioctl( int fd, int request )}hj[ sbah}(h]h ]h"]h$]h&]jjforcelanguagersthighlight_args}uh1jhhhM$hj( hhubh)}(hThe C domain of the kernel-doc has some additional features. E.g. you can *rename* the reference name of a function with a common name like ``open`` or ``ioctl``:h](hJThe C domain of the kernel-doc has some additional features. E.g. you can }(hjn hhhNhNubhemphasis)}(h*rename*h]hrename}(hjx hhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjn ubh: the reference name of a function with a common name like }(hjn hhhNhNubh)}(h``open``h]hopen}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjn ubh or }(hjn hhhNhNubh)}(h ``ioctl``h]hioctl}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjn ubh:}(hjn hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM(hj( hhubj)}(hL.. c:function:: int ioctl( int fd, int request ) :name: VIDIOC_LOG_STATUSh]hL.. c:function:: int ioctl( int fd, int request ) :name: VIDIOC_LOG_STATUS}hj sbah}(h]h ]h"]h$]h&]jjji jj rstjl }uh1jhhhM,hj( hhubh)}(hThe func-name (e.g. ioctl) remains in the output but the ref-name changed from ``ioctl`` to ``VIDIOC_LOG_STATUS``. The index entry for this function is also changed to ``VIDIOC_LOG_STATUS``.h](hOThe func-name (e.g. ioctl) remains in the output but the ref-name changed from }(hj hhhNhNubh)}(h ``ioctl``h]hioctl}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh to }(hj hhhNhNubh)}(h``VIDIOC_LOG_STATUS``h]hVIDIOC_LOG_STATUS}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh7. The index entry for this function is also changed to }(hj hhhNhNubh)}(h``VIDIOC_LOG_STATUS``h]hVIDIOC_LOG_STATUS}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM1hj( hhubh)}(hXPlease note that there is no need to use ``c:func:`` to generate cross references to function documentation. Due to some Sphinx extension magic, the documentation build system will automatically turn a reference to ``function()`` into a cross reference if an index entry for the given function name exists. If you see ``c:func:`` use in a kernel document, please feel free to remove it.h](h)Please note that there is no need to use }(hjhhhNhNubh)}(h ``c:func:``h]hc:func:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh to generate cross references to function documentation. Due to some Sphinx extension magic, the documentation build system will automatically turn a reference to }(hjhhhNhNubh)}(h``function()``h]h function()}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhZ into a cross reference if an index entry for the given function name exists. If you see }(hjhhhNhNubh)}(h ``c:func:``h]hc:func:}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh9 use in a kernel document, please feel free to remove it.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM5hj( hhubeh}(h] the-c-domainah ]h"] the c domainah$]h&]uh1hhj hhhhhMubh)}(hhh](h)}(hTablesh]hTables}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjThhhhhM=ubh)}(hReStructuredText provides several options for table syntax. Kernel style for tables is to prefer *simple table* syntax or *grid table* syntax. See the `reStructuredText user reference for table syntax`_ for more details.h](haReStructuredText provides several options for table syntax. Kernel style for tables is to prefer }(hjehhhNhNubjw )}(h*simple table*h]h simple table}(hjmhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjeubh syntax or }(hjehhhNhNubjw )}(h *grid table*h]h grid table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjeubh syntax. See the }(hjehhhNhNubh)}(h3`reStructuredText user reference for table syntax`_h]h0reStructuredText user reference for table syntax}(hjhhhNhNubah}(h]h ]h"]h$]h&]name0reStructuredText user reference for table syntaxhBhttps://docutils.sourceforge.io/docs/user/rst/quickref.html#tablesuh1hhjehKubh for more details.}(hjehhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM?hjThhubh)}(h{.. _reStructuredText user reference for table syntax: https://docutils.sourceforge.io/docs/user/rst/quickref.html#tablesh]h}(h]0restructuredtext-user-reference-for-table-syntaxah ]h"]0restructuredtext user reference for table syntaxah$]h&]hjuh1hhMChjThhhhjYKubh)}(hhh](h)}(h list tablesh]h list tables}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMGubh)}(hX%The list-table formats can be useful for tables that are not easily laid out in the usual Sphinx ASCII-art formats. These formats are nearly impossible for readers of the plain-text documents to understand, though, and should be avoided in the absence of a strong justification for their use.h]hX%The list-table formats can be useful for tables that are not easily laid out in the usual Sphinx ASCII-art formats. These formats are nearly impossible for readers of the plain-text documents to understand, though, and should be avoided in the absence of a strong justification for their use.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMIhjhhubh)}(hfThe ``flat-table`` is a double-stage list similar to the ``list-table`` with some additional features:h](hThe }(hjhhhNhNubh)}(h``flat-table``h]h flat-table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh' is a double-stage list similar to the }(hjhhhNhNubh)}(h``list-table``h]h list-table}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh with some additional features:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMOhjhhubj )}(hhh](jS)}(hWcolumn-span: with the role ``cspan`` a cell can be extended through additional columns h]h)}(hVcolumn-span: with the role ``cspan`` a cell can be extended through additional columnsh](hcolumn-span: with the role }(hjhhhNhNubh)}(h ``cspan``h]hcspan}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh2 a cell can be extended through additional columns}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMRhj ubah}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubjS)}(hQrow-span: with the role ``rspan`` a cell can be extended through additional rows h]h)}(hProw-span: with the role ``rspan`` a cell can be extended through additional rowsh](hrow-span: with the role }(hj:hhhNhNubh)}(h ``rspan``h]hrspan}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj:ubh/ a cell can be extended through additional rows}(hj:hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMUhj6ubah}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubjS)}(hX auto span rightmost cell of a table row over the missing cells on the right side of that table-row. With Option ``:fill-cells:`` this behavior can changed from *auto span* to *auto fill*, which automatically inserts (empty) cells instead of spanning the last cell. h]h)}(hX auto span rightmost cell of a table row over the missing cells on the right side of that table-row. With Option ``:fill-cells:`` this behavior can changed from *auto span* to *auto fill*, which automatically inserts (empty) cells instead of spanning the last cell.h](hqauto span rightmost cell of a table row over the missing cells on the right side of that table-row. With Option }(hjdhhhNhNubh)}(h``:fill-cells:``h]h :fill-cells:}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjdubh this behavior can changed from }(hjdhhhNhNubjw )}(h *auto span*h]h auto span}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjdubh to }(hjdhhhNhNubjw )}(h *auto fill*h]h auto fill}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjdubhN, which automatically inserts (empty) cells instead of spanning the last cell.}(hjdhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMXhj`ubah}(h]h ]h"]h$]h&]uh1jRhj hhhhhNubeh}(h]h ]h"]h$]h&]j j uh1j hhhMRhjhhubh)}(hoptions:h]hoptions:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hjhhubj )}(hhh](jS)}(h.``:header-rows:`` [int] count of header rowsh]h)}(hjh](h)}(h``:header-rows:``h]h :header-rows:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh [int] count of header rows}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM_hjubah}(h]h ]h"]h$]h&]uh1jRhjhhhhhNubjS)}(h/``:stub-columns:`` [int] count of stub columnsh]h)}(hjh](h)}(h``:stub-columns:``h]h:stub-columns:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh [int] count of stub columns}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM`hjubah}(h]h ]h"]h$]h&]uh1jRhjhhhhhNubjS)}(h8``:widths:`` [[int] [int] ... ] widths of columnsh]h)}(hjh](h)}(h ``:widths:``h]h:widths:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, [[int] [int] ... ] widths of columns}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMahjubah}(h]h ]h"]h$]h&]uh1jRhjhhhhhNubjS)}(hQ``:fill-cells:`` instead of auto-spanning missing cells, insert missing cells h]h)}(hP``:fill-cells:`` instead of auto-spanning missing cells, insert missing cellsh](h)}(h``:fill-cells:``h]h :fill-cells:}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj8ubh@ instead of auto-spanning missing cells, insert missing cells}(hj8hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMbhj4ubah}(h]h ]h"]h$]h&]uh1jRhjhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1j hhhM_hjhhubh)}(hroles:h]hroles:}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhjhhubj )}(hhh](jS)}(h1``:cspan:`` [int] additional columns (*morecols*)h]h)}(hjsh](h)}(h ``:cspan:``h]h:cspan:}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuubh [int] additional columns (}(hjuhhhNhNubjw )}(h *morecols*h]hmorecols}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjuubh)}(hjuhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMfhjqubah}(h]h ]h"]h$]h&]uh1jRhjnhhhhhNubjS)}(h/``:rspan:`` [int] additional rows (*morerows*) h]h)}(h.``:rspan:`` [int] additional rows (*morerows*)h](h)}(h ``:rspan:``h]h:rspan:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh [int] additional rows (}(hjhhhNhNubjw )}(h *morerows*h]hmorerows}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMghjubah}(h]h ]h"]h$]h&]uh1jRhjnhhhhhNubeh}(h]h ]h"]h$]h&]j j uh1j hhhMfhjhhubh)}(hXGThe example below shows how to use this markup. The first level of the staged list is the *table-row*. In the *table-row* there is only one markup allowed, the list of the cells in this *table-row*. Exceptions are *comments* ( ``..`` ) and *targets* (e.g. a ref to ``:ref:`last row ``` / :ref:`last row `).h](h[The example below shows how to use this markup. The first level of the staged list is the }(hjhhhNhNubjw )}(h *table-row*h]h table-row}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh . In the }(hjhhhNhNubjw )}(h *table-row*h]h table-row}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubhA there is only one markup allowed, the list of the cells in this }(hjhhhNhNubjw )}(h *table-row*h]h table-row}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh. Exceptions are }(hjhhhNhNubjw )}(h *comments*h]hcomments}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh ( }(hjhhhNhNubh)}(h``..``h]h..}(hj6hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh ) and }(hjhhhNhNubjw )}(h *targets*h]htargets}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh (e.g. a ref to }(hjhhhNhNubh)}(h``:ref:`last row ```h]h:ref:`last row `}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh / }(hjhhhNhNubh)}(h:ref:`last row `h]j)}(hjnh]hlast row}(hjphhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjlubah}(h]h ]h"]h$]h&]refdocj refdomainjzreftyperef refexplicitrefwarnjlast rowuh1hhhhMihjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMihjhhubj)}(hX&.. flat-table:: table title :widths: 2 1 1 3 * - head col 1 - head col 2 - head col 3 - head col 4 * - row 1 - field 1.1 - field 1.2 with autospan * - row 2 - field 2.1 - :rspan:`1` :cspan:`1` field 2.2 - 3.3 * .. _`last row`: - row 3h]hX&.. flat-table:: table title :widths: 2 1 1 3 * - head col 1 - head col 2 - head col 3 - head col 4 * - row 1 - field 1.1 - field 1.2 with autospan * - row 2 - field 2.1 - :rspan:`1` :cspan:`1` field 2.2 - 3.3 * .. _`last row`: - row 3}hjsbah}(h]h ]h"]h$]h&]jjji jj rstjl }uh1jhhhMohjhhubh)}(h Rendered as:h]h Rendered as:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh block_quote)}(hX'.. flat-table:: table title :widths: 2 1 1 3 * - head col 1 - head col 2 - head col 3 - head col 4 * - row 1 - field 1.1 - field 1.2 with autospan * - row 2 - field 2.1 - :rspan:`1` :cspan:`1` field 2.2 - 3.3 * .. _`last row`: - row 3 h]je)}(hhh](h)}(h table titleh]h table title}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubjx)}(hhh](j})}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j|hjubj})}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j|hjubj})}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j|hjubj})}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j|hjubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h head col 1h]h head col 1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h head col 2h]h head col 2}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h head col 3h]h head col 3}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj*ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h head col 4h]h head col 4}(hjDhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjAubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hrow 1h]hrow 1}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjaubah}(h]h ]h"]h$]h&]uh1jhj^ubj)}(hhh]h)}(h field 1.1h]h field 1.1}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjxubah}(h]h ]h"]h$]h&]uh1jhj^ubj)}(hhh]h)}(hfield 1.2 with autospanh]hfield 1.2 with autospan}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]morecolsKuh1jhj^ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(hrow 2h]hrow 2}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h field 2.1h]h field 2.1}(hjhhhNhNuba]\h}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h%:rspan:`1` :cspan:`1` field 2.2 - 3.3h](h }(hjhhhNhNubh field 2.2 - 3.3}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]morerowsKmorecolsKuh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh](h)}(h.. _`last row`:h]h}(h]h ]h"]h$]h&]hlast-rowuh1hhMhjubh)}(hrow 3h]hrow 3}(hjhhhNhNubah}(h]jah ]h"]last rowah$]h&]uh1hhhhMhjj }jjsj }jjsubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jwhjubeh}(h]id6ah ]h"]h$]h&]uh1jdhjubah}(h]h ]h"]h$]h&]uh1jhhhMhjhhubeh}(h] list-tablesah ]h"] list tablesah$]h&]uh1hhjThhhhhMGubeh}(h]tablesah ]h"]tablesah$]h&]uh1hhj hhhhhM=ubh)}(hhh](h)}(hCross-referencingh]hCross-referencing}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhhhhhMubh)}(hXCross-referencing from one documentation page to another can be done simply by writing the path to the document file, no special syntax required. The path can be either absolute or relative. For absolute paths, start it with "Documentation/". For example, to cross-reference to this page, all the following are valid options, depending on the current document's directory (note that the ``.rst`` extension is required)::h](hXCross-referencing from one documentation page to another can be done simply by writing the path to the document file, no special syntax required. The path can be either absolute or relative. For absolute paths, start it with “Documentation/”. For example, to cross-reference to this page, all the following are valid options, depending on the current document’s directory (note that the }(hjshhhNhNubh)}(h``.rst``h]h.rst}(hj{hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjsubh extension is required):}(hjshhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjbhhubj)}(hSee Documentation/doc-guide/sphinx.rst. This always works. Take a look at sphinx.rst, which is at this same directory. Read ../sphinx.rst, which is one directory above.h]hSee Documentation/doc-guide/sphinx.rst. This always works. Take a look at sphinx.rst, which is at this same directory. Read ../sphinx.rst, which is one directory above.}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhMhjbhhubh)}(hIf you want the link to have a different rendered text other than the document's title, you need to use Sphinx's ``doc`` role. For example::h](huIf you want the link to have a different rendered text other than the document’s title, you need to use Sphinx’s }(hjhhhNhNubh)}(h``doc``h]hdoc}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh role. For example:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjbhhubj)}(h`.h]h`.}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhMhjbhhubh)}(hFor most use cases, the former is preferred, as it is cleaner and more suited for people reading the source files. If you come across a ``:doc:`` usage that isn't adding any value, please feel free to convert it to just the document path.h](hFor most use cases, the former is preferred, as it is cleaner and more suited for people reading the source files. If you come across a }(hjhhhNhNubh)}(h ``:doc:``h]h:doc:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh_ usage that isn’t adding any value, please feel free to convert it to just the document path.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjbhhubh)}(hrFor information on cross-referencing to kernel-doc functions or types, see Documentation/doc-guide/kernel-doc.rst.h]hrFor information on cross-referencing to kernel-doc functions or types, see Documentation/doc-guide/kernel-doc.rst.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjbhhubh)}(hhh](h)}(hReferencing commitsh]hReferencing commits}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hmReferences to git commits are automatically hyperlinked given that they are written in one of these formats::h]hlReferences to git commits are automatically hyperlinked given that they are written in one of these formats:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hYcommit 72bf4f1767f0 commit 72bf4f1767f0 ("net: do not leave an empty skb in write queue")h]hYcommit 72bf4f1767f0 commit 72bf4f1767f0 ("net: do not leave an empty skb in write queue")}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhMhjhhubh)}(h.. _sphinx_kfigure:h]h}(h]h ]h"]h$]h&]hsphinx-kfigureuh1hhMhjhhhhubeh}(h]referencing-commitsah ]h"]referencing commitsah$]h&]uh1hhjbhhhhhMubeh}(h]cross-referencingah ]h"]cross-referencingah$]h&]uh1hhj hhhhhMubeh}(h]writing-documentationah ]h"]writing documentationah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hFigures & Imagesh]hFigures & Images}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjMhhhhhMubh)}(hIf you want to add an image, you should use the ``kernel-figure`` and ``kernel-image`` directives. E.g. to insert a figure with a scalable image format, use SVG (:ref:`svg_image_example`)::h](h0If you want to add an image, you should use the }(hj^hhhNhNubh)}(h``kernel-figure``h]h kernel-figure}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^ubh and }(hj^hhhNhNubh)}(h``kernel-image``h]h kernel-image}(hjxhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^ubhL directives. E.g. to insert a figure with a scalable image format, use SVG (}(hj^hhhNhNubh)}(h:ref:`svg_image_example`h]j)}(hjh]hsvg_image_example}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjsvg_image_exampleuh1hhhhMhj^ubh):}(hj^hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubj)}(hT.. kernel-figure:: svg_image.svg :alt: simple SVG image SVG image exampleh]hT.. kernel-figure:: svg_image.svg :alt: simple SVG image SVG image example}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhMhjMhhubh)}(h.. _svg_image_example:h]h}(h]h ]h"]h$]h&]hsvg-image-exampleuh1hhMhjMhhhhubkfigure kernel_figure)}(hhh]hfigure)}(hhh](himage)}(hU.. kernel-figure:: svg_image.svg :alt: simple SVG image SVG image example h]h}(h]h ]h"]h$]h&]altsimple SVG imageuridoc-guide/svg_image.svg candidates}j jsuh1jhjhhhKubhcaption)}(hSVG image exampleh]hSVG image example}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubeh}(h]id7ah ]h"]h$]h&]uh1jhjubah}(h]jah ]h"]svg_image_exampleah$]h&]uh1jhjMhhhhhNj }jjsj }jjsubh)}(hMThe kernel figure (and image) directive supports **DOT** formatted files, seeh](h1The kernel figure (and image) directive supports }(hj hhhNhNubjB )}(h**DOT**h]hDOT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jA hj ubh formatted files, see}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubj )}(hhh](jS)}(h)DOT: http://graphviz.org/pdf/dotguide.pdfh]h)}(hj/h](hDOT: }(hj1hhhNhNubh)}(h$http://graphviz.org/pdf/dotguide.pdfh]h$http://graphviz.org/pdf/dotguide.pdf}(hj8hhhNhNubah}(h]h ]h"]h$]h&]refurij:uh1hhj1ubeh}(h]h ]h"]h$]h&]uh1hhhhMhj-ubah}(h]h ]h"]h$]h&]uh1jRhj*hhhhhNubjS)}(h7Graphviz: http://www.graphviz.org/content/dot-language h]h)}(h6Graphviz: http://www.graphviz.org/content/dot-languageh](h Graphviz: }(hjWhhhNhNubh)}(h,http://www.graphviz.org/content/dot-languageh]h,http://www.graphviz.org/content/dot-language}(hj_hhhNhNubah}(h]h ]h"]h$]h&]refurijauh1hhjWubeh}(h]h ]h"]h$]h&]uh1hhhhMhjSubah}(h]h ]h"]h$]h&]uh1jRhj*hhhhhNubeh}(h]h ]h"]h$]h&]j j uh1j hhhMhjMhhubh)}(h*A simple example (:ref:`hello_dot_file`)::h](hA simple example (}(hjhhhNhNubh)}(h:ref:`hello_dot_file`h]j)}(hjh]hhello_dot_file}(hjhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjhello_dot_fileuh1hhhhMhjubh):}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubj)}(hS.. kernel-figure:: hello.dot :alt: hello world DOT's hello world exampleh]hS.. kernel-figure:: hello.dot :alt: hello world DOT's hello world example}hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhMhjMhhubh)}(h.. _hello_dot_file:h]h}(h]h ]h"]h$]h&]hhello-dot-fileuh1hhMhjMhhhhubj)}(hhh]j)}(hhh](j)}(hT.. kernel-figure:: hello.dot :alt: hello world DOT's hello world example h]h}(h]h ]h"]h$]h&]alt hello worlduridoc-guide/hello.dotj}j jsuh1jhjhhhKubj)}(hDOT's hello world exampleh]hDOT’s hello world example}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhhhMhjubeh}(h]id8ah ]h"]h$]h&]uh1jhjubah}(h]jah ]h"]hello_dot_fileah$]h&]uh1jhjMhhhhhNj }jjsj }jjsubh)}(htEmbedded *render* markups (or languages) like Graphviz's **DOT** are provided by the ``kernel-render`` directives.::h](h Embedded }(hjhhhNhNubjw )}(h*render*h]hrender}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh* markups (or languages) like Graphviz’s }(hjhhhNhNubjB )}(h**DOT**h]hDOT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jA hjubh are provided by the }(hjhhhNhNubh)}(h``kernel-render``h]h kernel-render}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh directives.:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubj)}(h.. kernel-render:: DOT :alt: foobar digraph :caption: Embedded **DOT** (Graphviz) code digraph foo { "bar" -> "baz"; }h]h.. kernel-render:: DOT :alt: foobar digraph :caption: Embedded **DOT** (Graphviz) code digraph foo { "bar" -> "baz"; }}hjBsbah}(h]h ]h"]h$]h&]jjuh1jhhhMhjMhhubh)}(hHow this will be rendered depends on the installed tools. If Graphviz is installed, you will see a vector image. If not, the raw markup is inserted as *literal-block* (:ref:`hello_dot_render`).h](hHow this will be rendered depends on the installed tools. If Graphviz is installed, you will see a vector image. If not, the raw markup is inserted as }(hjPhhhNhNubjw )}(h*literal-block*h]h literal-block}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjPubh (}(hjPhhhNhNubh)}(h:ref:`hello_dot_render`h]j)}(hjlh]hhello_dot_render}(hjnhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjjubah}(h]h ]h"]h$]h&]refdocj refdomainjxreftyperef refexplicitrefwarnjhello_dot_renderuh1hhhhMhjPubh).}(hjPhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubh)}(h.. _hello_dot_render:h]h}(h]h ]h"]h$]h&]hhello-dot-renderuh1hhMhjMhhhhubj)}(hhh](j kernel_render)}(hhh]j)}(h"digraph foo { "bar" -> "baz"; }h]h"digraph foo { "bar" -> "baz"; }}hjsbah}(h]h ]h"]h$]h&]jjuh1jhjhhubah}(h]h ]h"]h$]h&]altfoobar digraphsrclangDOTuh1jhjubj)}(h Embedded **DOT** (Graphviz) codeh](h Embedded }(hjhhhNhNubjB )}(h**DOT**h]hDOT}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jA hjubh (Graphviz) code}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubeh}(h](id9jeh ]h"]hello_dot_renderah$]h&]altjcaptionjuh1jhjMhhhhhNj }jjsj }jjsubh)}(hXThe *render* directive has all the options known from the *figure* directive, plus option ``caption``. If ``caption`` has a value, a *figure* node is inserted. If not, an *image* node is inserted. A ``caption`` is also needed, if you want to refer to it (:ref:`hello_svg_render`).h](hThe }(hjhhhNhNubjw )}(h*render*h]hrender}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh. directive has all the options known from the }(hjhhhNhNubjw )}(h*figure*h]hfigure}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh directive, plus option }(hjhhhNhNubh)}(h ``caption``h]hcaption}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. If }(hjhhhNhNubh)}(h ``caption``h]hcaption}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh has a value, a }(hjhhhNhNubjw )}(h*figure*h]hfigure}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh node is inserted. If not, an }(hjhhhNhNubjw )}(h*image*h]himage}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1jv hjubh node is inserted. A }(hjhhhNhNubh)}(h ``caption``h]hcaption}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh- is also needed, if you want to refer to it (}(hjhhhNhNubh)}(h:ref:`hello_svg_render`h]j)}(hjsh]hhello_svg_render}(hjuhhhNhNubah}(h]h ](jstdstd-refeh"]h$]h&]uh1jhjqubah}(h]h ]h"]h$]h&]refdocj refdomainjreftyperef refexplicitrefwarnjhello_svg_renderuh1hhhhMhjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubh)}(hEmbedded **SVG**::h](h Embedded }(hjhhhNhNubjB )}(h**SVG**h]hSVG}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jA hjubh:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjMhhubj)}(h.. kernel-render:: SVG :caption: Embedded **SVG** markup :alt: so-nw-arrow ... h]h.. kernel-render:: SVG :caption: Embedded **SVG** markup :alt: so-nw-arrow ... }hjsbah}(h]h ]h"]h$]h&]jjuh1jhhhMhjMhhubh)}(h.. _hello_svg_render:h]h}(h]h ]h"]h$]h&]hhello-svg-renderuh1hhMhjMhhhhubj)}(hhh](j)}(hhh]j)}(hX? h]hX? }hjsbah}(h]h ]h"]h$]h&]jjuh1jhjhhubah}(h]h ]h"]h$]h&]j so-nw-arrowjSVGuh1jhjubj)}(hEmbedded **SVG** markuph](h Embedded }(hjhhhNhNubjB )}(h**SVG**h]hSVG}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jA hjubh markup}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1jhhhKhjubeh}(h](id10jeh ]h"]hello_svg_renderah$]h&]captionjaltjuh1jhjMhhhhhNj }jjsj }jjsubeh}(h](figures-imagesj4eh ]h"](figures & imagessphinx_kfigureeh$]h&]uh1hhhhhhhhMj }j"j*sj }j4j*subeh}(h](%using-sphinx-for-kernel-documentationheh ]h"](%using sphinx for kernel documentation sphinxdoceh$]h&]uh1hhhhhhhhKj }j-hsj }hhsubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjTerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}(sphinx](hj erestructuredtext](hj eimgmath]jamathjax]jachoice of math renderer]jaink]jasph1_8]j@atoc tree]j] arestructuredtext primer]j) a!sphinx specific markup constructs]j> a0restructuredtext user reference for table syntax]jaurefids}(h]haj]jaj/]j%aj]jaj4]j*aj]jaj]jaj]jaj]jaj]jajO]j@aunameids}(j-hj,j)jVjSjcj`jjjjj%j"jjj5j2jjj"jjj/jjj j j$jj jj jOjJjGj j jb j_ jn jk j% j" jQjNj_j\jjjWjTjjjBj?j:j7j"j4j!jjjjjjjjju nametypes}(j-j,jVjcjjj%jj5jj"jjj j$j j jJj jb jn j% jQj_jjWjjBj:j"j!jjjjuh}(hhj)hjSjMj`jZjjjjj"jjj(j2jjj jjj/j8jj8j jjjjjjj'jJj@jOj jGj j j j_ jY jk je j" jq jNj( j\jTjjjTjjjj?jbj7jj4jMjjMjjjjjjjjjjfj jjGjjjjjjjjju footnote_refs}(j]jaj]j@au citation_refs} autofootnotes](jj eautofootnote_refs](jj@esymbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}jbK sRparse_messages]transform_messages](hsystem_message)}(hhh]h)}(hhh]h/Hyperlink target "sphinxdoc" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1jubj)}(hhh]h)}(hhh]h4Hyperlink target "sphinx-install" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineKuh1jubj)}(hhh]h)}(hhh]h8Hyperlink target "sphinx-pre-install" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineKjuh1jubj)}(hhh]h)}(hhh]h.Hyperlink target "last-row" is not referenced.}hj/sbah}(h]h ]h"]h$]h&]uh1hhj,ubah}(h]h ]h"]h$]h&]levelKtypejlineMsourcehuh1jubj)}(hhh]h)}(hhh]h4Hyperlink target "sphinx-kfigure" is not referenced.}hjIsbah}(h]h ]h"]h$]h&]uh1hhjFubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineMuh1jubj)}(hhh]h)}(hhh]h7Hyperlink target "svg-image-example" is not referenced.}hjcsbah}(h]h ]h"]h$]h&]uh1hhj`ubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineMuh1jubj)}(hhh]h)}(hhh]h4Hyperlink target "hello-dot-file" is not referenced.}hj}sbah}(h]h ]h"]h$]h&]uh1hhjzubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineMuh1jubj)}(hhh]h)}(hhh]h6Hyperlink target "hello-dot-render" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineMuh1jubj)}(hhh]h)}(hhh]h6Hyperlink target "hello-svg-render" is not referenced.}hjsbah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]levelKtypejsourcehlineMuh1jube transformerN include_log] decorationNhhub.