Commit Graph

38 Commits

Author SHA1 Message Date
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é 66fbf35435 doc: remove readthedocs-sphinx-search CSS rules
The "Sphinx search extension" CSS rules are not needed as we are not
using this extension since we are not hosting on readthedocs.io.

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
Benjamin Cabé cce77c8902 doc: latex: enable pdflscape package
Enable the pdflscape package (available in the Latex distros recommended
 for Zephyr) to allow for some pages to be rendered in landscape mode.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-24 09:22:44 +01:00
Benjamin Cabé df6a9f2d30 doc: css: fix dark theme for gui roles
Fix dark theme issues with guilabel and menuselection roles.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-09 10:23:31 +00:00
Benjamin Cabé 677219ff1a doc: Allow to control wrapping behavior per table
Backport a useful CSS rule from Godot that allows to have *all* cells of
a table to wrap. This can be useful for list-tables in particular,
where otherwise the first column don't wrap.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-23 14:32:39 +02:00
Benjamin Cabé f8398fda02 doc: css: fix text color for toggle buttons in related samples
Missed this usability issue earlier. This makes the text and icon in
collapsible admonition the same color as the admonition title.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-13 09:15:34 +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é 30b59483fb Revert "doc: Update requirements-doc.txt to use docleaf"
This reverts commit 30c3ce4a92.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-24 09:19:37 +01:00
Michael Jones 30c3ce4a92 doc: Update requirements-doc.txt to use docleaf
Instead of breathe.

I'm not sure of the best version comparison to use. There is no
intention to break the API for docleaf but it is also still young
in some ways and there might be adjustments to the configuration values
that would need to be reflected in the version number as it is still
pre-1.0 that would only be a minor version change.

Signed-off-by: Michael Jones <m.pricejones@gmail.com>
2023-07-03 10:05:52 +00:00
Benjamin Cabé 376c82f8eb doc: Fix CSS issue with keyboard shortcuts on dark theme
Fixes CSS styling issue causing keyboard shortcuts to sometimes not be
visible (white text on white background) using dark theme.
Fixes #55126.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-02-23 17:45:40 +01: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
Carles Cufi 3fea29d7c5 readme: Add support for light/dark modes in the logo
Use the mechanism described here:
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#specifying-the-theme-an-image-is-shown-to

to provide different logos for light and dark mode, so that the "Zephyr"
text is clearly visible in both.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-11-18 08:58:59 +01:00
Stephanos Ioannidis 62770eb9c0 doc: Update PDF documentation Zephyr logo
This commit replaces the Zephyr logo for the PDF documentations with
the new registered trademark version.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-06 00:02:55 +09:00
Stephanos Ioannidis 29f06ca29b doc: Update HTML documentation Zephyr logo
This commit replaces the Zephyr logo for the HTML documentations with
the new registered trademark version.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-06 00:02:55 +09:00
Stephanos Ioannidis 2999db065f readme: Update Zephyr logo
This commit replaces the Zephyr logo for the README page with the new
registered trademark version.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-06 00:02:55 +09:00
Gerard Marull-Paretas f1d2e567a7 doc: fix figure style CSS selector
The CSS classes used by figures in docutils has changed in recent
versions. Adjust CSS so that figures are centered again by default.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-25 15:05:27 -07:00
Gerard Marull-Paretas d5e0102772 doc: readme: make logo text gray
The logo did not display black text when using the Github light theme in
a system configured to prefer dark mode. An alternative solution: just
make text grayish (#4e4e4e) so that it looks "ok" in both light and dark
modes.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 19:38:11 -05:00
Gerard Marull-Paretas 5838c4d9b9 readme: make README logo dark-mode aware
Use an SVG based logo with embedded style that toggles title color using
media queries. The SVG logo is not exactly the same as the previous one
as I only had this version in SVG (taken from docs actually).

Note that we cannot use the method described in
https://github.blog/changelog/
2021-11-24-specify-theme-context-for-images-in-markdown/ because the
README is written in rst, not Markdown.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-15 19:47:48 +01:00
Gerard Marull-Paretas f08279901d doc: css: update code documentation directives style
New Sphinx version (or docutils) has slightly changed the output format
for code documentation directives. These changes try to mimic previous
behavior, even though it does not achieve 100% equal result. In some
cases the new default style does not require further tweaks, and in some
others styling as before is not possible.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-05 14:38:24 +01:00
Gerard Marull-Paretas 05284cfe17 doc: style admonitions
Only certain type of admonitions were styled (e.g. notes, warnings,
etc.). This change also styles generic admonitions such as:

```rst
... admonition:: Rationale

    ...
```

Fixes #40622

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-03 13:20:27 +01:00
Gerard Marull-Paretas 8b3f23eddc doc: fix dark-mode-toggle style
- Use designated CSS parts to style the toggle properly
- Use breadcrumbs_aside block to render dark mode toggle

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-10-26 17:00:56 +02:00
Gerard Marull-Paretas 2f5a9d033d doc: improve latex look and feel
This patch improves the general look and feel of the LaTeX (PDF)
documentation build. Changes include:

- A custom title with relevant information has been created
- Some colors have been adjusted to match those in the web template
- Charter font family is used

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-22 19:37:03 +03:00
Gerard Marull-Paretas 049b444752 readme: add missing logo
Logo was accidentally deleted as part of some docs cleanup. Add it back
with a new name making it more explicit that it belongs to the readme.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-21 10:37:37 -05:00
Gerard Marull-Paretas 1cecfe7348 doc: move favicon to static folder
Similar to other assets, e.g. logo, move favicon to the static folder.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-19 20:06:00 -04:00
Gerard Marull-Paretas ab0eebca13 doc: css: fix sphinx tabs style issues
Flag Sphinx tabs style properties as !important, it looks like the
default style used by the latest extension version take precedence.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-06-14 06:55:02 -04:00
Gerard Marull-Paretas baf11138c5 doc: css: fix versions menu style
Versions menu dl > dt background color was not correct.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-21 06:22:24 -05:00
Gerard Marull-Paretas ad7e3e1281 doc: css: remove images black border
Remove the black border present on images.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-21 06:22:24 -05:00
Gerard Marull-Paretas 3cddd87522 doc: css: add auto overflow on admonitions
Setting overflow:auto adds a scrollbar to admonitions if the content
overflows. Some adminitions overflow specially on mobile devices.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-19 16:48:39 -04:00
Gerard Marull-Paretas 7040aa86bb doc: css: improve C constructs spacing
With current CSS construct like void f() are rendered together, i.e.
voidf(). Add some spacing to make it more like "void f()".

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-19 16:48:39 -04:00
Gerard Marull-Paretas 073c8cf849 doc: remove scrolling customizations
The scrolling customizations were used to hide the logo when scrolling
down. With this change, logo is always displayed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-19 16:48:39 -04:00
Gerard Marull-Paretas f0d3db29ed doc: show logo only
Since logo already brings to home page, remove the link displayed above.
It saves some vertical pixels while making docs nicer. Also adjusted
wy-menu-vertical max-height to account for the new height (note: was
wrong before).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-19 16:48:39 -04:00
Gerard Marull-Paretas 9553e25844 doc: adjust scrolling settings
Some users reported issues on Windows regarding navigation bar title
location. Scroll values have been adjusted to fix the problem. Tested on
both Linux and Windows (Chromium/Firefox).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-21 14:47:16 -04:00
Gerard Marull-Paretas a6d8c232e0 doc: new look and feel
A new look and feel for the Zephyr documentation. It is largerly based
on the work done by Godot Engine docs, but with some Zephyr specific
customizations.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-04-20 19:17:15 +02:00
Gerard Marull-Paretas a4ea28236c doc: move all css files to _static/css
Move all CSS files to the _static/css subfolder.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-03-31 10:39:48 +02:00
Gerard Marull-Paretas bbab8152ce doc: move all js files to _static/js
Move all Javascript files to the _static/js subfolder.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-03-31 10:39:48 +02:00
Gerard Marull-Paretas 6b1a7faf92 doc: move static folder to _static
Move static content to _static. It is better to prefix all Sphinx
related folders with an underscore to emphasize that the folder does not
contain actual documentation. Static content gets copied into _static
folder when documentation is built, so it also makes things more
consistent.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-03-31 10:39:48 +02:00