mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
8756e68bff
OpenCV New Documentation #29206 This PR introduces end to end working new Documentation in OpenCV. Co-authored by: @abhishek-gola @omrope79 @Akansha-977 @Prasadayus @varun-jaiswal17 ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
37 lines
1.6 KiB
HTML
37 lines
1.6 KiB
HTML
{# Override of pydata_sphinx_theme's components/navbar-nav.html.
|
|
|
|
PyData's default renders both top-level toctree items AND the configured
|
|
external_links in one bar. For OpenCV we want ONLY this header nav (the
|
|
tutorial module tree belongs in the left sidebar, not the header), so we
|
|
render the `external_links` slot exclusively.
|
|
|
|
These are NOT external links: conf.py declares them via the theme's
|
|
`external_links` key only because that's the data slot for a custom header
|
|
nav. Each entry is one of:
|
|
* internal -> {"docname": "<docname>", "name": ...}
|
|
resolved with `pathto` so the relative URL is correct at ANY page depth
|
|
and points at the Sphinx-rendered page (landing, tutorials, module roots);
|
|
* external -> {"url": "<abs-url>", "name": ..., "external": true}
|
|
rendered verbatim and opened in a new tab (e.g. the Java docs, which
|
|
have no Sphinx equivalent).
|
|
|
|
Internal entries carry no target="_blank" / nav-external glyph since
|
|
navigation never leaves the site. #}
|
|
<nav>
|
|
<ul class="bd-navbar-elements navbar-nav">
|
|
{%- for link in (theme_external_links or []) %}
|
|
{%- if link.docname %}
|
|
{%- set _href = pathto(link.docname) %}
|
|
{%- set _external = false %}
|
|
{%- else %}
|
|
{%- set _href = link.url %}
|
|
{%- set _external = link.get('external', false) %}
|
|
{%- endif %}
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="{{ _href }}"
|
|
{%- if _external %} target="_blank" rel="noopener noreferrer"{% endif %}>{{ link.name }}</a>
|
|
</li>
|
|
{%- endfor %}
|
|
</ul>
|
|
</nav>
|