07/08/2024 15:12, Juraj Linkeš:
> On 7. 8. 2024 14:27, Thomas Monjalon wrote:
> > 07/08/2024 14:03, Juraj Linkeš:
> >> On 7. 8. 2024 12:41, Thomas Monjalon wrote:
> >>> 06/08/2024 17:19, Juraj Linkeš:
> >>>> --- /dev/null
> >>>> +++ b/doc/api/dts/custom.css
> >>>> @@ -0,0 +1 @@
> >>>> +../../guides/custom.css
> >>>> \ No newline at end of file
> >>>
> >>> Is it a link? Why?
> >>>
> >>
> >> call-sphinx-build.py copies the custom.css file. I added a link to
> >> preserve the look.
> >>
> >>>> +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)
> >>>
> >>> When custom.css is copied?
> >>
> >> I'm not sure what you're asking here. The call-sphinx-build.py copies it
> >> during the build and it's also copied during the install phase.
> > 
> > The file is copied in _static dir of sphinx guides.
> > How does it work for DTS API?
> 
> It works the same way. shutil.copyfile (which is used to copy the file) 
> follows symlinks, so DTS API gets a copy in its _static dir 
> (doc/api/dts/html/_static/css).
> I did it this way to preserve the style in case there's something in the 
> css file that applies to both DPDK and DTS API docs.

Oh yes.
I wrote it 2 weeks ago and already forgot it works with any sphinx path.


> >>>> +# Napoleon enables the Google format of Python doscstrings, used in DTS.
> >>>> +# Intersphinx allows linking to external projects, such as Python docs, 
> >>>> also used in DTS.
> >>>> +extensions = ['sphinx.ext.napoleon', 'sphinx.ext.intersphinx']
> >>>
> >>> What happens if napoleon and intersphinx are not available
> >>> when building basic DPDK doc without DTS?
> >>
> >> napoleon was added in version 1.3 and intersphinx in 0.5, so I didn't
> >> think of testing that.
> >>
> >> I tried adding a non-existent extension to the list and got this error:
> >> Extension error:
> >> Could not import extension sphinx.ext.foo (exception: No module named
> >> 'sphinx.ext.foo')
> >>
> >> I could add version checks for each of the extensions.
> > 
> > My concern is to allow generating DPDK doc without DTS,
> > without the new extra dependencies.
> > 
> 
> Ok, I think putting all of these into the DTS if branch ("if 
> environ.get('DTS_BUILD'):") would make sense then.

OK


Reply via email to