-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Instant Previews are finally here 😎 insiders-4.52.0 ships a new experimental feature that allows the user to preview another documentation page when hovering or focusing a link. You can test it on our documentation! Here's how it looks:
Ohne.Titel.mp4
Sponsors can start using it right now! Why should I sponsor?
Instant previews can either be enabled globally, or for an individual link. Note that this feature is experimental. You can help us test it, so we can find the ideal mode of operation together, pushing it into a stable state. We've enabled it on selected links on our documentation in the reference guide, as well as on all version classifiers.
Usage
Per target page or section (recommended)
The master of Insiders contains a brand new Markdown extension that allows to scope instant previews to specific link targets, which can be pages or entire sections. This is explained in more detail in #6704 (comment):
markdown_extensions:
- attr_list
- material.extensions.preview:
targets:
include:
- changelog/index.md
- customization.md
- insiders/changelog/*
- setup/extensions/*Per link
Make sure to enable Attribute Lists, and add the data-preview attribute to any internal link:
[Link text](URL){ data-preview }Globally
Add the following line to mkdocs.yml:
theme:
features:
- navigation.instant.previewNote that this is not recommended, because it adds an instant preview to each and every link, which can be quite overwhelming. This option is essentially only provided for debugging instant previews themselves.
What's coming next
With your feedback, we will iterate on this feature, quickly pushing it into a stable state, before we will start working on the next big plugin that will come to Material for MkDocs: the glossary plugin. This plugin will allow you to create rich glossaries that go far beyond the rudimentary glossary functionality provided by Material for MkDocs, which will make your documentation more interactive and lift your documentation to the next level ⬆️
As always, we're happy for any feedback we receive from you, as it allows us to build the best possible version of this.