Commit graph

221 commits

Author SHA1 Message Date
Benjamin Cabé 8f17c830ed doc: generate sitemap.xml
Generate a sitemap.xml for the documentation.
This aims at helping search engines react faster to the addition/removal
of new pages.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-04-03 12:34:04 +03:00
Ederson de Souza 9ab243d671 doc: Generate develop/api/overview.rst API table from doxygen
A new extension, api_overview.py, is used to, leveraging doxygen's
Python module doxmlparser, parse the doxygen generated XML files.
All groups ('defgroup' and 'addtogroup' tags) are collected, alongside
their 'version' and 'since' info.

From there, a new Sphinx directive `api-overview-table` is populated,
including the name of the group, and if available, their 'since' and
'version' information.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-03-19 13:13:45 +01:00
Christopher Friedt b14f7d00ca doc: lts: update conf.py to point at 2.7.6 (LTS)
Point the configuration at 2.7.6 (LTS).

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-03-02 06:21:25 -05:00
Maureen Helm ce38e4ba6f doc: release: Remove v3.4.0 from the list of supported releases
Only the two most recent mainline releases are supported.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-02-23 18:30:32 -06:00
Maureen Helm 7c7b5fbf8b doc: release: Add v3.6.0 to the list of supported releases
Adds v3.6.0 to the list of supported releases. The EOL date corresponds
to the expected release date for v4.0.0.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-02-23 18:30:32 -06:00
Fabio Baltieri 24cf2f6548 doc: use substitutions to replace all current harcoded SDK versions
This creates a set of substitution rules to replace all current usages
of SDK versions in the documentation, apart from a few that were not
meant to be copy-pastable anyway and the version has just been swapped
with a <version> placeholder.

Since code-block does not parse the content, these have all been
replaced with parsed-literal. That one though parses URLs, which cannot
be broken, so a series of URL substitutions are provided too.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-18 10:54:20 +01:00
Gerard Marull-Paretas 9e5e8e8c40 doc: extensions: zephyr-domain: make Breathe inserts optional
So that external users of the domain only interested in e.g. referencing
roles, can skip tweaks made to Breathe's directives.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-01-11 10:04:44 +01:00
Henrik Brix Andersen e2788525e0 doc: Update copyright notice in the documentation
Update copyright notice to reflect current year.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-05 14:43:47 -05:00
Benjamin Cabé 7e253ff937 doc: Make search engine configurable
Add UI to select preferred search engine when Google Programmable Search is
enabled. The user's preference is saved using local storage.

This also makes the search input field of type "search" for better UX (in
particular on mobile).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-12-15 04:34:48 -05:00
Benjamin Cabé 7688f4859c doc: Add Google Programmable Search Engine
Add Google Programmable Search engine to the documentation, while
leaving it possible to easily revert to the built-in Sphinx search
engine. As the styling of the search results is apparently not thought
to be easy to tweak, the gcs.css stylesheet might require further
improvements.
Fixes #55173.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-12-15 04:34:48 -05:00
Benjamin Cabé 29b19bcf8b doc: sphinx: Tweak page scroll behavior to maximize real estate
This picks up custom javscript from Godot documentation and uses CSS
rules we already had in place (only they were not used) to tweak the
page scroll behavior. As folks scroll down the page, the Zephyr logo in
the top right corner gradually disappears, leaving more room for the
navigation menu.

Also, when scrolling in the navigation pane, the UI there is slightly
adapted to make it more clear that the search box is "fixed", plus,
when one reaches the bottom of the navigation tree and continues
scrolling, the "main" page scrolls down.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-12-14 14:38:03 -05:00
Piotr Golyzniak 5a3b9799aa doc: test: improve pytest documentation
Improve documentation about pytest integration with Twister. Add
examples of usage, improve description of available options and
introduce automatic doc generation of two plugin classes (DeviceAdapter
and Shell) basing on their docstrings from source code.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2023-12-14 10:12:21 +01:00
Benjamin Cabé aa1ca171aa doc: sphinx: Load RTD theme as a Sphinx extension
This commit loads the RTD theme as a Sphinx extension, which has the
benefit of going through said extension's "setup" method, effectively
setting useful settings such as default permalink icon (moving away from
the default, not so pretty, "¶").

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-12-06 09:23:36 +00:00
Benjamin Cabé abc334016f doc: pdf: Use single column for the index
The index at the end of the PDF document can contain pretty long strings
that don't fit in the default 2-column layout.
This commit makes the index use a single-column.

Note: this relies on LaTeX package idxlayout which should already be
included in the packages recommended for installation in our
instructions.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-09 15:33:40 +01:00
Henrik Brix Andersen f811a05044 doc: releases: remove v3.3.0 from supported releases
As of October 31, 2023, Zephyr v3.3.0 is no longer supported.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-11-03 09:56:58 +01:00
Benjamin Cabé 353f42d8bd doc: refactor vcs_link and git_info extensions
Refactor all git/github related extensions into one file, as they are
working hand in hand.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-27 10:49:11 +02:00
Benjamin Cabé 701f59ee1e doc: Make it easier to report issues in the documentation
- Add extension to get git metadata (date, SHA-1, ...) regarding the
  latest update made to a page
- Add date of last "actual" update to each manually authored doc page
- Add admonition inviting to report issues
- Add button in breadcrumb to report issue

Fixes #60622.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-27 10:49:11 +02:00
Benjamin Cabé eb1968fa10 doc: extensions: Add ability to edit doc page on GitHub
Update the vcs_link extension to also support generating "edit" URL
vcs_link_version is also now a Sphinx config making its value available
to extensions.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-27 10:49:11 +02:00
Benjamin Cabé f2b080b5d6 doc: Set default language for syntax highlighting to "none"
Force code blocks with no 'language' explicitly set to render with no
highlighting. The current default was to use python (bad), and there
would also be an option to set it to "guess" but this doesn't work all
so well (ex. some C blocks would be detected as Transact-SQL!).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-23 14:32:39 +02:00
Johan Hedberg 0d907c7428 doc: add 3.5.0 to the index of releases
Add the new release to the doc index.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-10-20 13:20:49 +03:00
Benjamin Cabé 472def94e7 doc: use more modern fonts
Use Noto as baseline font and Inconsolata Nerd Font for source code.
These are both esthetically pleasing and have good Unicode coverage.

NOTE: Unsupported characters (i.e. emojis, at the time of this commit)
are rendered as tofu (i.e. a square).

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-19 21:03:57 +03:00
Benjamin Cabé 201b666ecb doc: use XeLaTeX as TeX typesetting engine
XeLaTeX is a TeX typesetting engine that extends LaTeX with support for
Unicode and modern font technologies such as OpenType.

It is included in all the LaTeX distro recommended for Zephyr so it is
safe to assume it is available to the user interested in building the
PDF documentation locally

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-19 21:03:57 +03:00
Benjamin Cabé d3487c48bf doc: Group linkcheck options together in conf.py
Group all sections related to linkcheck target together.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-18 17:08:19 +03:00
Benjamin Cabé b3a52f4882 doc: Configure copybutton extension for ignoring shell prompts
Add required settings for telling the copybutton Sphinx extension to
ignore prompts when copying a code block.

Both bash prompt and Zephyr UART prompt are ignored.

Examples of the new behavior:

.. code-block:: console

    $ echo "Hello World"
    Hello World

The copied text will be: 'echo "Hello World"'.

.. code-block:: console

   uart:~$ l2cap connect 29
   Chan sec: 1
   L2CAP connection pending
   Channel 0x20000210 connected
   Channel 0x20000210 status 1
   uart:~$ l2cap send 3 14
   Rem 2
   Rem 1
   Rem 0
   Outgoing data channel 0x20000210 transmitted
   Outgoing data channel 0x20000210 transmitted
   Outgoing data channel 0x20000210 transmitted

The copied text will be: 'l2cap connect 29\nl2cap send 3 14'.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-18 17:08:19 +03:00
Anas Nashif ebc8fdac4f doc: fix link to manifest listing and documentation
Point to the correct page referencing manifest entries.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-02 14:52:10 +02:00
Anas Nashif dd7532dcf9 doc: add manifest extension
Generate index of west projects and information about them.
Based on an extension from sdk-nrf repo.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-01 09:21:50 +03:00
Andrei Emeltchenko 0aaa5a9ac2 samples: webusb: Copy needed file from the external repository
Copy file index.html from the external repository
finikorg/webusb-sample.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-09-25 09:48:01 +02:00
Benjamin Cabé b2977b7657 doc: Make code-samples admonition collapsible
Use sphinx-toggle to make "Related code samples" collapsible.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-06 12:11:28 +02:00
Benjamin Cabé 3c5f3da4d8 doc: Add Sphinx extension for code samples
This adds a new Sphinx extension for both a code-sample directive and role.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-06 12:11:28 +02:00
Benjamin Cabé 69fcc52ce1 Revert "doc: Switch to using docleaf for doxygen entities"
This reverts commit 20986ec45d.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-24 09:19:37 +01:00
Benjamin Cabé 0e4ab8f083 Revert "doc: Adjust docleaf configuration as needed"
This reverts commit a3b7102273.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-24 09:19:37 +01:00
Benjamin Cabé ca2533aea1 doc: Drop Zephyr 2.2 from supported releases
As of June 30, 2023, Zephyr 3.2.0 is not supported anymore.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-14 09:30:48 -04:00
Gerard Marull-Paretas 7c418a065c doc: requirements: update Sphinx and rtd theme
rtd_theme 1.2.x is required when using Sphinx >= 6.0, otherwise certain
features like search are broken. Note that jQuery support needs to be
enabled manually now using `sphinxcontrib.jquery` extension. Also update
Sphinx to latest 6.x release, 6.2 as it contains some fixes.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-07-12 19:59:03 -04:00
Michael Jones a3b7102273 doc: Adjust docleaf configuration as needed
We make sure that we have the 'root' and 'xml' defined for the project
which is necessary at the moment for docleaf though the 'root' is only
really used for the 'linkcode' integration.

Signed-off-by: Michael Jones <m.pricejones@gmail.com>
2023-07-03 10:05:52 +00:00
Michael Jones 20986ec45d doc: Switch to using docleaf for doxygen entities
This switches the Sphinx conf.py file over to using the
'docleaf.doxygen' module and the associated docleaf configuration
entries, replacing the breathe module and config.

Signed-off-by: Michael Jones <m.pricejones@gmail.com>
2023-07-03 10:05:52 +00:00
Anas Nashif 79d610a893 doc: release: remove old version from index
Remove old releases from documentation index.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-16 13:29:34 -04:00
Anas Nashif 7ce8b5598c doc: update LTS2 version in docs
LTS is now 2.7.5.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-16 12:12:40 -04:00
Anas Nashif aa8c6aa067 doc: remove releases before 2.7 from index
Remove all old releases from the index.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-16 12:12:40 -04:00
Anas Nashif ee72dfa5e2 doc: add 3.4.0 to the index of releases
Add the new release to the doc index.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-16 12:12:40 -04:00
Marc Herbert 9d11943194 Revert "doc: enable figures enumeration" cause numfig is too slow
This reverts commit 4516117e9f.

A git bisect showed that the duration of an incremental build doubled
after this commit enabled `numfig=True`. Measurements shared and
discussed in #37572, #55708 and #56631 confirmed this. Here are yet more
measurements below in two different system configurations building docs
for very recent Zephyr commit b10817ba25 + all `:numref:` removed by
the previous commit. In other words these numbers show the cost of
`numfig=True` _without_ even using `:numref:`.

* Ubuntu 22, 8 cores
  sphinx-build --version 4.3.2

                           numfig=True   numfig=False

- from scratch             7 min 15 s       6 min 40 s

- one-line .rst change           48 s             24s

* Current Arch Linux, 72 cores
  sphinx-build --version 6.2.1

                           numfig=True   numfig=False

- from scratch              5 min 0 s      4 min 50 s

- one-line .rst change           37 s            18 s

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-22 11:08:53 +02:00
Carlo Caione de90dfccbc syscall: Introduce __syscall_always_inline
Sometimes we want to force the inlining of a __syscall. Introduce a new
__syscall_always_inline symbol to do that.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-04-20 14:56:09 -04:00
Marti Bolivar ee4b134dd6 doc: add snippets documentation
Document this new build system feature.

Since its purpose is customizing application builds, the logical place
for the main body of documentation is in a new snippets/ directory in
doc/build/. Create that directory and add its initial documentation.

Like boards and samples, however, we expect people to write
documentation for each snippet within the directory that defines the
snippet itself. Therefore, add a new top-level snippets/ directory and
stub out the documentation needed to document individual snippets as
well.

Add documentation and cross-references in other required places as
well.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Stephanos Ioannidis e62acf92d8 doc: conf: Add 3.3.0 release to version list
This commit adds the Zephyr 3.3.0 release to the documentation version
list.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-02-17 19:46:53 +09:00
Benjamin Cabé d1ec6f7aaf doc: set documentation base URL to /latest
Help search engines flag "latest" version of the documentation as
the canonical source by setting Sphinx's html_baseurl.
Fixes #54749.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-02-16 22:48:51 +09:00
Benjamin Cabé 3f009bd834 doc: Remove Google Analytics tracking code
This removes Google Analytics related code from the generated
documentation.
Fixes #54873

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-02-16 07:40:34 +09:00
Benjamin Cabé 0eb9c51f5a doc: Improve navigation towards LTS documentation.
Fixed the version selector so that it links to latest version of the LTS
release instead of 2.7.0.
Fixes #54786

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-02-14 14:02:12 +01:00
Benjamin Cabé a7dee148c3 doc: Update copyright notice in the documentation
Update copyright notice to reflect current year.
Fixes #54763.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-02-13 19:39:14 +09:00
Gaute Svanes Lunde 6acdb1b73a doc: extensions: add custom role 'module_file'
Added another custom role `module_file` which functions like
`zephyr_file` but for any module in the west manifest.

The new role must take a module as an argument. Example syntax:

```rst
:module_file:`module-name: path/within/module`
```

or with custom link text:

```rst
:module_file:`my link text <module-name: path/within/module>`
```

This change also moves the hardcoded project name and link to
github to `doc/conf.py` by adding the configuration values
`link_roles_manifest_project` and `link_roles_manifest_baseurl`

Signed-off-by: Gaute Svanes Lunde <gaute.lunde@nordicsemi.no>
2022-11-11 11:02:03 +01:00
Fabio Baltieri 896935066b doc: conf: add release version 3.2.0
Add release version 3.2.0 to the documentation version list.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-30 11:31:32 -05:00
Gerard Marull-Paretas 41566e2502 doc: add support for linkcheck
This patch adds support for the `linkcheck` Sphinx builder, so that we
can easily check for broken links in the documentation.

It can be run like this:

ninja linkcheck

Or, using the Makefile shim:

make linkcheck

All Zephyr Github issues links are ignored, since we have lots of these
URLs and they quickly hit GH rate limit. They have small chance to be
incorrect, so we should be ok.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-23 17:28:47 +00:00