Commit Graph

110 Commits

Author SHA1 Message Date
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
Rémi Verschelde
3b7b77e3fc Update copyright for 2019
Happy new year to all the documentation contributors!
2019-01-08 10:13:59 +01:00
Rémi Verschelde
a0e32ac017 Fix mixed use of tabs and spaces in indented blocks
4-space is our convention for indented blocks and should be used consistently.
The only exception is for C++ code which is tab-indented, as the engine code.
2018-11-20 11:02:11 +01:00
Rémi Verschelde
90ffb6a6fa Remove tutorial on linear algebra for rotations
Though it covers an interesting topic in a way that can be beneficial
to many Godot users, after discussion with doc team members and reduz
we feel that its current scope is too out of phase with the target
readership of the Godot docs.

This tutorial would work better hosted out of the Godot docs, and
referenced with a `.. seealso::` link for those who want to dig further
into the math meat.

Thanks a lot to tagcup for this contribution though (as well as the
many contributions to the engine's math and rendering), and sorry for
not better describing what kind of "advanced" math tutorial would be
fitting for the Godot docs.

Sphinx: Also reverted from mathjax to imgmath, as the former implied
running JS code on every single page (regardless of their use of LaTeX
formulas to renderer), so for now imgmath is simpler and good enough.
2018-06-18 08:39:44 +02:00
None
f064e4f7a7 Fix 404s, some redirects and some broken links. 2018-05-30 16:49:21 -07:00
Rémi Verschelde
ddc35b0d6e Config i18n for submodule usage 2018-04-10 10:45:32 +02:00
tagcup
602ae8d5f7 rotations tutorial 2018-04-08 16:52:42 -04:00
Juankz
cf22d196c5 Add some i18n parameters
New mo and po files are created under ./locale/ dir
Compact text false by default
2018-03-28 12:15:28 +02:00
Rémi Verschelde
24f61b3648 Make "Edit on GitHub" always point to master branch
Fixes #1138.
2018-03-05 13:29:14 +01:00
Rémi Verschelde
4f6f991519 Update copyright for 2018
Happy new year to all the documentation contributors!
2018-01-04 01:49:56 +01:00
Chris Bradfield
59eebac905 Add math/formula support in Sphinx 2017-12-02 09:15:01 -08:00
Daniel J. Ramirez
54a5c50309 Added tabs for multiple programming languages 2017-08-31 23:58:48 -05:00
Rémi Verschelde
7a1c564203 Update copyright year for 2017 2017-01-08 12:47:48 +01:00
Rémi Verschelde
52b63a977d conf.py: Prevent RTD from overriding our theme config
Also tweak the logo a bit.
2016-07-20 23:52:57 +02:00
Rémi Verschelde
0d70225b5a conf.py: Add a Godot docs logo 2016-07-20 23:17:05 +02:00