Commit Graph

1507 Commits

Author SHA1 Message Date
Manuel Kaufmann
5a263753d5
Run tests and build docs with Sphinx 8.2 (#1640)
* Run tests and build docs with Sphinx 8.2

* CircleCI job

* Update Read the Docs dependencies

* Update matrix

* Run tests with 3.13

* Use 8.x to build our docs
2025-02-20 11:22:56 +01:00
Benjamin Cabé
8d4d394dad
Sidebar should not be floating on mobile (#1622)
When sidebar is set to 100% width on mobile, it should also be switched
back to being non-floating.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-11-13 15:32:27 -08:00
Manuel Kaufmann
5f03347239 Release 3.0.2 2024-11-13 12:02:40 +01:00
Manuel Kaufmann
17c0685be9
Attached flyout: show the current translation (#1629)
* Attached flyout: show the current translation

Closes #1621

* Update sphinx_rtd_theme/static/js/versions.js_t
2024-11-13 11:56:19 +01:00
Manuel Kaufmann
5db7796b6e
Allow disabling selectors (#1626)
There was a bug with how we render a Python bool value into JavaScript.
This PR fixes that issue.

Closes #1620
2024-11-04 11:16:56 +01:00
Manuel Kaufmann
7b894f5e7a Release 3.0.1 2024-10-09 15:17:48 +02:00
Manuel Kaufmann
1f2439c7bf
Use black color for switcher options (#1615)
Closes #1614
2024-10-09 15:14:43 +02:00
Manuel Kaufmann
a1c2147b17 Release 3.0.0 2024-10-07 09:12:19 +02:00
Manuel Kaufmann
814686ee1f Release 3.0.0rc4 2024-10-02 13:54:28 +02:00
Manuel Kaufmann
5b181b89fb
Trigger search modal on "Search docs" input focus (#1610)
This is a regression introduced in
https://github.com/readthedocs/sphinx_rtd_theme/pull/1601

This PR triggers the search modal when clicking on the "Search docs" input from
- inside the flyout if present
- the top left navbar
2024-10-02 13:51:57 +02:00
Manuel Kaufmann
7deb68fe16 Release 3.0.0rc3 2024-09-26 13:52:32 +02:00
Manuel Kaufmann
036a3b2231
Show hidden version in selector if it's the current active version (#1609)
Closes #1608
2024-09-25 16:38:47 +02:00
Manuel Kaufmann
ccf31144c9
Release 3.0.0rc2 (#1607) 2024-09-23 10:38:18 +02:00
Manuel Kaufmann
4cab02fff8
Show version/language selectors below the title (#1601)
* Show version/language selectors below the title

* Use CSS styles from old attempt

https://github.com/readthedocs/sphinx_rtd_theme/pull/438

* Update CSS to apply to both selectors

* Prepend the current version if it's hidden

* Split it into two different configs

* Use correct value for language

* Make the selectors more prominent

* Typo fix on comment

* Update CSS

* Update JavaScript

* Always include the version javascript

* Only include the languages if there is one

* Change `display_version` default

* HTML layout rework

* Update docs

* HTML layout fix

* Docs typo

* Update CSS

* Updates from review

* re-compile CSS

* Update CSS

* Apply suggestions from code review

Co-authored-by: Eric Holscher <25510+ericholscher@users.noreply.github.com>

* Use the prettier to lint the file

* Whitespaces

* Update event listener

* Update CSS

* Update CSS

* Remove language switch if there are not translations

* Tune version and language selector styles (#1603)

* Tuning on select width and icon placement

* Use better cursor

* Add a max width to selects so that they can't overflow

* Only add after pseudo element if select exists

* Lint

* Debug: trigger Read the Docs Addons event to test/debug locally (#1606)

* Debug: trigger Read the Docs Addons event to test/debug locally

Closes #1605

* Push missing file

---------

Co-authored-by: Eric Holscher <25510+ericholscher@users.noreply.github.com>
Co-authored-by: Anthony <aj@ohess.org>
2024-09-20 20:01:11 +02:00
Manuel Kaufmann
9c75444a73
Docs: do not sign Git tag (#1596)
Closes #1593
2024-08-20 18:52:27 +02:00
Manuel Kaufmann
3a3473dc15
Release 3.0.0rc1 (#1597) 2024-08-20 13:34:51 +02:00
Manuel Kaufmann
6b587d1c67
Prepare for 3.0 release (#1576)
* Tests: `sphinxdev` tox environment installs Sphinx from `master`

It seems we had a bug in the name and it wasn't installing Sphinx from `master`.
I expect this test to fail now because we pin `Sphinx<8`, but that's fine for now.

* Prepare for 3.0 release

- Drop Python <3.8
- Drop docutils <=0.18
- Add support for docutils 0.21
- Add support for Python 3.12

This follows the plan we wrote in
https://sphinx-rtd-theme.readthedocs.io/en/stable/development.html#roadmap-release-3-0-0

The main idea here is to move forward with newer versions and drop support for
old stuffs so we reduce the maintanence burden.

* Update CircleCI matrix

* More fixes to CircleCI

* Run test over Sphinx 8.0

* Update contributing guide

* Remove deprecated `readthedocs-sphinx-ext`

* Remove old Sphinx versions

* Uninstall our extension

* Show a warning if `extra_css_files` is in the `html_context`

See https://github.com/readthedocs/sphinx_rtd_theme/pull/450

* Update development page

* Add deprecate warning for `analytics_` theme options

* Update docs

* Remove unused dependency

Closes #1533

* Remove environment variables from our docs

This was already added in a more generic way to the theme itself.

* Require Sphinx >=6.0

* Deprecation warning about `get_html_theme_path`

See https://github.com/readthedocs/sphinx_rtd_theme/pull/1479#issuecomment-2296317034
2024-08-20 13:18:34 +02:00
Manuel Kaufmann
768dcc1467
Docs: update the installation note (#1595)
* Docs: update the installation note

Translated string work with/without the theme added into the ``extensions``.
However, it's still required to be inside the extensions because of
``sphinxcontrib-jquery``.

I'm keeping the note, but changing it content.

* Update docs/installing.rst

Co-authored-by: Anthony <aj@ohess.org>

---------

Co-authored-by: Anthony <aj@ohess.org>
2024-08-20 12:07:28 +02:00
Manuel Kaufmann
2c19bb149b
Release 2.1.0rc2 (#1592) 2024-08-14 12:30:58 +02:00
Manuel Kaufmann
a359d40e28
Theme option flyout to enable/disable theme's flyout (#1580)
* Theme option `flyout` to enable/disable theme's flyout

Add a theme option to enable/disable the theme's flyout integrated at the bottom
left into the navigation bar.

Closes #1579

* Use `flyout_display` with `hidden` and `attached` as options

* Make `hidden` as `flyout_display`

* Update docs/configuring.rst

Co-authored-by: Eric Holscher <25510+ericholscher@users.noreply.github.com>

---------

Co-authored-by: Eric Holscher <25510+ericholscher@users.noreply.github.com>
2024-08-14 12:14:42 +02:00
Manuel Kaufmann
cf898d3acc
Populate html_context with READTHEDOCS_* environment variables (#1581)
* Populate `html_context` with `READTHEDOCS_*` environment variables

Closes #1578

* Typo
2024-08-01 19:18:37 +02:00
Manuel Kaufmann
42557430ef
Tests: sphinxdev tox environment installs Sphinx from master (#1575)
It seems we had a bug in the name and it wasn't installing Sphinx from `master`.
I expect this test to fail now because we pin `Sphinx<8`, but that's fine for now.
2024-07-25 12:14:52 +02:00
Manuel Kaufmann
5c72f6504f
Docs: update releasing (#1574)
* Docs: update releasing

* Use the pattern we already have

* Use tab :/
2024-07-25 12:14:27 +02:00
Manuel Kaufmann
68a89bb07e
Release 2.1.0rc1 (#1573)
I wasn't able to update translations because it fails with non-zero exit when
running `python setup.py update_translations`.
2024-07-23 11:21:33 +02:00
Karolina Surma
76a933b997
Adjust the expected test_basic output to match Sphinx 7.3+ (#1572)
The previous behavior was deemed a bug and fixed in
https://github.com/sphinx-doc/sphinx/pull/11970

Closes #1558

Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
2024-07-15 15:16:39 +02:00
Manuel Kaufmann
357e76dc42
Addons: integrate with new beta addons flyout (#1526)
* Addons: integrate with new beta addons flyout

Initial experimentation to use the `CustomEvent` triggered by the addons called
`readthedocsdataready` event (from
https://github.com/readthedocs/addons/pull/64/) to build the Read the Docs
flyout being integrated into the theme keeping the original look & feel.

* Related: https://github.com/readthedocs/addons/pull/64/
* Closes #1523

* `READTHEDOCS` variable has to be passed to the `html_context`

This is because we are not executing the Read the Docs magic that modifies the
`conf.py` file on the fly :/

* Update code to match the latest changes

* Use `.join` to avoid rendering the Array with `,`

* Update code to use the v1 API structure response

* Don't auto-remove the original flyout

This can be disabled per-project by using the settings UI from the dashboard.

* Join the values to avoid strange `,`s

* Support translations

Use the current pattern to translate string generated for the flyout.

* Remove HTML tags for testing

* Show "Search" section on flyout

* Render footer

* Add some styling

* TODO comments to work on

* add `div.injected`

* Apply suggestions from code review

Co-authored-by: Anthony <aj@ohess.org>

* Translate privacy policy

* Add `.rtd-current-item` class to selected version/language

* Refactor code to show sections only if there is content

* Epub instead of EPUB for backward compatibility

* Show the modal when clicking on the "Search docs" from navbar

* Remove privacy policy link from flyout

* Add UTM analytics

* Move CSS style into SASS file

* Move the `script` tag into its own file

* Rename JS file to mark it as a Sphinx template

* Build css/js files

Run `npm ci` and `npm run build` using NodeJS 14.20.1.

* Add the JS template in the package

---------

Co-authored-by: Anthony <aj@ohess.org>
2024-07-15 15:11:33 +02:00
Max Dudzinski
28c377f99a
Remove html5shiv (#1482)
* Fix typo

* Lock file changes after running 'npm install --lockfile-version 1' w/ Node 14

* Format file prior to change

* Remove the html5shiv JS package & all references to it

* Remove the copy-webpack-plugin JS package as no longer used

---------

Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
2024-01-25 12:03:15 -08:00
Manuel Kaufmann
80de90aecf
Remove Sphinx<5 compatibility leftovers (#1512)
* Remove Sphinx<5 compatibility

Since 2.0 we do not support Sphinx<5.

* Always use `writer-html5`

Since 2.0 HTML4 writer is not supported.

* Use `css_tag` helper to inject CSS files

* Revert "Remove Sphinx<5 compatibility"

Keep `sphinx_version_info`. It will be required.

This reverts commit 3afbed2950.

* Set `data-content_root` for Sphinx >= 7.2

Copied from https://github.com/readthedocs/sphinx_rtd_theme/pull/1507

* Default value for `DISPLAY` and `--new-tab`

* Visual test with Firefox and tox

Allows developer to run

```
tox -e py310-sphinx72-firefox
```

This will run the tests and open a Firefox after building the demo site
showing the `demo/demo.html` page on it.

Then, you can also run:

```
tox -e py310-sphinx61-firefox
```

and compare the visual differences.

Idea copied from #1388
Closes #1388

* Update sphinx_rtd_theme/layout.html

Co-authored-by: Dmitry Shachnev <mitya57@users.noreply.github.com>

* Remove code from merge conflict

* Revert a mistake done on merging

* Update CSS logic again

* Minor refactor to undocumented `extra_css_files` option

---------

Co-authored-by: Dmitry Shachnev <mitya57@users.noreply.github.com>
2024-01-03 12:19:50 +01:00
Manuel Kaufmann
17111add80
Remove pytest warnings (#1515)
* Remove pytest warnings

Ignore deprecations on Sphinx 9.0 that comes from readthedocs-sphinx-ext and use
`findall()` instead of `.traverse()` as suggested by docutils.

* We can't ignore a warning from Sphinx 9.0

We are testing in older versions where this exception is not defined.

The deprecation warning we are seeing here is not related to `sphinx_rtd_theme`
but with `readthedocs-sphinx-ext` because at:

13edf78bab/readthedocs_ext/readthedocs.py (L118-L122)

In any case, we will stop using that Sphinx extension at some point.
2024-01-02 13:22:55 +01:00
Anthony
2da37d6afd
Set up for next release (#1545) 2023-11-28 10:00:56 -08:00
Anthony
7c9b1b5d39
Release 2.0 final (#1544) 2023-11-27 20:04:13 -08:00
Anthony
c104410760
Bump for next potential release, 2.0.0rc5 (#1539) 2023-10-31 14:27:11 -07:00
Anthony
53ca116ef6
Release 2.0.0rc4 (#1538) 2023-10-31 14:15:47 -07:00
Dmitry Shachnev
4498e97b46
Fix AttributeError when one of css_files is a string (#1537)
Fix AttributeError when one of css_files is a string
2023-10-30 11:41:11 -07:00
Anthony
84aea9b0ba
Increment for next potential release (#1536) 2023-10-24 11:49:43 -07:00
Anthony
febde39c7c
Release 2.0.0rc3 (#1535) 2023-10-23 19:12:58 -07:00
Mathieu Leplatre
32310a8190
Fix #1522: fix 'str' object has no attribute 'attributes' (#1528)
* Fix #1522: fix attribute error if css is str

* Revert "Fix #1522: fix attribute error if css is str"

This reverts commit b22a77f35a.

* Use `css_tag` only for standard CSS files from Sphinx

... and keep using the custom `link` HTML tag for CSS files included via the
HTML theme option `extra_css_files`.

* Normalize template variables

---------

Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
Co-authored-by: Anthony Johnson <aj@ohess.org>
2023-10-23 19:05:59 -07:00
Anthony
8ce23cec96
Version bump for 2.0rc3 development (#1521)
Next development version is 2.0rc3 for now, but more likely 2.1rc1
2023-08-29 16:16:22 -07:00
Anthony
46f5307dbd
Release 2.0rc2 (#1520) 2023-08-29 16:11:46 -07:00
Manuel Kaufmann
5838e6aa54
Add support for docutils==0.20.x (#1517)
Closes #1516
2023-08-29 12:12:25 +02:00
Manuel Kaufmann
d34b71bb09
Use css_tag helper to inject CSS files (#1519)
* Use `css_tag` helper to inject CSS files

* Typo
2023-08-29 11:43:41 +02:00
Dmitry Shachnev
4874e9428d
Set data-content_root for Sphinx ≥ 7.2 (#1507)
This attribute is now required by searchtools.js:
https://github.com/sphinx-doc/sphinx/blob/v7.2.2/sphinx/themes/basic/static/searchtools.js#L65

When it's not set, loading search results via AJAX will be broken
because the JS code will attempt to load paths like /undefinedfoo.html.

Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
2023-08-29 11:03:49 +02:00
Manuel Kaufmann
41aca736bc
Docs: update Read the Docs config (#1518)
Use the latest config file style.
2023-08-28 19:23:03 +02:00
Manuel Kaufmann
ffdabadaa4
Remove Python2 leftovers (#1514) 2023-08-28 17:16:30 +02:00
Manuel Kaufmann
c190c0064b
Visual test with Firefox and tox (#1513)
* Visual test with Firefox and tox

Allows developer to run

```
tox -e py310-sphinx72-firefox
```

This will run the tests and open a Firefox after building the demo site
showing the `demo/demo.html` page on it.

Then, you can also run:

```
tox -e py310-sphinx61-firefox
```

and compare the visual differences.

Idea copied from #1388
Closes #1388

* Default value for `DISPLAY` and `--new-tab`

* Simplify the idea :)
2023-08-23 18:23:48 +02:00
Benjamin Balder Bach
923f9874a9
Docs: Remove "git install" method from instructions (#1375)
* Remove instructions "encouraging" to install directly from git

* Update changelog: Add reminder that people should not install directly from git

* Update docs/changelog.rst

---------

Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
2023-08-22 09:28:16 -07:00
Anthony
52e0cad4c2
Bump to next release 2.0.0rc2 (#1511) 2023-08-21 12:03:21 -07:00
Anthony
6cf2ae7951
Release 2.0.0rc1 (#1510)
* Release 2.0.0rc1

* Update npm lock file
2023-08-21 11:59:16 -07:00
Manuel Kaufmann
0e7b28ad4a
2.0 milestone: drop supported versions (#1500)
* 2.0 milestone: drop supported versions

The new policy is:

- Python >=3.6
- Sphinx >= 5
- HTML4 and HTML5 writer
- docutils >= 0.14, < 0.19

* Update roadmap after discussion

By the beginning of 2024 we should support newer Sphinx versions and HTML5 only.

* Remove Python 2.7 from CircleCI

* Run only supported versions on Python 3.11

* Update with feedback from review

* Update documentation to match our support

* Add Sphinx 6.2 that was missing

* Update tox/circleci to work

* Revert tox command

* Drop support for HTML4 and keep `-qa` testing

- drop support for HTML4 on 2.0
- keep `-qa` TOX environment to be able to compare feature branches
- emit `logger.errors` on Python 2 and html_writer4=True
- require Sphinx >= 5.0
- remove logic for old Sphinx versions

* Update Tox and CircleCI

* Update contributing page to match our plans

---------

Co-authored-by: Anthony Johnson <aj@ohess.org>
2023-08-21 11:38:57 -07:00
Anthony
15ed4de08d
Release 1.3.0 (#1509)
Bump the RC to final
2023-08-21 11:25:09 -07:00