manim/docs/source/conf.py
Mysaa 065c7612a2
Prepare documentation for translation (#862)
* Perparing for internationalization

* On my way to i18n

* Making initial .pot

* Apply translations in fr

review completed for the source file '/docs/i18n/gettext/examples/camera_settings.pot'
on the 'fr' language.

* Apply translations in fr

review completed for the source file '/docs/i18n/gettext/examples/camera_settings.pot'
on the 'fr' language.

* Added some languages and changing files

* Removing translations, keeping only en

* Updating the commit history so docs are redownloaded

* Adding a bit of texts to add contributing.rst

* Apply translations in fr

at least 5% reviewed for the source file '/docs/i18n/en/LC_MESSAGES/reference/manim.mobject.geometry.CubicBezier.po'
on the 'fr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format

* Apply translations in fr

at least 5% reviewed for the source file '/docs/i18n/en/LC_MESSAGES/reference/manim.mobject.types.vectorized_mobject.po'
on the 'fr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format

* Translate /docs/i18n/en/LC_MESSAGES/index.po in fr

at least 15% reviewed for the source file '/docs/i18n/en/LC_MESSAGES/index.po'
on the 'fr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format

* Apply translations in fr

at least 15% reviewed for the source file '/docs/i18n/en/LC_MESSAGES/reference/manim.mobject.geometry.CubicBezier.po'
on the 'fr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format

* Apply translations in fr

at least 15% reviewed for the source file '/docs/i18n/en/LC_MESSAGES/reference/manim.mobject.types.vectorized_mobject.po'
on the 'fr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format

* Modified the Makefile a bit

* Added a first script to strip untranslatable content out

* Added some stripping code that needs to be re-worked.

* Finished the awk script. Commented it (a little gift to my future self).
Still need to test the generated files
Also removed the gettext folder from .gitignore

* Added folders in the .gitignore and comments to the awk script

* Pof, added the readyForTranslation file

* Removed french translations, hoping transifex will reset them

* Modified the files to trigger transifex changes

* Made the comment made by stripUntranslatable compatible with .po files syntax

* Tried another fix

* Another one bites the dust

* Why the reason is not necessary to involve ?

* Fixed .... i think

* Translate /docs/i18n/en/LC_MESSAGES/index.po in fr

at least 1% reviewed for the source file '/docs/i18n/en/LC_MESSAGES/index.po'
on the 'fr' language.

 Manual sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format

* Added a paragraph in the docs explaining how to translate

* Changed the contributing a bit, thanks jpitz

* Tweaked the docs part a bit more

* Fixed a link and updated i18n

* REREREupdated the link

* How did i get my driving licence ?

* Little test about i18n build

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* New internationalized files.

* Corrected some grammar errors. Whoops.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixed typo in awk file comments.

* Fix the precommit issues.

* Apply suggestions from code review - Rewrote parts of the contributing text.

Co-authored-by: Darylgolden <darylgolden@gmail.com>

* Add link to discord server in translation.rst

* Suppression des en-tête inutiles des fichiers PO.

* Changed i18nService role to TranslationAdmin

* Translate /docs/i18n/en/LC_MESSAGES/index.po in fr

reviewed for the source file '/docs/i18n/en/LC_MESSAGES/index.po'
on the 'fr' language.

* Renamed the internationalization doc file. + Now every translatable string is sent to translation.

* Minor copyedit suggested by @Darylgolden

Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: Mysaa <mysaa@bernard.com.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: GameDungeon <60719255+GameDungeon@users.noreply.github.com>
Co-authored-by: Darylgolden <darylgolden@gmail.com>
2021-09-24 20:17:43 +08:00

170 lines
5 KiB
Python

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os
import sys
from distutils.sysconfig import get_python_lib
from pathlib import Path
import manim
sys.path.insert(0, os.path.abspath("."))
# -- Project information -----------------------------------------------------
project = "Manim"
copyright = "2020-2021, The Manim Community Dev Team"
author = "The Manim Community Dev Team"
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"recommonmark",
"sphinx_copybutton",
"sphinx.ext.napoleon",
"sphinx.ext.autosummary",
"sphinx.ext.doctest",
"sphinx.ext.extlinks",
"sphinx.ext.viewcode",
"sphinxext.opengraph",
"manim_directive",
"sphinx.ext.graphviz",
"sphinx.ext.inheritance_diagram",
]
# Automatically generate stub pages when using the .. autosummary directive
autosummary_generate = True
# generate documentation from type hints
autodoc_typehints = "description"
autoclass_content = "both"
# controls whether functions documented by the autofunction directive
# appear with their full module names
add_module_names = False
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
# Custom section headings in our documentation
napoleon_custom_sections = ["Tests", ("Test", "Tests")]
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
html_extra_path = ["robots.txt"]
exclude_patterns = []
# -- Options for internationalization ----------------------------------------
# Set the destination directory of the localized po files
locale_dirs = ["../i18n/"]
# Splits the text in more pot files.
gettext_compact = False
# Remove useless metadata from po files.
gettext_last_translator = ""
gettext_language_team = ""
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "furo"
html_favicon = str(Path("_static/favicon.ico"))
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
html_theme_options = {
"light_logo": "manim-logo-sidebar.svg",
"dark_logo": "manim-logo-sidebar-dark.svg",
"light_css_variables": {
"color-content-foreground": "#000000",
"color-background-primary": "#ffffff",
"color-background-border": "#ffffff",
"color-sidebar-background": "#f8f9fb",
"color-brand-content": "#1c00e3",
"color-brand-primary": "#192bd0",
"color-link": "#c93434",
"color-link--hover": "#5b0000",
"color-inline-code-background": "#f6f6f6;",
"color-foreground-secondary": "#000",
},
"dark_css_variables": {
"color-content-foreground": "#ffffffd9",
"color-background-primary": "#131416",
"color-background-border": "#303335",
"color-sidebar-background": "#1a1c1e",
"color-brand-content": "#2196f3",
"color-brand-primary": "#007fff",
"color-link": "#51ba86",
"color-link--hover": "#9cefc6",
"color-inline-code-background": "#262626",
"color-foreground-secondary": "#ffffffd9",
},
}
html_title = f"Manim Community v{manim.__version__}"
# This specifies any additional css files that will override the theme's
html_css_files = ["custom.css"]
# external links
extlinks = {
"issue": ("https://github.com/ManimCommunity/manim/issues/%s", "issue "),
"pr": ("https://github.com/ManimCommunity/manim/pull/%s", "pull request "),
}
# opengraph settings
ogp_image = "https://www.manim.community/logo.png"
ogp_site_name = "Manim Community | Documentation"
ogp_site_url = "https://docs.manim.community/"
# inheritance_graph settings
inheritance_graph_attrs = dict(
concentrate=True,
size='""',
splines="ortho",
nodesep=0.1,
ranksep=0.2,
)
inheritance_node_attrs = dict(
penwidth=0,
shape="box",
width=0.05,
height=0.05,
margin=0.05,
)
inheritance_edge_attrs = dict(
penwidth=1,
)
html_js_files = [
"responsiveSvg.js",
]
graphviz_output_format = "svg"