Files
mkdocs/tox.ini
Ultrabug e1b77ab66e Support theme localization
A framework for translating themes as been added, which includes:

1. Use of Jinja's `i18n` plugin for translating phrases in templates (not page content).
2. A French translation of the built-in themes (contributions in other languages are welcome).
3. A new `theme.locale` option to define the locale/language of the site.
4. The search plugin uses the value of `theme.locale` as its default 'lang'.
5. Third party themes may chose to use the framework (use is optional).
6. A documented workflow for translating MkDocs built-in themes.
7. Custom tooling for use by translators and theme devs.

The dependencies are not installed by default and are not needed to use MkDocs without translations. However, for anyone who wants to make use of the features, `pip install mkdocs[i18n]` will install all necessary dependencies.

Relates to #211.
2021-05-06 14:30:21 -04:00

60 lines
1.7 KiB
INI

[tox]
envlist =
py{36,37,38,39,py3}-{unittests,min-req,integration,integration-no-babel},
flake8, markdown-lint, linkchecker, jshint, csslint, nobabel
[testenv]
passenv = LANG
deps=
py{36,37,38,39,py3}-{unittests,integration}: -rrequirements/project.txt
py{36,37,38,39,py3}-min-req: -rrequirements/project-min.txt
py{36,37,38,39,py3}-{unittests,min-req}: -rrequirements/test.txt
commands=
{envpython} --version
py{36,37,38,39,py3}-{unittests,min-req}: {envbindir}/coverage run --source=mkdocs --omit 'mkdocs/tests/*' -m unittest discover -p '*tests.py' mkdocs
py{36,37,38,39,py3}-unittests: {envbindir}/coverage xml
py{36,37,38,39,py3}-unittests: {envbindir}/coverage report --show-missing
py{36,37,38,39,py3}-integration: {envpython} -m mkdocs.tests.integration --output={envtmpdir}/builds
[testenv:flake8]
deps=-rrequirements/test.txt
commands={envbindir}/flake8 mkdocs --max-line-length=119
[testenv:markdown-lint]
whitelist_externals=
node
markdownlint
passenv = *
commands=
node --version
markdownlint --version
markdownlint README.md CONTRIBUTING.md docs/ --ignore docs/CNAME
[testenv:linkchecker]
basepython = python2.7
passenv=*
deps=
mdx_gh_links
requests<=2.9.0
LinkChecker
commands=
{envpython} -m mkdocs.tests.integration --output={envtmpdir}/builds
linkchecker {envtmpdir}/builds/
[testenv:jshint]
whitelist_externals = jshint
passenv=*
commands=jshint mkdocs/
[testenv:csslint]
whitelist_externals = csslint
passenv=*
commands=csslint mkdocs/
[testenv:py{36,37,38,39,py3}-integration-no-babel]
passenv = LANG
deps=-rrequirements/project.txt
commands=
pip uninstall -y babel
{envpython} -m mkdocs.tests.integration --output={envtmpdir}/builds