Looks good to me, I just had a few comments about copyright lines but
the actual functionality seems like it's there to me:

Reviewed-by: Jeremy Spewock <jspew...@iol.unh.edu>

On Thu, Aug 8, 2024 at 4:55 AM Juraj Linkeš <juraj.lin...@pantheon.tech> wrote:
>
> The tool used to generate DTS API docs is Sphinx, which is already in
> use in DPDK. The same configuration is used to preserve style with one
> DTS-specific configuration (so that the DPDK docs are unchanged) that
> modifies how the sidebar displays the content. There's other Sphinx
> configuration related to Python docstrings which doesn't affect DPDK doc
> build. All new configuration is in a conditional block, applied only
> when DTS API docs are built to not interfere with DPDK doc build.
>
> Sphinx generates the documentation from Python docstrings. The docstring
> format is the Google format [0] which requires the sphinx.ext.napoleon
> extension. The other extension, sphinx.ext.intersphinx, enables linking
> to objects in external documentations, such as the Python documentation.
>
> There is one requirement for building DTS docs - the same Python version
> as DTS or higher, because Sphinx's autodoc extension imports the code.
>
> The dependencies needed to import the code don't have to be satisfied,
> as the autodoc extension allows us to mock the imports. The missing
> packages are taken from the DTS pyproject.toml file.
>
> And finally, the DTS API docs can be accessed from the DPDK API doxygen
> page.
>
> [0] 
> https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
>
> Signed-off-by: Juraj Linkeš <juraj.lin...@pantheon.tech>
<snip>
> --- /dev/null
> +++ b/doc/api/dts/meson.build
> @@ -0,0 +1,29 @@
> +# SPDX-License-Identifier: BSD-3-Clause
> +# Copyright(c) 2023 PANTHEON.tech s.r.o.

Should this be 2023 or updated now that we're in 2024? Probably
doesn't matter too much either way.

> +
> +sphinx = find_program('sphinx-build', required: get_option('enable_docs'))
> +if not sphinx.found()
> +    subdir_done()
> +endif
> +
> +python_ver_satisfied = run_command(get_dts_runtime_deps, check: 
> false).returncode()
> +if python_ver_satisfied != 0
> +    subdir_done()
> +endif
> +
> +extra_sphinx_args = ['-E', '-c', join_paths(doc_source_dir, 'guides')]
> +if get_option('werror')
> +    extra_sphinx_args += '-W'
> +endif
> +
> +htmldir = join_paths(get_option('datadir'), 'doc', 'dpdk', 'dts')
> +dts_api_html = custom_target('dts_api_html',
> +        output: 'html',
> +        command: [sphinx_wrapper, sphinx, meson.project_version(),
> +            meson.current_source_dir(), meson.current_build_dir(), 
> extra_sphinx_args],
> +        build_by_default: get_option('enable_docs'),
> +        install: get_option('enable_docs'),
> +        install_dir: htmldir)
> +
> +dts_doc_targets += dts_api_html
> +dts_doc_target_names += 'DTS_API_HTML'
> diff --git a/doc/api/meson.build b/doc/api/meson.build
> index 5b50692df9..788129336b 100644
> --- a/doc/api/meson.build
> +++ b/doc/api/meson.build
> @@ -1,6 +1,18 @@
>  # SPDX-License-Identifier: BSD-3-Clause
>  # Copyright(c) 2018 Luca Boccassi <bl...@debian.org>
>

Should you add your copyright to the top of this file now that you've
also modified it?

> +dts_doc_targets = []
> +dts_doc_target_names = []
> +subdir('dts')
> +
> +if dts_doc_targets.length() == 0
> +    dts_message = 'No DTS docs targets found'
> +else
> +    dts_message = 'Building DTS docs:'
> +endif
> +run_target('dts-doc', command: [echo, dts_message, dts_doc_target_names],
> +    depends: dts_doc_targets)
> +
>  doxygen = find_program('doxygen', required: get_option('enable_docs'))
>
>  if not doxygen.found()
> @@ -40,6 +52,7 @@ cdata.set('WARN_AS_ERROR', 'NO')
>  if get_option('werror')
>      cdata.set('WARN_AS_ERROR', 'YES')
>  endif
> +cdata.set('DTS_API_MAIN_PAGE', join_paths('..', 'dts', 'html', 'index.html'))
>
>  # configure HTML Doxygen run
>  html_cdata = configuration_data()
> diff --git a/doc/guides/conf.py b/doc/guides/conf.py
> index 0f7ff5282d..d7f3030838 100644
> --- a/doc/guides/conf.py
<snip>
>

Reply via email to