74 Commits

Author SHA1 Message Date
Rémi Verschelde
7a86ac6a30 Add caution message that this is outdated documentation
And further cleanup intro text which is outdated.
2023-02-15 17:37:32 +01:00
Rémi Verschelde
39c5190ed2 Sphinx: Update to 4.4.0, drop incompatible readthedocs-sphinx-search
The readthedocs-sphinx-search extension is not actively maintained upstream,
and they pin some extremely old versions of Sphinx components which are not
compatible with what we need to use.

It was already dropped in the master branch, this syncs the requirements.txt
from master with 3.4.
2022-03-09 12:03:31 +01:00
Rémi Verschelde
5492a62b00 Update copyright year in footer 2022-02-24 15:42:51 +01:00
Rémi Verschelde
6f798caed4 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.

(cherry picked from commit a29b557361)
2021-12-21 16:47:25 +01:00
Rémi Verschelde
382d2960ec Update branch version to 3.4 2021-07-26 16:45:49 +02:00
Rémi Verschelde
e2b95576d8 Cleanup uses of double spaces between words or after punctuation 2021-07-13 00:44:58 +02:00
Rémi Verschelde
82d5e444ed Bump version to 3.3 2021-03-19 14:04:54 +01:00
Rémi Verschelde
9eba7649e1 Update copyrights to 2021
(cherry picked from commit 0a087e730f)
2021-03-19 14:02:49 +01:00
Hugo Locurcio
6c87f04926 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.

(cherry picked from commit 9becaa5480)
2021-03-18 20:44:22 +01:00
Hugo Locurcio
20a9683a07 Add a more descriptive custom 404 error page (#4624)
This helps users find their way back to the documentation.
2021-02-06 16:18:35 +01:00
Rémi Verschelde
a16e10538f Merge branch 'master' into 3.2 2020-09-28 15:43:06 +02: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
973cf89f94 Merge branch 'master' into 3.2 2020-09-22 08:59:08 +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
Rémi Verschelde
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
Rémi Verschelde
605222c094 conf.py: Get version from RTD when available 2020-03-31 10:01:32 +02:00
Rémi Verschelde
983235776c No longer exclude classref from localized builds 2020-03-20 13:41:15 +01:00
Rémi Verschelde
c85c68e694 Enable sphinx_search.extension added in #3277
I forgot to push this change in the previous PR...
2020-03-16 19:28:00 +01:00
Rémi Verschelde
463f1df6b0 Rename extensions to _extensions
To properly show that it's not a docs content folder but related
to the buildsystem.
2020-03-16 13:37:24 +01:00
Rémi Verschelde
450c2ed25f conf.py: Fix regression from black formatting in #3229 2020-03-13 16:57:30 +01:00
Hugo Locurcio
9902e4fe32 Format gdscript.py and conf.py using Black and Flake8
This also adds a missing comma in the middle of the list of
built-in types. The `name`, `funcname` and `classname` were also
missing a `r` qualifier, so it was added.

Commands used for formatting and linting:

    black conf.py extensions/gdscript.py
    flake8 --ignore E501 conf.py extensions/gdscript.py
2020-03-02 14:57:01 +01:00
Rémi Verschelde
96d702d4b0 Bump copyright to 2020 2020-01-29 01:38:44 +01:00
Hugo Locurcio
a3ab30906b Make the search bar fixed, hide the logo when scrolling down
This closes #2778.
2020-01-23 16:58:56 +01:00
Nathan Lovato
72e37935e7 Add robots.txt file to prevent indexing outdated docs (#3002)
Closes #2912
2020-01-18 19:30:20 +01:00
Hugo Locurcio
6b683b77ca Tweak the theme to better match Godot's visual identity
This also removes the need to load Web fonts, leading to a smoother
page loading experience.

Co-authored-by: Nicholas Hydock <nhydock@users.noreply.github.com>
2019-11-19 22:05:23 +01:00
Rémi Verschelde
5f471bc8c9 Revert inclusion of sphinx.ext.imgconverter
This was added in #2820 to convert GIFs in the PDF output,
but it also converts them in HTML...

Fixes #2861.
2019-10-29 08:34:57 +01:00
AJ Heller
0d0f9961f4 fix build errors with make latexpdf
This commit provides two small fixes.

Gif images are not supported by latexpdf. There are a handful of options
to resolve that issue, but the already-available imgconverter extension
takes care of converting them to supported image formats.

The pdf build was failing due to the deprecated Sphinx `app.warn` used
in the sphinx_tabs extension. The `app.log` deprecation was already
handled in this function, and now `warn` is as well.
2019-10-02 18:01:53 -07:00
Hugo Locurcio
589282d90b Fix Sphinx Weblate widget warning
The `weblate_widget` substitution is now always defined.
This also makes it possible to remove some duplication in `index.rst`.
2019-07-28 05:24:56 +02:00
Rémi Verschelde
083432da3e Sphinx: Use newly-added READTHEDOCS_LANGUAGE env var
Upstream ReadTheDocs added it in readthedocs/readthedocs.org#5941
so that we don't have to define it ourselves.
2019-07-17 09:17:00 +02:00
Rémi Verschelde
fa77d5735f Sphinx: Also use env variable to get RTD instance language
ReadTheDocs properly overrides `language` via's sphinx-build's
`-D language=value` parameter, but when we do the initial parsing
of `conf.py` it still uses the original value, so our custom logic
for Weblate badges was not working.
2019-07-15 20:41:50 +02:00
Rémi Verschelde
b046a12ced Sphinx: Fix build issue when no SPHINX_TAGS are defined
Regression from 2a957dfc7e.
Fixes #2626.
2019-07-15 19:48:46 +02:00
Rémi Verschelde
2a957dfc7e Sphinx: Set tags from RTD SPHINX_TAGS env variable
Up until now I mistakenly thought that ReadTheDocs' tags
were the same as Sphinx tags, and would be passed to the
build. It turns out that aren't, so our `.. only:: i18n`
logic did not work.

Instead, we now use RTD environment variables to pass
comma-separated tags to Sphinx.
2019-07-15 17:54:48 +02:00
Rémi Verschelde
a39d8f4c80 index: Localize Weblate badge on i18n instances
It will now show the translation status for the used language instead
of the overall completion for all languages.
The badge widget's text is also in the used language.

The drawback is that to do this I had to inject the localized image
directive in the `rst_epilog` for all pages, even though we only need
it for the index.
2019-06-18 15:09:30 +02:00
Rémi Verschelde
4644795f19 Fix conf.py parsing after 5c4340d3
Fixes #2536.
2019-06-16 20:43:11 +02:00
Rémi Verschelde
5c4340d30c Disable "Edit on GitHub" button on localized instances 2019-06-15 00:13:16 +02:00