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.
The homepage has been redesigned. The "Installation" and "Getting Started" sections were moved to their own respective pages. Then, the homepage was restyled so that the list of features appear as a grid of cards.
The developer specific pages were moved to a new section: `dev-guide`. Any old URLs redirect to the new ones.
Environment variables can be assigned as values in the configuration
file using the !ENV tag. Resolves#1954.
The behavior is defined in the third-party package pyyaml_env_tag:
https://github.com/waylan/pyyaml-env-tag
Travis only gives us Node.js version 8 so we must use an older
version of markdownlint. To declare a newer node.js version we
lose the ability to have Python as the lang and install tox.
If/when the default node version gets updated, remove the
version restriction on markdownlint.
Every call to `server.watch` requires `builder` to be passed in. If
users are to add their own watched files, then they need access to
`builder`. Fixes#1952.
Despite Bootswatch not supporting nested dropdowns, the theme-specific CSS for
the mkdocs theme does add support for it, so we can remove the warning from
the release notes.
This patch improves the consistency of TOC levels, so now the level is always
equal to the N in the `<hN>` tag. It also allows users of the MkDocs theme to
set the navigation depth to show in the TOC panel (defaulting to 2).
Resolves#1910 and resolves#770.
* Disable Linkchecker Test.
* Switch to unittest.mock in standard lib.
* Apply `pyupgrade --py3-plus`.
* Note: Using `builtins.open` mocks all calls to `open`, including test setup
(such as in `load_config`). Whereas, `path.to.namespace.open` only mocks
`open` in that namepsace. This all worked differently when we used `io.open`
as that wasn't a builtin to begin with.
* Add a helpful error msg for PY2 users who use non-standard install methods.
Closes#1926.
This only updates the documentation to better reflect actual behavior.
The config for `theme.custom_dir` is defined in the `theme` config
option of `mkdocs.yml`. Therefore, any `mkdocs_theme.yml` file within
a custom_dir is ignored.
Fixes#588 and fixes#1374.
# Some implementation notes:
## `include_homepage_in_sidebar` setting
Note that the homepage is always linked from the site_name above the
search box. Therefore it does not need to also be in the nav tree.
In the upstream Sphinx theme, this is controlled when defining the
toctree. However, Sphinx has a separate setting for identifying the
"homepage". In MkDocs the homepage is identified as the first item in
the `nav`. Therefore, without this setting you can't exclude the
homepage from the sidebar like you can in Sphinx. With this setting we
get feature parity.
## Nested sections
This output is a little weird as the section title is a link that does
nothing when you click it. You need to click the `+` to expand the
submenu. But that is what the upstream theme requires to work.
As pointed out in #1633 the example of overriding a template block used an undefined block name. The example has been updated to use an actual block name.
This is primarily to allow third party themes which inherit from the
mkdocs theme (such as the bootswatch themes) to alter the code
highlighting style. Previously all of the themes hosted their own
highlighting styles, but now that we are using the CDN, it is easier to
use a setting, which downstream themes can override.
In both built-in themes, the default next/prev shortcut keys were
changed from arrows to n/p as the arrows conflict with common browser
accessibility extensions.
In the mkdocs theme, users can now configure the shortcuts to whatever
they want. Note that these config options are theme specific. The
readthedocs theme does not get these options as they are not available
on the parent theme.
Fixes#1502
If the frontmatter is surrounded by YAML deliminators, then it is parsed
as YAML. Otherwise it is parsed as MultiMarkdown meta-data and each
value is returned as a joined string.
Closes#1471.
The built-in themes now include support for enabling/disabling
highlight.js. They also use a CDN to load the files. As the CDN only
includes 23 languages, a second setting to support more languages
is included.
If a user wishes to use a different tool for highlighting, they can
"disable" highlight.js and then use extra_css and/or extra_javasript
to add support for their tool of choice.