From 98cc11a7deb06dace82988f092b9aa137d87b877 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?=
Date: Wed, 28 Jul 2021 14:11:46 +0200
Subject: [PATCH 01/29] Fix minor errors in documentation (#2515)
---
docs/dev-guide/themes.md | 13 ++++++++-----
docs/user-guide/localizing-your-theme.md | 3 ++-
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/docs/dev-guide/themes.md b/docs/dev-guide/themes.md
index 5e6607a9fd..9e72171603 100644
--- a/docs/dev-guide/themes.md
+++ b/docs/dev-guide/themes.md
@@ -562,7 +562,7 @@ And then displayed with this HTML in the custom theme.
## Template Filters
-In addition to Jinja's default filters, the following custom filters are
+In addition to [Jinja's default filters], the following custom filters are
available to use in MkDocs templates:
### url
@@ -698,6 +698,7 @@ index when it is available. The `index` object was new in MkDocs version *1.0*.
[lunr.js]: https://lunrjs.com/
[site_dir]: ../user-guide/configuration.md#site_dir
[prebuild_index]: ../user-guide/configuration.md#prebuild_index
+[Jinja's default filters]: https://jinja.palletsprojects.com/en/latest/templates/#builtin-filters
## Packaging Themes
@@ -778,9 +779,9 @@ setup(
Fill in the URL, license, description, author and author email address.
-The name should follow the convention `mkdocs-themename` (like `mkdocs-
-bootstrap` and `mkdocs-bootswatch`), starting with MkDocs, using hyphens to
-separate words and including the name of your theme.
+The name should follow the convention `mkdocs-themename` (like
+`mkdocs-bootstrap` and `mkdocs-bootswatch`), starting with MkDocs, using
+hyphens to separate words and including the name of your theme.
Most of the rest of the file can be left unedited. The last section we need to
change is the entry_points. This is how MkDocs finds the theme(s) you are
@@ -876,7 +877,8 @@ special options which alters its behavior:
#### extends
Defines a parent theme that this theme inherits from. The value should be
- the string name of the parent theme. Normal Jinja inheritance rules apply.
+ the string name of the parent theme. Normal [Jinja inheritance rules]
+ apply.
Plugins may also define some options which allow the theme to inform a plugin
about which set of plugin options it expects. See the documentation for any
@@ -902,6 +904,7 @@ documentation for [Packaging and Distributing Projects].
[Packaging and Distributing Projects]: https://packaging.python.org/en/latest/distributing/
[theme]: ../user-guide/configuration.md#theme
+[Jinja inheritance rules]: https://jinja.palletsprojects.com/en/latest/templates/#template-inheritance
## Supporting theme Localization/Translation
diff --git a/docs/user-guide/localizing-your-theme.md b/docs/user-guide/localizing-your-theme.md
index f52b9648f9..2e5eba8ad4 100644
--- a/docs/user-guide/localizing-your-theme.md
+++ b/docs/user-guide/localizing-your-theme.md
@@ -23,7 +23,7 @@ pip install mkdocs[i18n]
## Supported locales
-In most cases a locale is designated by the ISO-639-1 (2-letter) abbreviation
+In most cases a locale is designated by the [ISO-639-1] (2-letter) abbreviation
for your language. However, a locale may also include a territory (or region or
county) code as well. The language and territory must be separated by an
underscore. For example, some possible locales for English might include `en`,
@@ -64,3 +64,4 @@ contribute a translation using the [Translation Guide].
[readthedocs]: choosing-your-theme.md#readthedocs-locale
[locale]: configuration.md#locale
[theme]: configuration.md#theme
+[ISO-639-1]: https://en.wikipedia.org/wiki/ISO_639-1
From ea0ac7a07a1d1b6cca2bdea7d62a0b03efaba936 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?=
Date: Fri, 20 Aug 2021 12:30:26 +0200
Subject: [PATCH 02/29] Update contribution guide links (#2548)
---
docs/about/contributing.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/about/contributing.md b/docs/about/contributing.md
index 7576d3ae4a..cd5b86d80a 100644
--- a/docs/about/contributing.md
+++ b/docs/about/contributing.md
@@ -61,7 +61,7 @@ root of your MkDocs repository.
It will attempt to run the tests against all of the Python versions we
support. So don't be concerned if you are missing some and they fail. The rest
-will be verified by [Travis] when you submit a pull request.
+will be verified by [Github Actions] when you submit a pull request.
## Translating themes
@@ -104,7 +104,7 @@ Themes] for details.
[virtualenv]: https://virtualenv.pypa.io/en/latest/user_guide.html
[pip]: https://pip.pypa.io/en/stable/
[tox]: https://tox.readthedocs.io/en/latest/
-[travis]: https://travis-ci.org/repositories
+[Github Actions]: https://docs.github.com/actions
[PyPA Code of Conduct]: https://www.pypa.io/en/latest/code-of-conduct/
[Translating Themes]: ../dev-guide/translations.md
-[Jinja's i18n extension]: https://jinja.palletsprojects.com/en/master/extensions/#i18n-extension
+[Jinja's i18n extension]: https://jinja.palletsprojects.com/en/latest/extensions/#i18n-extension
From 15601c67c84ec65d057e5e185e3768a7eaa92d9a Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Fri, 20 Aug 2021 14:13:26 +0200
Subject: [PATCH 03/29] Refactor file sorting using a "new-style" key function
(#2541)
---
mkdocs/structure/files.py | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/mkdocs/structure/files.py b/mkdocs/structure/files.py
index 0a0ec786d0..74e1f029d0 100644
--- a/mkdocs/structure/files.py
+++ b/mkdocs/structure/files.py
@@ -1,7 +1,6 @@
import fnmatch
import os
import logging
-from functools import cmp_to_key
from urllib.parse import quote as urlquote
from mkdocs import utils
@@ -252,16 +251,12 @@ def get_files(config):
def _sort_files(filenames):
""" Always sort `index` or `README` as first filename in list. """
- def compare(x, y):
- if x == y:
- return 0
- if os.path.splitext(y)[0] in ['index', 'README']:
- return 1
- if os.path.splitext(x)[0] in ['index', 'README'] or x < y:
- return -1
- return 1
+ def key(f):
+ if os.path.splitext(f)[0] in ['index', 'README']:
+ return (0,)
+ return (1, f)
- return sorted(filenames, key=cmp_to_key(compare))
+ return sorted(filenames, key=key)
def _filter_paths(basename, path, is_dir, exclude):
From 4d1d1c1ba5065dde50ae7ddab4b0a85305781047 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?=
Date: Fri, 20 Aug 2021 17:06:01 +0200
Subject: [PATCH 04/29] Fix various typos using codespell (#2549)
---
README.md | 2 +-
docs/user-guide/configuration.md | 4 ++--
mkdocs/config/config_options.py | 2 +-
mkdocs/tests/structure/page_tests.py | 6 +++---
mkdocs/themes/readthedocs/css/theme_extra.css | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 986bb402f2..62bedb8cb0 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ user guide.
- Build static HTML files from Markdown files.
- Use Plugins and Markdown Extensions to enhance MkDocs.
-- Use the build-in themes, third party themes or create your own.
+- Use the built-in themes, third party themes or create your own.
- Publish your documentation anywhere that static files can be served.
- Much more!
diff --git a/docs/user-guide/configuration.md b/docs/user-guide/configuration.md
index 91a44f7abf..7c48869837 100644
--- a/docs/user-guide/configuration.md
+++ b/docs/user-guide/configuration.md
@@ -35,7 +35,7 @@ subdirectory in the setting (`https://example.com/foo/`).
This setting is also used for `mkdocs serve`: the server will be mounted onto a
path taken from the path component of the URL, e.g. `some/page.md` will be
-served from `http://127.0.0.1:8000/foo/some/page/` to mimick the expected remote
+served from `http://127.0.0.1:8000/foo/some/page/` to mimic the expected remote
layout.
**default**: `null`
@@ -619,7 +619,7 @@ themes do). Set to `true` to enable.
This option requires that [Node.js] be installed and the command `node` be
on the system path. If the call to `node` fails for any reason, a warning
- is issued and the build continues uninterupted. You may use the `--strict`
+ is issued and the build continues uninterrupted. You may use the `--strict`
flag when building to cause such a failure to raise an error instead.
!!! Note
diff --git a/mkdocs/config/config_options.py b/mkdocs/config/config_options.py
index 43039f87b1..f0ec7d2cb6 100644
--- a/mkdocs/config/config_options.py
+++ b/mkdocs/config/config_options.py
@@ -549,7 +549,7 @@ class MarkdownExtensions(OptionallyRequired):
A string must be a valid Markdown extension name with no config options defined. The key of
a dict item must be a valid Markdown extension name and the value must be a dict of config
options for that extension. Extension configs are set on the private setting passed to
- `configkey`. The `builtins` keyword accepts a list of extensions which cannot be overriden by
+ `configkey`. The `builtins` keyword accepts a list of extensions which cannot be overridden by
the user. However, builtins can be duplicated to define config options for them if desired. """
def __init__(self, builtins=None, configkey='mdx_configs', **kwargs):
super().__init__(**kwargs)
diff --git a/mkdocs/tests/structure/page_tests.py b/mkdocs/tests/structure/page_tests.py
index 86bd0f1a23..095f4f11ae 100644
--- a/mkdocs/tests/structure/page_tests.py
+++ b/mkdocs/tests/structure/page_tests.py
@@ -806,17 +806,17 @@ def test_no_links(self):
'not a link.
'
)
- @mock.patch('mkdocs.structure.pages.open', mock.mock_open(read_data='[link](non-existant.md)'))
+ @mock.patch('mkdocs.structure.pages.open', mock.mock_open(read_data='[link](non-existent.md)'))
def test_bad_relative_html_link(self):
with self.assertLogs('mkdocs', level='WARNING') as cm:
self.assertEqual(
self.get_rendered_result(['index.md']),
- 'link
'
+ 'link
'
)
self.assertEqual(
cm.output,
["WARNING:mkdocs.structure.pages:Documentation file 'index.md' contains a link "
- "to 'non-existant.md' which is not found in the documentation files."]
+ "to 'non-existent.md' which is not found in the documentation files."]
)
@mock.patch('mkdocs.structure.pages.open', mock.mock_open(read_data='[external](http://example.com/index.md)'))
diff --git a/mkdocs/themes/readthedocs/css/theme_extra.css b/mkdocs/themes/readthedocs/css/theme_extra.css
index ec7002a6b6..69d567d40e 100644
--- a/mkdocs/themes/readthedocs/css/theme_extra.css
+++ b/mkdocs/themes/readthedocs/css/theme_extra.css
@@ -122,7 +122,7 @@ form .search-query {
/*
* Account for wide tables which go off the side.
- * Override borders to avoid wierdness on narrow tables.
+ * Override borders to avoid weirdness on narrow tables.
*
* https://github.com/mkdocs/mkdocs/issues/834
* https://github.com/mkdocs/mkdocs/pull/1034
From 220684d6c670fe52c06abc454a1654097200f5a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?=
Date: Mon, 23 Aug 2021 17:47:11 +0200
Subject: [PATCH 05/29] Add missing readthedocs theme Spanish translations
(#2545)
---
.../locales/es/LC_MESSAGES/messages.po | 102 +++++++-----------
1 file changed, 41 insertions(+), 61 deletions(-)
diff --git a/mkdocs/themes/readthedocs/locales/es/LC_MESSAGES/messages.po b/mkdocs/themes/readthedocs/locales/es/LC_MESSAGES/messages.po
index 5743383f2f..76af2bce2d 100644
--- a/mkdocs/themes/readthedocs/locales/es/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/readthedocs/locales/es/LC_MESSAGES/messages.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: MkDocs 1.2\n"
"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
-"POT-Creation-Date: 2021-04-08 22:44+0200\n"
+"POT-Creation-Date: 2021-04-08 22:46+0200\n"
"PO-Revision-Date: 2021-05-07 12:06+0200\n"
"Last-Translator: Álvaro Mondéjar Rubio \n"
"Language: es\n"
@@ -17,82 +17,62 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
-#: mkdocs/themes/mkdocs/404.html:8
+#: mkdocs/themes/readthedocs/404.html:7
msgid "Page not found"
msgstr "Página no encontrada"
-#: mkdocs/themes/mkdocs/base.html:107
-#: mkdocs/themes/mkdocs/keyboard-modal.html:31
-#: mkdocs/themes/mkdocs/search-modal.html:5
-msgid "Search"
-msgstr "Buscar"
+#: mkdocs/themes/readthedocs/breadcrumbs.html:3
+msgid "Docs"
+msgstr "Documentos"
-#: mkdocs/themes/mkdocs/base.html:117
-msgid "Previous"
-msgstr "Anterior"
-
-#: mkdocs/themes/mkdocs/base.html:122
-msgid "Next"
-msgstr "Siguiente"
-
-#: mkdocs/themes/mkdocs/base.html:133 mkdocs/themes/mkdocs/base.html:135
-#: mkdocs/themes/mkdocs/base.html:137 mkdocs/themes/mkdocs/base.html:139
+#: mkdocs/themes/readthedocs/breadcrumbs.html:24
#, python-format
msgid "Edit on %(repo_name)s"
msgstr "Editar en %(repo_name)s"
-#: mkdocs/themes/mkdocs/base.html:179
-#, python-format
-msgid "Documentation built with %(mkdocs_link)s."
-msgstr "Documentación construida con %(mkdocs_link)s."
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:5
-msgid "Keyboard Shortcuts"
-msgstr "Atajos de teclado"
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:6
-#: mkdocs/themes/mkdocs/search-modal.html:6
-msgid "Close"
-msgstr "Cerrar"
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:12
-msgid "Keys"
-msgstr "Teclas"
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:13
-msgid "Action"
-msgstr "Acción"
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:19
-msgid "Open this help"
-msgstr "Abrir esta ayuda"
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:23
-msgid "Next page"
-msgstr "Página siguiente"
+#: mkdocs/themes/readthedocs/breadcrumbs.html:33
+#: mkdocs/themes/readthedocs/footer.html:7
+#: mkdocs/themes/readthedocs/versions.html:14
+msgid "Next"
+msgstr "Siguiente"
-#: mkdocs/themes/mkdocs/keyboard-modal.html:27
-msgid "Previous page"
-msgstr "Página anterior"
+#: mkdocs/themes/readthedocs/breadcrumbs.html:36
+#: mkdocs/themes/readthedocs/footer.html:10
+#: mkdocs/themes/readthedocs/versions.html:11
+msgid "Previous"
+msgstr "Anterior"
-#: mkdocs/themes/mkdocs/search-modal.html:9
-msgid "From here you can search these documents. Enter your search terms below."
+#: mkdocs/themes/readthedocs/footer.html:25
+#, python-format
+msgid ""
+"Built with %(mkdocs_link)s using a %(sphinx_link)s provided by "
+"%(rtd_link)s."
msgstr ""
-"Desde aquí puede buscar estos documentos. Ingrese sus términos de búsqueda a "
-"continuación."
+"Construído con %(mkdocs_link)s usando %(sphinx_link)s provisto "
+"por%(rtd_link)s."
-#: mkdocs/themes/mkdocs/search-modal.html:12
-msgid "Search..."
-msgstr "Buscando..."
+#: mkdocs/themes/readthedocs/search.html:5
+msgid "Search Results"
+msgstr "Resultados de búsqueda"
+
+#: mkdocs/themes/readthedocs/search.html:9
+msgid "Search the Docs"
+msgstr "Buscar en la documentación"
-#: mkdocs/themes/mkdocs/search-modal.html:12
+#: mkdocs/themes/readthedocs/search.html:9
+#: mkdocs/themes/readthedocs/searchbox.html:3
msgid "Type search term here"
msgstr "Escriba el término de búsqueda aquí"
-#: mkdocs/themes/mkdocs/search-modal.html:15
+#: mkdocs/themes/readthedocs/search.html:12
msgid "No results found"
msgstr "No se encontraron resultados"
-#: mkdocs/themes/mkdocs/toc.html:3
-msgid "Table of Contents"
-msgstr "Tabla de contenidos"
+#: mkdocs/themes/readthedocs/search.html:13
+#, fuzzy
+msgid "Searching..."
+msgstr "Buscando..."
+
+#: mkdocs/themes/readthedocs/searchbox.html:3
+msgid "Search docs"
+msgstr "Buscar documentos"
From 98b1d0e991788e805ed952bdc889943928653651 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kuba=20Andr=C3=BDsek?=
<33494544+JakubAndrysek@users.noreply.github.com>
Date: Mon, 23 Aug 2021 12:25:22 -0400
Subject: [PATCH 06/29] Fix Jinja Environment link (#2552)
---
docs/dev-guide/plugins.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/dev-guide/plugins.md b/docs/dev-guide/plugins.md
index 1196844e60..de5437a4a1 100644
--- a/docs/dev-guide/plugins.md
+++ b/docs/dev-guide/plugins.md
@@ -211,7 +211,7 @@ entire site.
##### on_env
: The `env` event is called after the Jinja template environment is created
- and can be used to alter the [Jinja environment](https://jinja.palletsprojects.com/en/master/api/#jinja2.Environment).
+ and can be used to alter the [Jinja environment](https://jinja.palletsprojects.com/en/latest/api/#jinja2.Environment).
Parameters:
: __env:__ global Jinja environment
From c93c05341d7c8f21059d005b4e752859d88fb899 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?=
Date: Mon, 23 Aug 2021 19:50:25 +0200
Subject: [PATCH 07/29] Add codespell step to CI lint workflow (#2551)
---
.github/workflows/tox.yml | 3 +++
mkdocs/themes/mkdocs/js/base.js | 2 +-
tox.ini | 7 ++++++-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml
index fade55c631..0e25a42080 100644
--- a/.github/workflows/tox.yml
+++ b/.github/workflows/tox.yml
@@ -84,6 +84,9 @@ jobs:
- name: Check with csslint
if: always()
run: python -m tox -e csslint
+ - name: Check with codespell
+ if: always()
+ run: python -m tox -e codespell
translation:
runs-on: ubuntu-latest
diff --git a/mkdocs/themes/mkdocs/js/base.js b/mkdocs/themes/mkdocs/js/base.js
index 8ba6faa1cf..b0f4726bf1 100644
--- a/mkdocs/themes/mkdocs/js/base.js
+++ b/mkdocs/themes/mkdocs/js/base.js
@@ -30,7 +30,7 @@ $(document).ready(function() {
$search_modal.modal();
}
- // make sure search input gets autofocus everytime modal opens.
+ // make sure search input gets autofocus every time modal opens.
$search_modal.on('shown.bs.modal', function() {
$search_modal.find('#mkdocs-search-query').focus();
});
diff --git a/tox.ini b/tox.ini
index 6b7fe30714..869498579d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,7 +1,7 @@
[tox]
envlist =
py{36,37,38,39,py3}-{unittests,min-req,integration,integration-no-babel},
- flake8, markdown-lint, linkchecker, jshint, csslint, nobabel
+ flake8, markdown-lint, linkchecker, jshint, csslint, nobabel, codespell
[testenv]
passenv = LANG
@@ -30,6 +30,11 @@ commands=
markdownlint --version
markdownlint README.md CONTRIBUTING.md docs/ --ignore docs/CNAME
+[testenv:codespell]
+deps=codespell
+commands=
+ {envbindir}/codespell . -S '*.min.js' -S 'lunr.*.js' -S lunr.js -S fontawesome-webfont.svg -S .tox -S venv -S tinyseg.js
+
[testenv:linkchecker]
basepython = python2.7
passenv=*
From 1dc66b76b480e3f8ce3e879951269abe4e8ee5a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?=
Date: Mon, 30 Aug 2021 14:32:54 +0200
Subject: [PATCH 08/29] Add __repr__ method to File class (#2550)
---
mkdocs/structure/files.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mkdocs/structure/files.py b/mkdocs/structure/files.py
index 74e1f029d0..2626462595 100644
--- a/mkdocs/structure/files.py
+++ b/mkdocs/structure/files.py
@@ -141,6 +141,11 @@ def __eq__(self, other):
def __ne__(self, other):
return not self.__eq__(other)
+ def __repr__(self):
+ return "File(src_path='{}', dest_path='{}', name='{}', url='{}')".format(
+ self.src_path, self.dest_path, self.name, self.url
+ )
+
def _get_stem(self):
""" Return the name of the file without it's extension. """
filename = os.path.basename(self.src_path)
From 519d2d32c3047ee6667a7ed4a30010e487420004 Mon Sep 17 00:00:00 2001
From: Goto Hayato
Date: Wed, 8 Sep 2021 05:30:18 +0900
Subject: [PATCH 09/29] Add Japanese (`ja`) translation for built-in themes
(#2525)
---
docs/user-guide/choosing-your-theme.md | 2 +
.../mkdocs/locales/ja/LC_MESSAGES/messages.po | 97 +++++++++++++++++++
.../locales/ja/LC_MESSAGES/messages.po | 77 +++++++++++++++
3 files changed, 176 insertions(+)
create mode 100644 mkdocs/themes/mkdocs/locales/ja/LC_MESSAGES/messages.po
create mode 100644 mkdocs/themes/readthedocs/locales/ja/LC_MESSAGES/messages.po
diff --git a/docs/user-guide/choosing-your-theme.md b/docs/user-guide/choosing-your-theme.md
index d62dbf9ad1..45e347750d 100644
--- a/docs/user-guide/choosing-your-theme.md
+++ b/docs/user-guide/choosing-your-theme.md
@@ -102,6 +102,7 @@ supports the following options:
* `en`: English (default)
* `fr`: French
* `es`: Spanish
+ * `ja`: Japanese
See the guide on [localizing your theme] for more information.
@@ -174,6 +175,7 @@ theme supports the following options:
* `en`: English (default)
* `fr`: French
* `es`: Spanish
+ * `ja`: Japanese
See the guide on [localizing your theme] for more information.
diff --git a/mkdocs/themes/mkdocs/locales/ja/LC_MESSAGES/messages.po b/mkdocs/themes/mkdocs/locales/ja/LC_MESSAGES/messages.po
new file mode 100644
index 0000000000..1cce02221b
--- /dev/null
+++ b/mkdocs/themes/mkdocs/locales/ja/LC_MESSAGES/messages.po
@@ -0,0 +1,97 @@
+# Japanese translations for MkDocs.
+# Copyright (C) 2021 MkDocs
+# This file is distributed under the same license as the MkDocs project.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MkDocs 1.2\n"
+"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
+"POT-Creation-Date: 2021-04-08 22:44+0200\n"
+"PO-Revision-Date: 2021-07-31 12:06+0900\n"
+"Last-Translator: Goto Hayato \n"
+"Language: ja\n"
+"Language-Team: ja \n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.9.1\n"
+
+#: mkdocs/themes/mkdocs/404.html:8
+msgid "Page not found"
+msgstr "ページが見つかりません"
+
+#: mkdocs/themes/mkdocs/base.html:107
+#: mkdocs/themes/mkdocs/keyboard-modal.html:31
+#: mkdocs/themes/mkdocs/search-modal.html:5
+msgid "Search"
+msgstr "検索"
+
+#: mkdocs/themes/mkdocs/base.html:117
+msgid "Previous"
+msgstr "前へ"
+
+#: mkdocs/themes/mkdocs/base.html:122
+msgid "Next"
+msgstr "次へ"
+
+#: mkdocs/themes/mkdocs/base.html:133 mkdocs/themes/mkdocs/base.html:135
+#: mkdocs/themes/mkdocs/base.html:137 mkdocs/themes/mkdocs/base.html:139
+#, python-format
+msgid "Edit on %(repo_name)s"
+msgstr "%(repo_name)s で編集"
+
+#: mkdocs/themes/mkdocs/base.html:179
+#, python-format
+msgid "Documentation built with %(mkdocs_link)s."
+msgstr "%(mkdocs_link)s でビルドされたドキュメンテーション"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:5
+msgid "Keyboard Shortcuts"
+msgstr "キーボードショートカット"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:6
+#: mkdocs/themes/mkdocs/search-modal.html:6
+msgid "Close"
+msgstr "閉じる"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:12
+msgid "Keys"
+msgstr "キー"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:13
+msgid "Action"
+msgstr "アクション"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:19
+msgid "Open this help"
+msgstr "このヘルプを開く"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:23
+msgid "Next page"
+msgstr "次のページ"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:27
+msgid "Previous page"
+msgstr "前のページ"
+
+#: mkdocs/themes/mkdocs/search-modal.html:9
+msgid "From here you can search these documents. Enter your search terms below."
+msgstr "これらのドキュメントをこちらから検索できます。検索語句を以下に入力してください。"
+
+#: mkdocs/themes/mkdocs/search-modal.html:12
+msgid "Search..."
+msgstr "検索..."
+
+#: mkdocs/themes/mkdocs/search-modal.html:12
+msgid "Type search term here"
+msgstr "検索語句を入力してください"
+
+#: mkdocs/themes/mkdocs/search-modal.html:15
+msgid "No results found"
+msgstr "結果がありません"
+
+#: mkdocs/themes/mkdocs/toc.html:3
+msgid "Table of Contents"
+msgstr "目次"
+
diff --git a/mkdocs/themes/readthedocs/locales/ja/LC_MESSAGES/messages.po b/mkdocs/themes/readthedocs/locales/ja/LC_MESSAGES/messages.po
new file mode 100644
index 0000000000..9003703695
--- /dev/null
+++ b/mkdocs/themes/readthedocs/locales/ja/LC_MESSAGES/messages.po
@@ -0,0 +1,77 @@
+# Japanese translations for MkDocs.
+# Copyright (C) 2021 MkDocs
+# This file is distributed under the same license as the MkDocs project.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MkDocs 1.2\n"
+"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
+"POT-Creation-Date: 2021-04-08 22:46+0200\n"
+"PO-Revision-Date: 2021-07-31 12:07+0900\n"
+"Last-Translator: Goto Hayato \n"
+"Language: ja\n"
+"Language-Team: ja \n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.9.1\n"
+
+#: mkdocs/themes/readthedocs/404.html:7
+msgid "Page not found"
+msgstr "ページが見つかりません"
+
+#: mkdocs/themes/readthedocs/breadcrumbs.html:3
+msgid "Docs"
+msgstr "ドキュメント"
+
+#: mkdocs/themes/readthedocs/breadcrumbs.html:24
+#, python-format
+msgid "Edit on %(repo_name)s"
+msgstr "%(repo_name)s で編集"
+
+#: mkdocs/themes/readthedocs/breadcrumbs.html:33
+#: mkdocs/themes/readthedocs/footer.html:7
+#: mkdocs/themes/readthedocs/versions.html:14
+msgid "Next"
+msgstr "次へ"
+
+#: mkdocs/themes/readthedocs/breadcrumbs.html:36
+#: mkdocs/themes/readthedocs/footer.html:10
+#: mkdocs/themes/readthedocs/versions.html:11
+msgid "Previous"
+msgstr "前へ"
+
+#: mkdocs/themes/readthedocs/footer.html:25
+#, python-format
+msgid ""
+"Built with %(mkdocs_link)s using a %(sphinx_link)s provided by "
+"%(rtd_link)s."
+msgstr "%(rtd_link)s 提供の %(sphinx_link)s を使って "
+"%(mkdocs_link)s でビルドされました。"
+
+#: mkdocs/themes/readthedocs/search.html:5
+msgid "Search Results"
+msgstr "検索結果"
+
+#: mkdocs/themes/readthedocs/search.html:9
+msgid "Search the Docs"
+msgstr "ドキュメントを検索"
+
+#: mkdocs/themes/readthedocs/search.html:9
+#: mkdocs/themes/readthedocs/searchbox.html:3
+msgid "Type search term here"
+msgstr "検索語句を入力してください"
+
+#: mkdocs/themes/readthedocs/search.html:12
+msgid "No results found"
+msgstr "結果がありません"
+
+#: mkdocs/themes/readthedocs/search.html:13
+msgid "Searching..."
+msgstr "検索しています..."
+
+#: mkdocs/themes/readthedocs/searchbox.html:3
+msgid "Search docs"
+msgstr "ドキュメントを検索"
+
From ba7f63ac8172e97d04d2ea2ed30b793e9ec9f98f Mon Sep 17 00:00:00 2001
From: Ultrabug
Date: Wed, 8 Sep 2021 08:48:47 +0200
Subject: [PATCH 10/29] dev guide: remove misleading usage of 'entry_point'
wording (#2563)
closes mkdocs/mkdocs#2558 thx to @hwittenborn
---
docs/dev-guide/plugins.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/dev-guide/plugins.md b/docs/dev-guide/plugins.md
index de5437a4a1..79ed297950 100644
--- a/docs/dev-guide/plugins.md
+++ b/docs/dev-guide/plugins.md
@@ -441,7 +441,7 @@ class MyPlugin(BasePlugin):
### Entry Point
Plugins need to be packaged as Python libraries (distributed on PyPI separate
-from MkDocs) and each must register as a Plugin via a setuptools entry_point.
+from MkDocs) and each must register as a Plugin via a setuptools `entry_points`.
Add the following to your `setup.py` script:
```python
@@ -457,7 +457,7 @@ The `pluginname` would be the name used by users (in the config file) and
(`from path.to.some_plugin import SomePluginClass`) where `SomePluginClass` is a
subclass of [BasePlugin] which defines the plugin behavior. Naturally, multiple
Plugin classes could exist in the same module. Simply define each as a separate
-entry_point.
+entry point.
```python
entry_points={
From 0d8fc8b922488a314636acddb487ab209a2d3d4b Mon Sep 17 00:00:00 2001
From: Jules Topart
Date: Fri, 10 Sep 2021 18:08:02 +0200
Subject: [PATCH 11/29] user guide: correct word repetition (#2567)
---
docs/user-guide/installation.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/user-guide/installation.md b/docs/user-guide/installation.md
index 2748f6fd89..996979e45f 100644
--- a/docs/user-guide/installation.md
+++ b/docs/user-guide/installation.md
@@ -6,7 +6,7 @@ A detailed guide.
## Requirements
-MkDocs requires a recent version of [Python] and the the Python package
+MkDocs requires a recent version of [Python] and the Python package
manager, [pip], to be installed on your system.
You can check if you already have these installed from the command line:
From 1779c181a32b62c89bdfbf888bf7e88a4fce58cf Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Tue, 28 Sep 2021 08:02:27 +0200
Subject: [PATCH 12/29] Delete IP validation test that fails on some versions
of Python (#2587)
---
mkdocs/tests/config/config_options_tests.py | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/mkdocs/tests/config/config_options_tests.py b/mkdocs/tests/config/config_options_tests.py
index e94ee46d72..64996aee9a 100644
--- a/mkdocs/tests/config/config_options_tests.py
+++ b/mkdocs/tests/config/config_options_tests.py
@@ -197,18 +197,6 @@ def test_default_address(self):
self.assertEqual(value.host, '127.0.0.1')
self.assertEqual(value.port, 8000)
- @unittest.skipIf(
- sys.version_info >= (3, 9, 5),
- "Leading zeros not allowed in IP addresses since Python3.9.5",
- )
- def test_IP_normalization(self):
- addr = '127.000.000.001:8000'
- option = config_options.IpAddress(default=addr)
- value = option.validate(None)
- self.assertEqual(str(value), '127.0.0.1:8000')
- self.assertEqual(value.host, '127.0.0.1')
- self.assertEqual(value.port, 8000)
-
@unittest.skipIf(
sys.version_info < (3, 9, 5),
"Leading zeros allowed in IP addresses before Python3.9.5",
From 4ea78da2e93e1165c2600df5f5a66704ff8bc197 Mon Sep 17 00:00:00 2001
From: Martin Donath
Date: Thu, 7 Oct 2021 09:57:14 +0200
Subject: [PATCH 13/29] Allow third-party plugins to override core plugins
(#2591)
* Allow third-party plugins to override core plugins
* Improve resilience of check for core plugin
---
mkdocs/plugins.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/mkdocs/plugins.py b/mkdocs/plugins.py
index 117e182f83..8cd60e2d36 100644
--- a/mkdocs/plugins.py
+++ b/mkdocs/plugins.py
@@ -26,7 +26,15 @@ def get_plugins():
plugins = importlib_metadata.entry_points(group='mkdocs.plugins')
- return {plugin.name: plugin for plugin in plugins}
+ # Allow third-party plugins to override core plugins
+ pluginmap = {}
+ for plugin in plugins:
+ if plugin.name in pluginmap and plugin.value.startswith("mkdocs.contrib."):
+ continue
+
+ pluginmap[plugin.name] = plugin
+
+ return pluginmap
class BasePlugin:
From 0937f7df5150d8a35ec8eae90a449ecf1b81f6b4 Mon Sep 17 00:00:00 2001
From: Ultrabug
Date: Fri, 8 Oct 2021 16:45:24 +0200
Subject: [PATCH 14/29] fix translation installation for locales with script
name (#2565)
when a locale like zh_CN is parsed by babel.core.Locale, the
result Locale is zh_Hans_CN which is then used to find out if
translations exist for this locale name
the Hans part is the guessed script name part of the babel Locale
but is almost never contributed as translation locale name so
we have to make sure what we look for the language + territory
locale name instead of the fully parsed name from babel
---
mkdocs/localization.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mkdocs/localization.py b/mkdocs/localization.py
index 42ddbd6ac7..6f772ec3d4 100644
--- a/mkdocs/localization.py
+++ b/mkdocs/localization.py
@@ -56,9 +56,13 @@ def _get_merged_translations(theme_dirs, locales_dir, locale):
merged_translations = None
log.debug(f"Looking for translations for locale '{locale}'")
+ if locale.territory:
+ locale_str = f"{locale.language}_{locale.territory}"
+ else:
+ locale_str = locale.language
for theme_dir in reversed(theme_dirs):
dirname = os.path.join(theme_dir, locales_dir)
- translations = Translations.load(dirname, [locale])
+ translations = Translations.load(dirname, [locale_str])
if type(translations) is NullTranslations:
log.debug(f"No translations found here: '{dirname}'")
From c426455878556baa34cc829c579337236d335581 Mon Sep 17 00:00:00 2001
From: Ultrabug
Date: Sun, 10 Oct 2021 09:44:08 +0200
Subject: [PATCH 15/29] search plugin: do not crash on missing lang options,
inform instead (#2602)
* search plugin: do not crash on missing lang options, inform instead
- fallback to english on missing search.lang option
- support search.lang territory pt_BR -> pt
---
mkdocs/contrib/search/__init__.py | 25 +++++++++++++++++--------
mkdocs/tests/search_tests.py | 11 +++++++++--
2 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/mkdocs/contrib/search/__init__.py b/mkdocs/contrib/search/__init__.py
index 1ca09863e0..66eb92d88a 100644
--- a/mkdocs/contrib/search/__init__.py
+++ b/mkdocs/contrib/search/__init__.py
@@ -13,20 +13,29 @@
class LangOption(config_options.OptionallyRequired):
""" Validate Language(s) provided in config are known languages. """
- def lang_file_exists(self, lang):
- path = os.path.join(base_path, 'lunr-language', f'lunr.{lang}.js')
- return os.path.isfile(path)
+ def get_lunr_supported_lang(self, lang):
+ for lang_part in lang.split("_"):
+ lang_part = lang_part.lower()
+ if os.path.isfile(os.path.join(base_path, 'lunr-language', f'lunr.{lang_part}.js')):
+ return lang_part
def run_validation(self, value):
if isinstance(value, str):
value = [value]
elif not isinstance(value, (list, tuple)):
raise config_options.ValidationError('Expected a list of language codes.')
- for lang in value:
- if lang != 'en' and not self.lang_file_exists(lang):
- raise config_options.ValidationError(
- f'"{lang}" is not a supported language code.'
- )
+ for lang in list(value):
+ if lang != 'en':
+ lang_detected = self.get_lunr_supported_lang(lang)
+ if not lang_detected:
+ log.info(f"Option search.lang '{lang}' is not supported, falling back to 'en'")
+ value.remove(lang)
+ if 'en' not in value:
+ value.append('en')
+ elif lang_detected != lang:
+ value.remove(lang)
+ value.append(lang_detected)
+ log.info(f"Option search.lang '{lang}' switched to '{lang_detected}'")
return value
diff --git a/mkdocs/tests/search_tests.py b/mkdocs/tests/search_tests.py
index 596da48e8d..439faea741 100644
--- a/mkdocs/tests/search_tests.py
+++ b/mkdocs/tests/search_tests.py
@@ -60,11 +60,18 @@ def test_lang_bad_type(self):
def test_lang_bad_code(self):
option = search.LangOption()
- self.assertRaises(ValidationError, option.validate, ['foo'])
+ value = option.validate(['foo'])
+ self.assertEqual(['en'], value)
def test_lang_good_and_bad_code(self):
option = search.LangOption()
- self.assertRaises(ValidationError, option.validate, ['en', 'foo'])
+ value = option.validate(['en', 'foo'])
+ self.assertEqual(['en'], value)
+
+ def test_lang_missing_and_with_territory(self):
+ option = search.LangOption()
+ value = option.validate(['zh_CN', 'pt_BR', 'fr'])
+ self.assertEqual(['fr', 'en', 'pt'], value)
class SearchPluginTests(unittest.TestCase):
From 17a48105e1853ee6d133d59c6d6556359d7196b5 Mon Sep 17 00:00:00 2001
From: ChrisLasar <16475571+ChrisLasar@users.noreply.github.com>
Date: Sun, 10 Oct 2021 11:09:44 +0200
Subject: [PATCH 16/29] Fix theme related links in first box on starting page
(#2603)
---
docs/index.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/index.md b/docs/index.md
index 43cebdb0bf..f58af71789 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -33,7 +33,8 @@ configuration file. Start by reading the [introductory tutorial], then check the
href="user-guide/choosing-your-theme/#mkdocs">mkdocs and readthedocs,
select one of the third-party themes listed on the MkDocs Themes wiki page, or build your
+ href="https://github.com/mkdocs/mkdocs/wiki/MkDocs-Themes">MkDocs
+ Themes wiki page, or build your
own.
From e579117efeb5681f37d6185d2144d77aa62dad5f Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Mon, 11 Oct 2021 17:37:15 +0200
Subject: [PATCH 17/29] Reduce the range of directories checked by codespell
(#2608)
The main goal was to exclude translations, because obviously they're not in English.
But this also starts with an allowlist on top-level directories because locally myself I had a few false positives such as '.git', 'node_modules'.
---
tox.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tox.ini b/tox.ini
index 869498579d..ad890b636a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -33,7 +33,7 @@ commands=
[testenv:codespell]
deps=codespell
commands=
- {envbindir}/codespell . -S '*.min.js' -S 'lunr.*.js' -S lunr.js -S fontawesome-webfont.svg -S .tox -S venv -S tinyseg.js
+ {envbindir}/codespell mkdocs docs *.* -S .tox -S LC_MESSAGES -S '*.min.js' -S 'lunr*.js' -S fontawesome-webfont.svg -S tinyseg.js
[testenv:linkchecker]
basepython = python2.7
From ba83f902985c08d63c75f61b2bb9a4fee6c78f92 Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Mon, 11 Oct 2021 19:15:34 +0200
Subject: [PATCH 18/29] Depend on 'colorama' on Windows to fix color output in
terminal (#2606)
Adding the explicit dependency, because
1. 'click' prior to v8.0 did not have this dependency, it was used "only if present"
2. We *are* importing it, let's declare it as such
---
mkdocs/__main__.py | 9 +++++++++
requirements/project-min.txt | 1 +
requirements/project.txt | 1 +
3 files changed, 11 insertions(+)
diff --git a/mkdocs/__main__.py b/mkdocs/__main__.py
index a97014d1ae..f196674c54 100644
--- a/mkdocs/__main__.py
+++ b/mkdocs/__main__.py
@@ -12,6 +12,15 @@
from mkdocs import config
from mkdocs.commands import build, gh_deploy, new, serve
+
+if sys.platform.startswith("win"):
+ try:
+ import colorama
+ except ImportError:
+ pass
+ else:
+ colorama.init()
+
log = logging.getLogger(__name__)
diff --git a/requirements/project-min.txt b/requirements/project-min.txt
index 2d9fce6178..20a9327df0 100644
--- a/requirements/project-min.txt
+++ b/requirements/project-min.txt
@@ -12,3 +12,4 @@ mkdocs-redirects==1.0.1
importlib_metadata==3.10.0
packaging==20.5
mergedeep==1.3.4
+colorama==0.4; platform_system == 'Windows'
diff --git a/requirements/project.txt b/requirements/project.txt
index 38b1b38e59..c8fd11335c 100644
--- a/requirements/project.txt
+++ b/requirements/project.txt
@@ -12,3 +12,4 @@ mkdocs-redirects>=1.0.1
importlib_metadata>=3.10
packaging>=20.5
mergedeep>=1.3.4
+colorama>=0.4; platform_system == 'Windows'
From 57540911a0d632674dd23edec765189f96f84f6b Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Mon, 11 Oct 2021 19:16:05 +0200
Subject: [PATCH 19/29] Prevent directory traversal in the dev server (#2604)
---
mkdocs/livereload/__init__.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mkdocs/livereload/__init__.py b/mkdocs/livereload/__init__.py
index c9f7afa8e7..998022de7e 100644
--- a/mkdocs/livereload/__init__.py
+++ b/mkdocs/livereload/__init__.py
@@ -4,6 +4,7 @@
import mimetypes
import os
import os.path
+import posixpath
import re
import socketserver
import threading
@@ -183,9 +184,11 @@ def condition():
if path == "/js/livereload.js":
file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "livereload.js")
elif path.startswith(self.mount_path):
- rel_file_path = path[len(self.mount_path):].lstrip("/")
+ rel_file_path = path[len(self.mount_path):]
if path.endswith("/"):
rel_file_path += "index.html"
+ # Prevent directory traversal - normalize the path.
+ rel_file_path = posixpath.normpath("/" + rel_file_path).lstrip("/")
file_path = os.path.join(self.root, rel_file_path)
elif path == "/":
start_response("302 Found", [("Location", self.mount_path)])
From 7a27572d0e41f0e78239f93693b12b9236eb9905 Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Mon, 11 Oct 2021 19:17:14 +0200
Subject: [PATCH 20/29] Isolate strict warning counter to just the ongoing
build (#2607)
Refactor to eliminate global state.
Fixes the issue with the webserver's warnings being able to abort the build.
---
mkdocs/__main__.py | 5 -----
mkdocs/commands/build.py | 17 ++++++++++++++---
mkdocs/utils/__init__.py | 3 ---
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/mkdocs/__main__.py b/mkdocs/__main__.py
index f196674c54..b82356d47c 100644
--- a/mkdocs/__main__.py
+++ b/mkdocs/__main__.py
@@ -72,11 +72,6 @@ def __init__(self, log_name='mkdocs', level=logging.INFO):
self.stream.name = 'MkDocsStreamHandler'
self.logger.addHandler(self.stream)
- # Add CountHandler for strict mode
- self.counter = utils.log_counter
- self.counter.setLevel(logging.WARNING)
- self.logger.addHandler(self.counter)
-
pass_state = click.make_pass_decorator(State, ensure=True)
diff --git a/mkdocs/commands/build.py b/mkdocs/commands/build.py
index 8936197df4..1fd3182644 100644
--- a/mkdocs/commands/build.py
+++ b/mkdocs/commands/build.py
@@ -240,8 +240,16 @@ def _build_page(page, config, doc_files, nav, env, dirty=False):
def build(config, live_server=False, dirty=False):
""" Perform a full site build. """
- try:
+ logger = logging.getLogger('mkdocs')
+
+ # Add CountHandler for strict mode
+ warning_counter = utils.CountHandler()
+ warning_counter.setLevel(logging.WARNING)
+ if config['strict']:
+ logging.getLogger('mkdocs').addHandler(warning_counter)
+
+ try:
from time import time
start = time()
@@ -308,8 +316,8 @@ def build(config, live_server=False, dirty=False):
# Run `post_build` plugin events.
config['plugins'].run_event('post_build', config=config)
- counts = utils.log_counter.get_counts()
- if config['strict'] and len(counts):
+ counts = warning_counter.get_counts()
+ if counts:
msg = ', '.join([f'{v} {k.lower()}s' for k, v in counts])
raise Abort(f'\nAborted with {msg} in strict mode!')
@@ -323,6 +331,9 @@ def build(config, live_server=False, dirty=False):
raise Abort('\nAborted with a BuildError!')
raise
+ finally:
+ logger.removeHandler(warning_counter)
+
def site_directory_contains_stale_files(site_directory):
""" Check if the site directory contains stale files from a previous build. """
diff --git a/mkdocs/utils/__init__.py b/mkdocs/utils/__init__.py
index d92a836178..4a7b6e8ad3 100644
--- a/mkdocs/utils/__init__.py
+++ b/mkdocs/utils/__init__.py
@@ -442,9 +442,6 @@ def get_counts(self):
return [(logging.getLevelName(k), v) for k, v in sorted(self.counts.items(), reverse=True)]
-# A global instance to use throughout package
-log_counter = CountHandler()
-
# For backward compatibility as some plugins import it.
# It is no longer necessary as all messages on the
# `mkdocs` logger get counted automatically.
From b18ae296593cbc35c6c329a294c3c3c21687ec58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?=
Date: Mon, 11 Oct 2021 19:19:09 +0200
Subject: [PATCH 21/29] Drop `assert_mock_called_once` compat method from tests
(#2611)
Not needed for Python >= 3.6
---
mkdocs/tests/build_tests.py | 38 +++++++++++----------------------
mkdocs/tests/gh_deploy_tests.py | 16 +-------------
2 files changed, 13 insertions(+), 41 deletions(-)
diff --git a/mkdocs/tests/build_tests.py b/mkdocs/tests/build_tests.py
index 00809795e2..87795e7fb1 100644
--- a/mkdocs/tests/build_tests.py
+++ b/mkdocs/tests/build_tests.py
@@ -24,20 +24,6 @@ def build_page(title, path, config, md_src=''):
class BuildTests(PathAssertionMixin, unittest.TestCase):
- def assert_mock_called_once(self, mock):
- """assert that the mock was called only once.
-
- The `mock.assert_called_once()` method was added in PY36.
- TODO: Remove this when PY35 support is dropped.
- """
- try:
- mock.assert_called_once()
- except AttributeError:
- if not mock.call_count == 1:
- mock_name = mock._mock_name or 'mock'
- msg = f"Expected '{mock_name}' to have been called once. Called {self.call_count} times."
- raise AssertionError(msg)
-
def _get_env_with_null_translations(self, config):
env = config['theme'].get_env()
env.add_extension('jinja2.ext.i18n')
@@ -204,8 +190,8 @@ def test_build_theme_template(self, mock_build_template, mock_write_file):
cfg = load_config()
env = cfg['theme'].get_env()
build._build_theme_template('main.html', env, mock.Mock(), cfg, mock.Mock())
- self.assert_mock_called_once(mock_write_file)
- self.assert_mock_called_once(mock_build_template)
+ mock_write_file.assert_called_once()
+ mock_build_template.assert_called_once()
@mock.patch('mkdocs.utils.write_file')
@mock.patch('mkdocs.commands.build._build_template', return_value='some content')
@@ -214,9 +200,9 @@ def test_build_sitemap_template(self, mock_gzip_gzipfile, mock_build_template, m
cfg = load_config()
env = cfg['theme'].get_env()
build._build_theme_template('sitemap.xml', env, mock.Mock(), cfg, mock.Mock())
- self.assert_mock_called_once(mock_write_file)
- self.assert_mock_called_once(mock_build_template)
- self.assert_mock_called_once(mock_gzip_gzipfile)
+ mock_write_file.assert_called_once()
+ mock_build_template.assert_called_once()
+ mock_gzip_gzipfile.assert_called_once()
@mock.patch('mkdocs.utils.write_file')
@mock.patch('mkdocs.commands.build._build_template', return_value='')
@@ -244,7 +230,7 @@ def test_skip_theme_template_empty_output(self, mock_build_template, mock_write_
["INFO:mkdocs.commands.build:Template skipped: 'main.html' generated empty output."]
)
mock_write_file.assert_not_called()
- self.assert_mock_called_once(mock_build_template)
+ mock_build_template.assert_called_once()
# Test build._build_extra_template
@@ -339,7 +325,7 @@ def test_populate_page_read_error(self, docs_dir, mock_open):
"ERROR:mkdocs.commands.build:Error reading page 'missing.md': Error message."
]
)
- self.assert_mock_called_once(mock_open)
+ mock_open.assert_called_once()
@tempdir(files={'index.md': 'page content'})
@mock.patch('mkdocs.plugins.PluginCollection.run_event', side_effect=PluginError('Error message.'))
@@ -354,7 +340,7 @@ def test_populate_page_read_plugin_error(self, docs_dir, mock_open):
"ERROR:mkdocs.commands.build:Error reading page 'index.md':"
]
)
- self.assert_mock_called_once(mock_open)
+ mock_open.assert_called_once()
# Test build._build_page
@@ -390,7 +376,7 @@ def test_build_page(self, site_dir):
# cm.output,
# ["INFO:mkdocs.commands.build:Page skipped: 'index.md'. Generated empty output."]
# )
- # self.assert_mock_called_once(mock_template.render)
+ # mock_template.render.assert_called_once()
# self.assertPathNotFile(site_dir, 'index.html')
@tempdir(files={'index.md': 'page content'})
@@ -420,7 +406,7 @@ def test_build_page_dirty_not_modified(self, site_dir, mock_write_file):
page.markdown = 'page content'
page.content = 'page content
'
build._build_page(page, cfg, files, nav, self._get_env_with_null_translations(cfg), dirty=True)
- self.assert_mock_called_once(mock_write_file)
+ mock_write_file.assert_called_once()
@tempdir()
def test_build_page_custom_template(self, site_dir):
@@ -461,7 +447,7 @@ def test_build_page_error(self, site_dir, mock_write_file):
cm.output,
["ERROR:mkdocs.commands.build:Error building page 'index.md': Error message."]
)
- self.assert_mock_called_once(mock_write_file)
+ mock_write_file.assert_called_once()
@tempdir()
@mock.patch('mkdocs.plugins.PluginCollection.run_event', side_effect=PluginError('Error message.'))
@@ -480,7 +466,7 @@ def test_build_page_plugin_error(self, site_dir, mock_write_file):
cm.output,
["ERROR:mkdocs.commands.build:Error building page 'index.md':"]
)
- self.assert_mock_called_once(mock_write_file)
+ mock_write_file.assert_called_once()
# Test build.build
diff --git a/mkdocs/tests/gh_deploy_tests.py b/mkdocs/tests/gh_deploy_tests.py
index efb87b25e0..f2301df803 100644
--- a/mkdocs/tests/gh_deploy_tests.py
+++ b/mkdocs/tests/gh_deploy_tests.py
@@ -10,20 +10,6 @@
class TestGitHubDeploy(unittest.TestCase):
- def assert_mock_called_once(self, mock):
- """assert that the mock was called only once.
-
- The `mock.assert_called_once()` method was added in PY36.
- TODO: Remove this when PY35 support is dropped.
- """
- try:
- mock.assert_called_once()
- except AttributeError:
- if not mock.call_count == 1:
- mock_name = mock._mock_name or 'mock'
- msg = f"Expected '{mock_name}' to have been called once. Called {self.call_count} times."
- raise AssertionError(msg)
-
@mock.patch('subprocess.Popen')
def test_is_cwd_git_repo(self, mock_popeno):
@@ -128,7 +114,7 @@ def test_deploy_ignore_version_default(self, mock_import, check_version, get_rem
remote_branch='test',
)
gh_deploy.gh_deploy(config)
- self.assert_mock_called_once(check_version)
+ check_version.assert_called_once()
@mock.patch('mkdocs.commands.gh_deploy._is_cwd_git_repo', return_value=True)
@mock.patch('mkdocs.commands.gh_deploy._get_current_sha', return_value='shashas')
From 6b72eef74852d105988e83e0c50fa3c901cc53c1 Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Mon, 11 Oct 2021 19:20:27 +0200
Subject: [PATCH 22/29] We can again announce support of zh_CN locale (#2609)
This reverts commit 1c72c12472898d61e090eae7ffc2dfc263410c59.
---
docs/user-guide/choosing-your-theme.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/user-guide/choosing-your-theme.md b/docs/user-guide/choosing-your-theme.md
index 45e347750d..91d877d675 100644
--- a/docs/user-guide/choosing-your-theme.md
+++ b/docs/user-guide/choosing-your-theme.md
@@ -103,6 +103,7 @@ supports the following options:
* `fr`: French
* `es`: Spanish
* `ja`: Japanese
+ * `zh_CN`: Simplified Chinese
See the guide on [localizing your theme] for more information.
@@ -176,6 +177,7 @@ theme supports the following options:
* `fr`: French
* `es`: Spanish
* `ja`: Japanese
+ * `zh_CN`: Simplified Chinese
See the guide on [localizing your theme] for more information.
From 6563439956409ca691b5df0fb8fccfc91b5a4056 Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Mon, 11 Oct 2021 21:48:47 +0200
Subject: [PATCH 23/29] Update contact instructions: announce chat, preference
for issues (#2610)
* Update contact instructions: announce chat, preference for issues
* Fix mistake in sentence
---
README.md | 16 ++++++++++++----
docs/about/contributing.md | 5 ++++-
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 62bedb8cb0..ee05b63392 100644
--- a/README.md
+++ b/README.md
@@ -27,11 +27,18 @@ user guide.
If you need help with MkDocs, do not hesitate to get in contact with us!
-You can either open a [Discussion] to ask questions or create an [Issue] to
-report a bug or make a feature request. Please note that we may only provide
+- For questions and high-level discussions, use **[Discussions]** on GitHub.
+ - For small questions, a good alternative is the **[Chat room]** on
+ Gitter/Matrix (**new!**)
+- To report a bug or make a feature request, open an **[Issue]** on GitHub.
+
+Please note that we may only provide
support for problems/questions regarding core features of MkDocs. Any
questions or bug reports about features of third-party themes, plugins,
-extensions or similar should be made to their respective projects.
+extensions or similar should be made to their respective projects.
+But, such questions are *not* banned from the [chat room].
+
+Make sure to stick around to answer some questions as well!
## Links
@@ -60,7 +67,8 @@ discussion forums is expected to follow the [PyPA Code of Conduct].
[mkdocs]: https://www.mkdocs.org
[Issue]: https://github.com/mkdocs/mkdocs/issues
-[Discussion]: https://github.com/mkdocs/mkdocs/discussions
+[Discussions]: https://github.com/mkdocs/mkdocs/discussions
+[Chat room]: https://gitter.im/mkdocs/community
[release-notes]: https://www.mkdocs.org/about/release-notes/
[wiki]: https://github.com/mkdocs/mkdocs/wiki
[Contributing Guide]: https://www.mkdocs.org/about/contributing/
diff --git a/docs/about/contributing.md b/docs/about/contributing.md
index cd5b86d80a..670379cf7e 100644
--- a/docs/about/contributing.md
+++ b/docs/about/contributing.md
@@ -70,7 +70,10 @@ Themes]. We welcome translation Pull Requests!
## Submitting Pull Requests
-Once you are happy with your changes or you are ready for some feedback, push
+If you're considering a large code contribution to MkDocs, please prefer to
+open an issue first to get early feedback on the idea.
+
+Once you think the code is ready to be reviewed, push
it to your fork and send a pull request. For a change to be accepted it will
most likely need to have tests and documentation if it is a new feature.
From 815af480d64cc8232bfbd3f722db63752956a149 Mon Sep 17 00:00:00 2001
From: Andre Piantino
Date: Mon, 11 Oct 2021 16:51:49 -0300
Subject: [PATCH 24/29] Added translation for Brazilian Portuguese (#2535)
* Added pt message translation file
* added pt translations
* adjust pt_BR translation
* Added pt message translation file
* added pt translations
* adjust pt_BR translation
* adjust to underscores
* Added pt message translation file
* added pt translations
* adjust pt_BR translation
* Added pt message translation file
* added pt translations
* adjust pt_BR translation
* adjust to underscores
Co-authored-by: nibuitoni
---
docs/user-guide/choosing-your-theme.md | 2 +
.../locales/pt_BR/LC_MESSAGES/messages.po | 97 +++++++++++++++++++
.../locales/pt_BR/LC_MESSAGES/messages.po | 97 +++++++++++++++++++
3 files changed, 196 insertions(+)
create mode 100644 mkdocs/themes/mkdocs/locales/pt_BR/LC_MESSAGES/messages.po
create mode 100644 mkdocs/themes/readthedocs/locales/pt_BR/LC_MESSAGES/messages.po
diff --git a/docs/user-guide/choosing-your-theme.md b/docs/user-guide/choosing-your-theme.md
index 91d877d675..f167b7396e 100644
--- a/docs/user-guide/choosing-your-theme.md
+++ b/docs/user-guide/choosing-your-theme.md
@@ -103,6 +103,7 @@ supports the following options:
* `fr`: French
* `es`: Spanish
* `ja`: Japanese
+ * `pt_BR`: Portuguese (Brazil)
* `zh_CN`: Simplified Chinese
See the guide on [localizing your theme] for more information.
@@ -177,6 +178,7 @@ theme supports the following options:
* `fr`: French
* `es`: Spanish
* `ja`: Japanese
+ * `pt_BR`: Portuguese (Brazil)
* `zh_CN`: Simplified Chinese
See the guide on [localizing your theme] for more information.
diff --git a/mkdocs/themes/mkdocs/locales/pt_BR/LC_MESSAGES/messages.po b/mkdocs/themes/mkdocs/locales/pt_BR/LC_MESSAGES/messages.po
new file mode 100644
index 0000000000..4eedb00f98
--- /dev/null
+++ b/mkdocs/themes/mkdocs/locales/pt_BR/LC_MESSAGES/messages.po
@@ -0,0 +1,97 @@
+# Portuguese translations for MkDocs.
+# Copyright (C) 2021 MkDocs
+# This file is distributed under the same license as the MkDocs project.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MkDocs 1.2\n"
+"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
+"POT-Creation-Date: 2021-04-08 22:44+0200\n"
+"PO-Revision-Date: 2021-09-07 12:06+0200\n"
+"Last-Translator: Nicole Buitoni \n"
+"Language: pt_BR\n"
+"Language-Team: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.9.1\n"
+
+#: mkdocs/themes/mkdocs/404.html:8
+msgid "Page not found"
+msgstr "Página não encontrada"
+
+#: mkdocs/themes/mkdocs/base.html:107
+#: mkdocs/themes/mkdocs/keyboard-modal.html:31
+#: mkdocs/themes/mkdocs/search-modal.html:5
+msgid "Search"
+msgstr "Buscar"
+
+#: mkdocs/themes/mkdocs/base.html:117
+msgid "Previous"
+msgstr "Anterior"
+
+#: mkdocs/themes/mkdocs/base.html:122
+msgid "Next"
+msgstr "Seguinte"
+
+#: mkdocs/themes/mkdocs/base.html:133 mkdocs/themes/mkdocs/base.html:135
+#: mkdocs/themes/mkdocs/base.html:137 mkdocs/themes/mkdocs/base.html:139
+#, python-format
+msgid "Edit on %(repo_name)s"
+msgstr "Editar em %(repo_name)s"
+
+#: mkdocs/themes/mkdocs/base.html:179
+#, python-format
+msgid "Documentation built with %(mkdocs_link)s."
+msgstr "Documentação construída com %(mkdocs_link)s."
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:5
+msgid "Keyboard Shortcuts"
+msgstr "Atalhos de teclado"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:6
+#: mkdocs/themes/mkdocs/search-modal.html:6
+msgid "Close"
+msgstr "Fechar"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:12
+msgid "Keys"
+msgstr "Teclas"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:13
+msgid "Action"
+msgstr "Ação"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:19
+msgid "Open this help"
+msgstr "Abrir esta ajuda"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:23
+msgid "Next page"
+msgstr "Próxima página"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:27
+msgid "Previous page"
+msgstr "Página anterior"
+
+#: mkdocs/themes/mkdocs/search-modal.html:9
+msgid "From here you can search these documents. Enter your search terms below."
+msgstr ""
+"A partir daqui você pode buscar pelo documento. Digite os termos de pesquisa abaixo."
+
+#: mkdocs/themes/mkdocs/search-modal.html:12
+msgid "Search..."
+msgstr "Buscando..."
+
+#: mkdocs/themes/mkdocs/search-modal.html:12
+msgid "Type search term here"
+msgstr "Digite o termo a ser buscado aqui"
+
+#: mkdocs/themes/mkdocs/search-modal.html:15
+msgid "No results found"
+msgstr "Não foram encontrados resultados"
+
+#: mkdocs/themes/mkdocs/toc.html:3
+msgid "Table of Contents"
+msgstr "Tabela de Conteúdos"
diff --git a/mkdocs/themes/readthedocs/locales/pt_BR/LC_MESSAGES/messages.po b/mkdocs/themes/readthedocs/locales/pt_BR/LC_MESSAGES/messages.po
new file mode 100644
index 0000000000..4eedb00f98
--- /dev/null
+++ b/mkdocs/themes/readthedocs/locales/pt_BR/LC_MESSAGES/messages.po
@@ -0,0 +1,97 @@
+# Portuguese translations for MkDocs.
+# Copyright (C) 2021 MkDocs
+# This file is distributed under the same license as the MkDocs project.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: MkDocs 1.2\n"
+"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
+"POT-Creation-Date: 2021-04-08 22:44+0200\n"
+"PO-Revision-Date: 2021-09-07 12:06+0200\n"
+"Last-Translator: Nicole Buitoni \n"
+"Language: pt_BR\n"
+"Language-Team: pt_BR\n"
+"Plural-Forms: nplurals=2; plural=(n != 1)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 2.9.1\n"
+
+#: mkdocs/themes/mkdocs/404.html:8
+msgid "Page not found"
+msgstr "Página não encontrada"
+
+#: mkdocs/themes/mkdocs/base.html:107
+#: mkdocs/themes/mkdocs/keyboard-modal.html:31
+#: mkdocs/themes/mkdocs/search-modal.html:5
+msgid "Search"
+msgstr "Buscar"
+
+#: mkdocs/themes/mkdocs/base.html:117
+msgid "Previous"
+msgstr "Anterior"
+
+#: mkdocs/themes/mkdocs/base.html:122
+msgid "Next"
+msgstr "Seguinte"
+
+#: mkdocs/themes/mkdocs/base.html:133 mkdocs/themes/mkdocs/base.html:135
+#: mkdocs/themes/mkdocs/base.html:137 mkdocs/themes/mkdocs/base.html:139
+#, python-format
+msgid "Edit on %(repo_name)s"
+msgstr "Editar em %(repo_name)s"
+
+#: mkdocs/themes/mkdocs/base.html:179
+#, python-format
+msgid "Documentation built with %(mkdocs_link)s."
+msgstr "Documentação construída com %(mkdocs_link)s."
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:5
+msgid "Keyboard Shortcuts"
+msgstr "Atalhos de teclado"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:6
+#: mkdocs/themes/mkdocs/search-modal.html:6
+msgid "Close"
+msgstr "Fechar"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:12
+msgid "Keys"
+msgstr "Teclas"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:13
+msgid "Action"
+msgstr "Ação"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:19
+msgid "Open this help"
+msgstr "Abrir esta ajuda"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:23
+msgid "Next page"
+msgstr "Próxima página"
+
+#: mkdocs/themes/mkdocs/keyboard-modal.html:27
+msgid "Previous page"
+msgstr "Página anterior"
+
+#: mkdocs/themes/mkdocs/search-modal.html:9
+msgid "From here you can search these documents. Enter your search terms below."
+msgstr ""
+"A partir daqui você pode buscar pelo documento. Digite os termos de pesquisa abaixo."
+
+#: mkdocs/themes/mkdocs/search-modal.html:12
+msgid "Search..."
+msgstr "Buscando..."
+
+#: mkdocs/themes/mkdocs/search-modal.html:12
+msgid "Type search term here"
+msgstr "Digite o termo a ser buscado aqui"
+
+#: mkdocs/themes/mkdocs/search-modal.html:15
+msgid "No results found"
+msgstr "Não foram encontrados resultados"
+
+#: mkdocs/themes/mkdocs/toc.html:3
+msgid "Table of Contents"
+msgstr "Tabela de Conteúdos"
From 83458500608d41af04c07c6cbb20eb6b5072f571 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar?=
Date: Tue, 12 Oct 2021 22:10:48 +0200
Subject: [PATCH 25/29] Add hint about `-f/--config-file` in configuration
documentation (#2616)
---
docs/user-guide/configuration.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/docs/user-guide/configuration.md b/docs/user-guide/configuration.md
index 7c48869837..d7da01eaa6 100644
--- a/docs/user-guide/configuration.md
+++ b/docs/user-guide/configuration.md
@@ -6,8 +6,9 @@ Guide to all available configuration settings.
## Introduction
-Project settings are always configured by using a YAML configuration file in the
-project directory named `mkdocs.yml`.
+Project settings are configured by default using a YAML configuration file in
+the project directory named `mkdocs.yml`. You can specify another path for it
+by using the `-f`/`--config-file` option (see `mkdocs build --help`).
As a minimum, this configuration file must contain the `site_name` and
`site_url` settings. All other settings are optional.
From 9262cc576dede2203edb57db26e8c17115f42035 Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Tue, 12 Oct 2021 22:29:07 +0200
Subject: [PATCH 26/29] Fix the code to abbreviate Python's version (#2618)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This breaks for Python >= 3.10
Co-authored-by: Álvaro Mondéjar Rubio
---
mkdocs/__main__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mkdocs/__main__.py b/mkdocs/__main__.py
index b82356d47c..4afd164b14 100644
--- a/mkdocs/__main__.py
+++ b/mkdocs/__main__.py
@@ -146,7 +146,7 @@ def callback(ctx, param, value):
click.option('--use-directory-urls/--no-directory-urls', is_flag=True, default=None, help=use_directory_urls_help)
])
-PYTHON_VERSION = sys.version[:3]
+PYTHON_VERSION = f"{sys.version_info.major}.{sys.version_info.minor}"
PKG_DIR = os.path.dirname(os.path.abspath(__file__))
From 2c4679b00a4484caa13eef06318652c09e147524 Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Tue, 12 Oct 2021 22:52:24 +0200
Subject: [PATCH 27/29] Re-format translation files to pass a lint check
(#2620)
---
mkdocs/themes/mkdocs/locales/es/LC_MESSAGES/messages.po | 5 +++--
mkdocs/themes/mkdocs/locales/fr/LC_MESSAGES/messages.po | 5 +++--
.../themes/mkdocs/locales/pt_BR/LC_MESSAGES/messages.po | 6 ++++--
.../themes/mkdocs/locales/zh_CN/LC_MESSAGES/messages.po | 8 ++++----
4 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/mkdocs/themes/mkdocs/locales/es/LC_MESSAGES/messages.po b/mkdocs/themes/mkdocs/locales/es/LC_MESSAGES/messages.po
index 5743383f2f..cdd0beef32 100644
--- a/mkdocs/themes/mkdocs/locales/es/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/mkdocs/locales/es/LC_MESSAGES/messages.po
@@ -78,8 +78,8 @@ msgstr "Página anterior"
#: mkdocs/themes/mkdocs/search-modal.html:9
msgid "From here you can search these documents. Enter your search terms below."
msgstr ""
-"Desde aquí puede buscar estos documentos. Ingrese sus términos de búsqueda a "
-"continuación."
+"Desde aquí puede buscar estos documentos. Ingrese sus términos de "
+"búsqueda a continuación."
#: mkdocs/themes/mkdocs/search-modal.html:12
msgid "Search..."
@@ -96,3 +96,4 @@ msgstr "No se encontraron resultados"
#: mkdocs/themes/mkdocs/toc.html:3
msgid "Table of Contents"
msgstr "Tabla de contenidos"
+
diff --git a/mkdocs/themes/mkdocs/locales/fr/LC_MESSAGES/messages.po b/mkdocs/themes/mkdocs/locales/fr/LC_MESSAGES/messages.po
index 711164de31..daebed1bb7 100644
--- a/mkdocs/themes/mkdocs/locales/fr/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/mkdocs/locales/fr/LC_MESSAGES/messages.po
@@ -6,15 +6,16 @@ msgid ""
msgstr ""
"Project-Id-Version: MkDocs 1.2\n"
"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
-"POT-Creation-Date: 2021-04-08 22:46+0200\n"
+"POT-Creation-Date: 2021-04-08 22:44+0200\n"
"PO-Revision-Date: 2021-02-23 23:56+0100\n"
"Last-Translator: Alexys Jacob @ultrabug\n"
"Language: fr\n"
+"Language-Team: fr \n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 2.9.0\n"
+"Generated-By: Babel 2.9.1\n"
#: mkdocs/themes/mkdocs/404.html:8
msgid "Page not found"
diff --git a/mkdocs/themes/mkdocs/locales/pt_BR/LC_MESSAGES/messages.po b/mkdocs/themes/mkdocs/locales/pt_BR/LC_MESSAGES/messages.po
index 4eedb00f98..9034b9936b 100644
--- a/mkdocs/themes/mkdocs/locales/pt_BR/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/mkdocs/locales/pt_BR/LC_MESSAGES/messages.po
@@ -1,4 +1,4 @@
-# Portuguese translations for MkDocs.
+# Portuguese (Brazil) translations for MkDocs.
# Copyright (C) 2021 MkDocs
# This file is distributed under the same license as the MkDocs project.
#
@@ -78,7 +78,8 @@ msgstr "Página anterior"
#: mkdocs/themes/mkdocs/search-modal.html:9
msgid "From here you can search these documents. Enter your search terms below."
msgstr ""
-"A partir daqui você pode buscar pelo documento. Digite os termos de pesquisa abaixo."
+"A partir daqui você pode buscar pelo documento. Digite os termos de "
+"pesquisa abaixo."
#: mkdocs/themes/mkdocs/search-modal.html:12
msgid "Search..."
@@ -95,3 +96,4 @@ msgstr "Não foram encontrados resultados"
#: mkdocs/themes/mkdocs/toc.html:3
msgid "Table of Contents"
msgstr "Tabela de Conteúdos"
+
diff --git a/mkdocs/themes/mkdocs/locales/zh_CN/LC_MESSAGES/messages.po b/mkdocs/themes/mkdocs/locales/zh_CN/LC_MESSAGES/messages.po
index cf875a6ba5..b8cbce85ea 100644
--- a/mkdocs/themes/mkdocs/locales/zh_CN/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/mkdocs/locales/zh_CN/LC_MESSAGES/messages.po
@@ -4,19 +4,18 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: MkDocs\n"
+"Project-Id-Version: MkDocs 1.2\n"
"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
"POT-Creation-Date: 2021-04-08 22:44+0200\n"
"PO-Revision-Date: 2021-07-14 06:00+0800\n"
"Last-Translator: xingkong0113 \n"
"Language: zh_CN\n"
"Language-Team: zh_Hans_CN \n"
-"Plural-Forms: nplurals=1; plural=0;\n"
+"Plural-Forms: nplurals=1; plural=0\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
-"X-Generator: Poedit 3.0\n"
#: mkdocs/themes/mkdocs/404.html:8
msgid "Page not found"
@@ -95,3 +94,4 @@ msgstr "没有搜索到结果"
#: mkdocs/themes/mkdocs/toc.html:3
msgid "Table of Contents"
msgstr "目录"
+
From 5629b09f1a04fdfbbf0704b502c231ec255257ad Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Tue, 12 Oct 2021 23:17:52 +0200
Subject: [PATCH 28/29] Re-format translation files to pass a lint check
(#2621)
Apparently the file 'mkdocs/themes/readthedocs/locales/pt_BR/LC_MESSAGES/messages.po' was just copied from '/mkdocs/' theme, making the translation incomplete, and the reformat just tries its best to pick up the pieces.
---
.../locales/es/LC_MESSAGES/messages.po | 1 +
.../locales/fr/LC_MESSAGES/messages.po | 3 +-
.../locales/ja/LC_MESSAGES/messages.po | 3 +-
.../locales/pt_BR/LC_MESSAGES/messages.po | 100 +++++++-----------
.../locales/zh_CN/LC_MESSAGES/messages.po | 11 +-
5 files changed, 49 insertions(+), 69 deletions(-)
diff --git a/mkdocs/themes/readthedocs/locales/es/LC_MESSAGES/messages.po b/mkdocs/themes/readthedocs/locales/es/LC_MESSAGES/messages.po
index 76af2bce2d..c2ee816814 100644
--- a/mkdocs/themes/readthedocs/locales/es/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/readthedocs/locales/es/LC_MESSAGES/messages.po
@@ -76,3 +76,4 @@ msgstr "Buscando..."
#: mkdocs/themes/readthedocs/searchbox.html:3
msgid "Search docs"
msgstr "Buscar documentos"
+
diff --git a/mkdocs/themes/readthedocs/locales/fr/LC_MESSAGES/messages.po b/mkdocs/themes/readthedocs/locales/fr/LC_MESSAGES/messages.po
index 4990c7be3f..b3409374e2 100644
--- a/mkdocs/themes/readthedocs/locales/fr/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/readthedocs/locales/fr/LC_MESSAGES/messages.po
@@ -10,11 +10,12 @@ msgstr ""
"PO-Revision-Date: 2021-02-23 23:56+0100\n"
"Last-Translator: Alexys Jacob @ultrabug\n"
"Language: fr\n"
+"Language-Team: fr \n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 2.9.0\n"
+"Generated-By: Babel 2.9.1\n"
#: mkdocs/themes/readthedocs/404.html:7
msgid "Page not found"
diff --git a/mkdocs/themes/readthedocs/locales/ja/LC_MESSAGES/messages.po b/mkdocs/themes/readthedocs/locales/ja/LC_MESSAGES/messages.po
index 9003703695..e526548edf 100644
--- a/mkdocs/themes/readthedocs/locales/ja/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/readthedocs/locales/ja/LC_MESSAGES/messages.po
@@ -47,8 +47,7 @@ msgstr "前へ"
msgid ""
"Built with %(mkdocs_link)s using a %(sphinx_link)s provided by "
"%(rtd_link)s."
-msgstr "%(rtd_link)s 提供の %(sphinx_link)s を使って "
-"%(mkdocs_link)s でビルドされました。"
+msgstr "%(rtd_link)s 提供の %(sphinx_link)s を使って %(mkdocs_link)s でビルドされました。"
#: mkdocs/themes/readthedocs/search.html:5
msgid "Search Results"
diff --git a/mkdocs/themes/readthedocs/locales/pt_BR/LC_MESSAGES/messages.po b/mkdocs/themes/readthedocs/locales/pt_BR/LC_MESSAGES/messages.po
index 4eedb00f98..69e819d030 100644
--- a/mkdocs/themes/readthedocs/locales/pt_BR/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/readthedocs/locales/pt_BR/LC_MESSAGES/messages.po
@@ -1,4 +1,4 @@
-# Portuguese translations for MkDocs.
+# Portuguese (Brazil) translations for MkDocs.
# Copyright (C) 2021 MkDocs
# This file is distributed under the same license as the MkDocs project.
#
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: MkDocs 1.2\n"
"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
-"POT-Creation-Date: 2021-04-08 22:44+0200\n"
+"POT-Creation-Date: 2021-04-08 22:46+0200\n"
"PO-Revision-Date: 2021-09-07 12:06+0200\n"
"Last-Translator: Nicole Buitoni \n"
"Language: pt_BR\n"
@@ -17,81 +17,61 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
-#: mkdocs/themes/mkdocs/404.html:8
+#: mkdocs/themes/readthedocs/404.html:7
msgid "Page not found"
msgstr "Página não encontrada"
-#: mkdocs/themes/mkdocs/base.html:107
-#: mkdocs/themes/mkdocs/keyboard-modal.html:31
-#: mkdocs/themes/mkdocs/search-modal.html:5
-msgid "Search"
-msgstr "Buscar"
-
-#: mkdocs/themes/mkdocs/base.html:117
-msgid "Previous"
-msgstr "Anterior"
-
-#: mkdocs/themes/mkdocs/base.html:122
-msgid "Next"
-msgstr "Seguinte"
+#: mkdocs/themes/readthedocs/breadcrumbs.html:3
+msgid "Docs"
+msgstr ""
-#: mkdocs/themes/mkdocs/base.html:133 mkdocs/themes/mkdocs/base.html:135
-#: mkdocs/themes/mkdocs/base.html:137 mkdocs/themes/mkdocs/base.html:139
+#: mkdocs/themes/readthedocs/breadcrumbs.html:24
#, python-format
msgid "Edit on %(repo_name)s"
msgstr "Editar em %(repo_name)s"
-#: mkdocs/themes/mkdocs/base.html:179
-#, python-format
-msgid "Documentation built with %(mkdocs_link)s."
-msgstr "Documentação construída com %(mkdocs_link)s."
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:5
-msgid "Keyboard Shortcuts"
-msgstr "Atalhos de teclado"
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:6
-#: mkdocs/themes/mkdocs/search-modal.html:6
-msgid "Close"
-msgstr "Fechar"
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:12
-msgid "Keys"
-msgstr "Teclas"
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:13
-msgid "Action"
-msgstr "Ação"
-
-#: mkdocs/themes/mkdocs/keyboard-modal.html:19
-msgid "Open this help"
-msgstr "Abrir esta ajuda"
+#: mkdocs/themes/readthedocs/breadcrumbs.html:33
+#: mkdocs/themes/readthedocs/footer.html:7
+#: mkdocs/themes/readthedocs/versions.html:14
+msgid "Next"
+msgstr "Seguinte"
-#: mkdocs/themes/mkdocs/keyboard-modal.html:23
-msgid "Next page"
-msgstr "Próxima página"
+#: mkdocs/themes/readthedocs/breadcrumbs.html:36
+#: mkdocs/themes/readthedocs/footer.html:10
+#: mkdocs/themes/readthedocs/versions.html:11
+msgid "Previous"
+msgstr "Anterior"
-#: mkdocs/themes/mkdocs/keyboard-modal.html:27
-msgid "Previous page"
-msgstr "Página anterior"
+#: mkdocs/themes/readthedocs/footer.html:25
+#, python-format
+msgid ""
+"Built with %(mkdocs_link)s using a %(sphinx_link)s provided by "
+"%(rtd_link)s."
+msgstr ""
-#: mkdocs/themes/mkdocs/search-modal.html:9
-msgid "From here you can search these documents. Enter your search terms below."
+#: mkdocs/themes/readthedocs/search.html:5
+msgid "Search Results"
msgstr ""
-"A partir daqui você pode buscar pelo documento. Digite os termos de pesquisa abaixo."
-#: mkdocs/themes/mkdocs/search-modal.html:12
-msgid "Search..."
-msgstr "Buscando..."
+#: mkdocs/themes/readthedocs/search.html:9
+msgid "Search the Docs"
+msgstr ""
-#: mkdocs/themes/mkdocs/search-modal.html:12
+#: mkdocs/themes/readthedocs/search.html:9
+#: mkdocs/themes/readthedocs/searchbox.html:3
msgid "Type search term here"
msgstr "Digite o termo a ser buscado aqui"
-#: mkdocs/themes/mkdocs/search-modal.html:15
+#: mkdocs/themes/readthedocs/search.html:12
msgid "No results found"
msgstr "Não foram encontrados resultados"
-#: mkdocs/themes/mkdocs/toc.html:3
-msgid "Table of Contents"
-msgstr "Tabela de Conteúdos"
+#: mkdocs/themes/readthedocs/search.html:13
+#, fuzzy
+msgid "Searching..."
+msgstr "Buscando..."
+
+#: mkdocs/themes/readthedocs/searchbox.html:3
+msgid "Search docs"
+msgstr ""
+
diff --git a/mkdocs/themes/readthedocs/locales/zh_CN/LC_MESSAGES/messages.po b/mkdocs/themes/readthedocs/locales/zh_CN/LC_MESSAGES/messages.po
index 36c9f3ca98..6d6d8dd6fb 100644
--- a/mkdocs/themes/readthedocs/locales/zh_CN/LC_MESSAGES/messages.po
+++ b/mkdocs/themes/readthedocs/locales/zh_CN/LC_MESSAGES/messages.po
@@ -4,19 +4,18 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: MkDocs\n"
+"Project-Id-Version: MkDocs 1.2\n"
"Report-Msgid-Bugs-To: https://github.com/mkdocs/mkdocs/issues\n"
"POT-Creation-Date: 2021-04-08 22:46+0200\n"
"PO-Revision-Date: 2021-07-14 06:01+0800\n"
"Last-Translator: xingkong0113 \n"
"Language: zh_CN\n"
"Language-Team: zh_Hans_CN \n"
-"Plural-Forms: nplurals=1; plural=0;\n"
+"Plural-Forms: nplurals=1; plural=0\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.1\n"
-"X-Generator: Poedit 3.0\n"
#: mkdocs/themes/readthedocs/404.html:7
msgid "Page not found"
@@ -48,8 +47,7 @@ msgstr "上一张"
msgid ""
"Built with %(mkdocs_link)s using a %(sphinx_link)s provided by "
"%(rtd_link)s."
-msgstr ""
-"用%(mkdocs_link)s构建,使用%(rtd_link)s提供的%(sphinx_link)s。"
+msgstr "用%(mkdocs_link)s构建,使用%(rtd_link)s提供的%(sphinx_link)s。"
#: mkdocs/themes/readthedocs/search.html:5
msgid "Search Results"
@@ -75,3 +73,4 @@ msgstr "搜索中..."
#: mkdocs/themes/readthedocs/searchbox.html:3
msgid "Search docs"
msgstr "搜索文档"
+
From d167eab473c1b772f0d5f999d580c8bf3ef9b59f Mon Sep 17 00:00:00 2001
From: Oleh Prypin
Date: Tue, 12 Oct 2021 23:27:41 +0200
Subject: [PATCH 29/29] Release 1.2.3 (#2614)
---
docs/about/release-notes.md | 27 +++++++++++++++++++++++++++
mkdocs/__init__.py | 2 +-
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/docs/about/release-notes.md b/docs/about/release-notes.md
index 33e75ad6dd..64aee9f6c3 100644
--- a/docs/about/release-notes.md
+++ b/docs/about/release-notes.md
@@ -21,6 +21,33 @@ The current and past members of the MkDocs team.
* [@d0ugal](https://github.com/d0ugal/)
* [@waylan](https://github.com/waylan/)
+## Version 1.2.3 (2021-10-12)
+
+* Built-in themes now also support these languages:
+ * Simplified Chinese (#2497)
+ * Japanese (#2525)
+ * Brazilian Portuguese (#2535)
+ * Spanish (#2545, previously #2396)
+
+* Third-party plugins will take precedence over built-in plugins with the same
+ name (#2591)
+
+* Bugfix: Fix ability to load translations for some languages:
+ core support (#2565) and search plugin support with fallbacks (#2602)
+
+* Bugfix (regression in 1.2): Prevent directory traversal in the dev server
+ (#2604)
+
+* Bugfix (regression in 1.2): Prevent webserver warnings from being treated as
+ a build failure in strict mode (#2607)
+
+* Bugfix: Correctly print colorful messages in the terminal on Windows (#2606)
+
+* Bugfix: Python version 3.10 was displayed incorrectly in `--version` (#2618)
+
+Other small improvements; see
+[commit log](https://github.com/mkdocs/mkdocs/compare/1.2.2...1.2.3).
+
## Version 1.2.2 (2021-07-18)
* Bugfix (regression in 1.2): Fix serving files/paths with Unicode characters
diff --git a/mkdocs/__init__.py b/mkdocs/__init__.py
index 4cf6396858..69760b0649 100644
--- a/mkdocs/__init__.py
+++ b/mkdocs/__init__.py
@@ -2,4 +2,4 @@
# For acceptable version formats, see https://www.python.org/dev/peps/pep-0440/
-__version__ = '1.2.2'
+__version__ = '1.2.3'