Commit Graph
94 Commits
Author SHA1 Message Date
Hugo Locurcio 04020f1c08 Fix / keyboard shortcut to allow typing / within the search field
- Select all existing text in the field when pressing the shortcut.
- Remove broken Algolia integration (unused since 4.0) and move
  the shortcut code to the main `custom.js` file.
2023-12-04 15:45:04 +01:00
Yuri Sizov b90284285d Bump master version to 4.3 2023-11-29 14:31:56 +01:00
Rémi Verschelde 6d295f7c84 conf.py: Fix regression with composite language codes
RTD decided to normalize language codes such as `zh_CN` and `pt_BR`
to `zh-cn` and `pt-br`, apparently because it makes URLs prettier...
https://blog.readthedocs.com/language-codes-are-now-normalized/

But they didn't take into account that Sphinx doesn't do the same,
and still requires `zh_CN` and `pt_BR` for its `language` config value.

So we have to convert it back in `conf.py`, otherwise this breaks our
i18n logic, notably to handle the localized class reference and images.
2023-11-23 13:54:22 +01:00
Thaddeus Crews 6c074b44cb Disable collapsing tabs for codeblocks 2023-10-27 09:51:43 -05:00
Yuri Sizov 82fac20c98 Update Godot version to 4.2 2023-07-06 09:41:07 +02:00
Yuri Sizov ccae259c15 Update Godot version to match what the master branch actually tracks 2023-06-29 16:49:04 +02:00
Justin McGettigan 2f919ba970 Add the 'sphinx-copybutton' Sphinx extension. (#6918)
* Added the 'sphinx-copybutton' Sphinx extension.
2023-04-17 18:32:15 +02:00
Yuri Sizov d14d924470 Display Godot version more clearly 2023-03-02 20:19:50 +01:00
Yuri SizovandJustin McGettigan f45c014fb1 Update admonition styling
Co-authored-by: Justin McGettigan <jwmcgettigan@gmail.com>
2023-03-01 16:09:59 +01:00
Yuri Sizov ff4f111677 Add a warning that docs are WIP and a status flag for articles
By default (no flag) articles are considered up-to-date, with the end goal to have no
articles marked as outdated.
Use `:article_outdated: True` at the top of an article to mark it as being outdated.
2023-02-26 12:57:38 +01:00
Yuri Sizov 1da407b921 Move the latest branch warning into templates 2023-02-24 19:42:51 +01:00
Rémi Verschelde 7fc697f10e Fix typo in last commit 2023-01-20 14:50:05 +01:00
Rémi Verschelde b4a43f14b8 Update copyright statement from 2022 to 'present' 2023-01-20 14:47:22 +01:00
Yuri Sizov 0ba3029d24 Remove breadcrumb styling adjustments after the base theme update 2023-01-10 18:12:39 +03:00
Yuri Sizov 98e96ced67 Make the navigation sidebar less crowded and noisy 2022-12-29 19:05:50 +03:00
Adam Scott 2b06a3822d Fix midword link wrapping issues
Adds <wbr> which is suggested linebreaks to each class reference link
in the sidebar once the page is ready.
2022-12-27 20:42:22 +03:00
Yuri Sizov faaf0dddab Improve the new class reference look based on feedback 2022-12-06 13:58:29 +03:00
Yuri Sizov 7c8e820228 Improve styling of class reference pages
- General improvements to the page layout and style
- Improved styling for all class (properties, signals, annotations, theme properties, methods, operators, constructors, enumerations, constants)
- Improved styling for tabs, code tabs, standalone code blocks, and tables
2022-12-01 16:30:19 +03:00
Yuri Sizovandthe-sink 0209919fc2 Remove search highlights from the page and the history
Co-authored-by: the-sink <lucianedean@gmail.com>
2022-11-21 22:13:24 +03:00
Yuri Sizov c77e4a8046 Correct exceptions for the class reference badge 2022-11-21 14:49:52 +03:00
Yuri Sizov 0a9683edbc Add cache-busting to custom web assets 2022-11-21 13:45:32 +03:00
Yuri SizovandPatchcoat 4096508fb6 Change the square logo for a wide one (#6397)
Co-authored-by: Patchcoat <spiencewelch@gmail.com>
2022-11-20 12:10:09 +01:00
Jason Yundt 5175fb8256 Use official CC BY 3.0 terminology and resources
This change makes the docs repo always use the official abbreviation (CC BY 3.0)
for its license. Previously, it would sometimes use “CC-BY 3.0” or
“CC-BY-3.0”. This change also make the docs repo always point to the
official Commons deed [1] for more information about CC BY 3.0.
Previously, it would sometimes link to an unofficial source [2].

[1]: <https://creativecommons.org/licenses/by/3.0/>
[2]: <https://tldrlegal.com/license/creative-commons-attribution-(cc)>
2022-09-13 14:05:04 -04:00
ARez a0af6b9df1 Updated the Lincense to match the current year 2022-02-22 13:09:55 +01:00
Rémi Verschelde a29b557361 conf.py: Add support for loading localized class reference
It will look up a potential `classes/<lang>` folder in the parent repository
of https://github.com/godotengine/godot-docs-l10n and use it if provided.

This folder includes a pre-translated copy of the class reference XML, read
to be used by Sphinx. This turned out to be a simpler approach than generating
PO files for class reference strings in reStructured Text format, given that
their source format is XML and the conversion on a per `msgid` basis would be
quite tricky.

This approach is very hacky, as Sphinx doesn't seem to support any kind of
conditional statements in its `toctree` directives, so we have to outright
replace the content at build time. This should typically only be done on RTD
so it shouldn't end up polluting the Git history.
2021-12-21 15:49:20 +01:00
Aaron Franke 4060179184 Remove trailing space characters (#5251) 2021-09-13 14:52:39 +02:00
Max Hilbrunner 50edc681f9 Add dev.css override 2021-07-11 13:01:16 +02:00
Leroy BakkerandHugo Locurcio 6ae96e7b50 Implemented Algolia search (#4884)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-06-13 20:21:11 +02:00
Rémi Verschelde 044b6a74f8 Cleanup uses of double spaces between words or after punctuation 2021-06-07 10:44:02 +02:00
Rémi Verschelde 0a087e730f Update copyrights to 2021 2021-03-19 14:02:00 +01:00
Hugo Locurcio 9becaa5480 Add Open Graph tags for better link preview on social media
This is provided by the sphinxext-opengraph extension.

This also adds a theme color property in the HTML layout file.
2021-03-18 20:34:06 +01:00
Hugo Locurcio f528a844d6 Add a more descriptive custom 404 error page (#4624)
This helps users find their way back to the documentation.
2021-02-05 21:48:22 +01:00
Hugo Locurcio bdece44b8d Prevent the compatibility notice from being the meta description
Adding the compatibility notice via JavaScript prevents the
`meta description` Sphinx extension from taking the notice
as part of the description.

This also changes the redirect URL to point to the page the user
is currently reading instead of always pointing to the homepage.
2020-09-22 14:59:28 +02:00
Rémi Verschelde 46ceaab45f Add switch to toggle 'in dev' compatibility warning
Follow-up to #4052.
2020-09-22 08:48:31 +02:00
Hugo Locurcio 419cf72a92 Add a warning about latest documentation compatibility
Not everything in the `latest` branch applies to Godot 3.2.x.
Read the Docs adds a warning notice for old versions automatically,
but it doesn't offer an option to do so for the `latest`/unstable
branch so we have to add it ourselves.
2020-09-22 01:00:47 +02:00
Rémi Verschelde c58ed951a1 Drop LaTeX dependency via usage of sphinx.ext.imgmath in Vector Math tutorial
It's the only tutorial where we used the extension for *3* formulas which anyway
ended up as fairly low res static images generated by sphinx.ext.imgmath, so
requiring ~1 GB of LaTeX setup for it is overkill.

The replacement pictures are the ones generated by sphinx.ext.imgmath, we could
replace them by higher resolution ones.
2020-07-15 09:58:21 +02:00
BinotaLIU 8b6c842bff add: zh_TW title 2020-07-07 23:48:10 +08:00
BinotaLIU 4f0f9e0120 disable smartquotes
Smartquotes will convert '"..."' to '“...”', will cause unexpected
result when we reference a string without using code block.

also in some languages (zh_TW for example), it will be converted to
'「...」', usually not a desired result.
2020-07-05 12:09:25 +08:00
Rémi Verschelde a5d697584a Merge pull request #3634 from akien-mga/we-localized-the-lost-nose-of-the-sphinx
i18n: Retrieve localized images from godot-docs-l10n
2020-06-05 17:08:24 +02:00
Max Hilbrunner e596fc8aa8 Improve CI
Improve CI build times by using a dummy builder for (empty) output, dropping LaTeX, and disabling some Sphinx extensions when building for CI (GDScript lexing, creating a search index, and generating HTML description tags).

In my tests, this improves Travis CI build times: from up to 30 minutes down to 2 minutes.
2020-06-03 17:44:47 +02:00
7376b8ebb7 i18n: Retrieve localized images from godot-docs-l10n
The localization for this documentation is handled via the godot-docs-l10n
repository at: https://github.com/godotengine/godot-docs-l10n

Sphinx supports localization of images by automatically looking up files
with a language code suffix (e.g. `myimage.zh_CN.png` as an override for
`myimage.png` when using `zh_CN` locale), but only in the same location as
the original file.

We want to host our localized images together with the PO files in the l10n
repo, so we use a glorious hack to redefine Sphinx's
`sphinx.util.i18n.get_image_filename_for_language` method in a way that fits
our needs.

Fixes godotengine/godot-docs-l10n#5.

Co-authored-by: BinotaLIU <binota@binota.org>
Co-authored-by: Gilles Roudiere <gilles.roudiere@gmail.com>
2020-06-03 15:02:14 +02:00
Max Hilbrunner 2927a912a5 Create Sphinx extension to generate HTML meta description tags 2020-05-02 21:34:02 +02:00
Max Hilbrunner 0b6d26e33d Prepend "(DEV)" to HTML titles if build locally/not on RTD 2020-04-28 16:53:08 +02:00
Max Hilbrunner 3c79f3e321 Fix locale names AGAIN :)
this time formatting to ISO 639-1 dynamically
2020-04-27 19:48:52 +02:00
Rémi Verschelde 66d185d5d2 conf: Fix handling of composite language codes with regional specifier
And fix another bug where I used `en` instead of a string.
2020-04-27 13:12:04 +02:00
Rémi Verschelde e4237e2948 Misc fixes to recent merges 2020-04-27 09:58:08 +02:00
Rémi Verschelde 24781e377b Fixes to HTML title localization 2020-04-27 08:49:01 +02:00
Rémi Verschelde e21df0671f conf: Add language name in page title and translate it
I couldn't find how to make the `html_title` value translatable using
sphinx-gettext (tried `sphinx.locale._()` but it wouldn't extract it),
so I'm hardcoding translations for now.
2020-04-26 22:10:51 +02:00
Hugo Locurcio 263ff56251 Define the Weblate badge size to avoid reflows during page loading 2020-04-25 21:31:00 +02:00
Max Hilbrunner fd5f6f4909 Appease our great search engine overlords
This hopefully fixes all translated pages showing up in search engine results, and makes the STABLE version of each page canonical.
In turn, this allows us to re-enable indexing of the version-specific pages (see robots.txt changes), as search engines should prefer the canonical (stable) version, and only show the other versions if no canonical (stable) version exists (i.e. because that feature is only in latest, or was removed in stable).

It adds proper canonical links for all generated pages, and fixes the existing links between the various translations of a page by both ensuring the pages links to itself with the proper language tag, and by properly linking to the full path of other translated versions.
2020-04-21 13:32:55 +02:00