# How to upgrade
Upgrade to the latest version with:
```
pip install --upgrade --force-reinstall mkdocs-material
```
Show the currently installed version with:
```
pip show mkdocs-material
```
## Upgrading from 7.x to 8.x
### What's new?
- Added support for code annotations
- Added support for anchor tracking
- Added support for version warning
- Added `copyright` partial for easier override
- Removed deprecated content tabs legacy implementation
- Removed deprecated `seealso` admonition type
- Removed deprecated `site_keywords` setting (unsupported by MkDocs)
- Removed deprecated prebuilt search index support
- Removed deprecated web app manifest – use customization
- Removed `extracopyright` variable – use new `copyright` partial
- Removed Disqus integation – use customization
- Switched to `:is()` selectors for simple selector lists
- Switched autoprefixer from `last 4 years` to `last 2 years`
- Improved CSS overall to match modern standards
- Improved CSS variable semantics for fonts
- Improved extensibility by restructuring partials
- Improved handling of `details` when printing
- Improved keyboard navigation for footnotes
- Fixed #3214: Search highlighting breaks site when empty
### Changes to `mkdocs.yml`
#### `pymdownx.tabbed`
Support for the legacy style of the [Tabbed] extension was dropped in favor
of the new, alternate implementation which has [better behavior on mobile
viewports]:
=== "8.x"
``` yaml
markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
```
=== "7.x"
``` yaml
markdown_extensions:
- pymdownx.tabbed
```
[Tabbed]: setup/extensions/python-markdown-extensions.md#tabbed
[better behavior on mobile viewports]: https://twitter.com/squidfunk/status/1424740370596958214
#### `pymdownx.superfences`
The `*-experimental` suffix must be removed from the [custom fence][SuperFences]
class property, which is used to target code blocks to be rendered as [diagrams]
using [Mermaid.js]:
=== "8.x"
``` yaml
markdown_extensions:
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
```
=== "7.x"
``` yaml
markdown_extensions:
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid-experimental
format: !!python/name:pymdownx.superfences.fence_code_format
```
[SuperFences]: setup/extensions/python-markdown-extensions.md#superfences
[diagrams]: reference/diagrams.md
[Mermaid.js]: https://mermaid-js.github.io/mermaid/
#### `google_analytics`
This option was [deprecated in MkDocs 1.2.0], as the implementation of a
JavaScript-based analytics integration is the responsibility of a theme.
The following lines must be changed:
=== "8.x"
``` yaml
extra:
analytics:
provider: google
property: UA-XXXXXXXX-X
```
=== "7.x"
``` yaml
google_analytics:
- UA-XXXXXXXX-X
- auto
```
[deprecated in MkDocs 1.2.0]: https://www.mkdocs.org/about/release-notes/#backward-incompatible-changes-in-12
### Changes to `*.html` files { data-search-exclude }
The templates have undergone a set of changes to make them future-proof. If
you've used theme extension to override a block or template, make sure that it
matches the new structure:
- If you've overridden a __block__, check `base.html` for potential changes
- If you've overridden a __template__, check the respective `*.html` file for
potential changes
=== ":octicons-file-code-16: `base.html`"
``` diff
@@ -13,11 +13,6 @@
{% elif config.site_description %}
{% endif %}
- {% if page and page.meta and page.meta.keywords %}
-
- {% elif config.site_keywords %}
-
- {% endif %}
{% if page and page.meta and page.meta.author %}
{% elif config.site_author %}
@@ -61,15 +56,13 @@
font.text | replace(' ', '+') + ':300,400,400i,700%7C' +
font.code | replace(' ', '+')
}}&display=fallback">
-
+
{% endif %}
{% endblock %}
- {% if config.extra.manifest %}
-
- {% endif %}
{% for path in config["extra_css"] %}
{% endfor %}
+ {% include "partials/javascripts/base.html" %}
{% block analytics %}
{% include "partials/integrations/analytics.html" %}
{% endblock %}
@@ -89,7 +82,6 @@
{% endif %}
{% set features = config.theme.features or [] %}
- {% include "partials/javascripts/base.html" %}
{% if not config.theme.palette is mapping %}
{% include "partials/javascripts/palette.html" %}
{% endif %}
@@ -106,13 +98,25 @@