mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Separated plugin documentation from extensions (#1390)
* Create minify-html.md * Rename docs/minify-html.md to docs/plugins/minify-html.md * Create search.md * Update and rename docs/extensions/revision-date.md to docs/plugins/revision-date.md * Update getting-started.md * Update mkdocs.yml
This commit is contained in:
parent
5960f187d2
commit
c44ea77172
@ -688,36 +688,22 @@ Material theme including more information regarding installation and usage:
|
|||||||
|
|
||||||
## Plugins
|
## Plugins
|
||||||
|
|
||||||
MkDocs's plugin architecture makes it possible to add pre- or post-processing
|
MkDocs's plugin architecture makes it possible to add pre- or post-processing steps that sit between the theme and your documentation. For more information, see the following list of plugins tested and supported by the Material theme including more information regarding installation and usage:
|
||||||
steps that sit between the theme and your documentation. A great example of a
|
|
||||||
third-party plugin is the [mkdocs-minify-plugin][32] which strips all whitespace
|
|
||||||
from the generated documentation.
|
|
||||||
|
|
||||||
Install it with `pip`:
|
* [Minify HTML][32]
|
||||||
|
* [Revision date][33]
|
||||||
|
* [Search][34]
|
||||||
|
|
||||||
``` sh
|
The MkDocs wiki contains a [list of all available plugins][35].
|
||||||
pip install mkdocs-minify-plugin
|
|
||||||
```
|
|
||||||
|
|
||||||
Enable it with the following lines in your `mkdocs.yml`:
|
|
||||||
|
|
||||||
``` yaml
|
|
||||||
plugins:
|
|
||||||
- search
|
|
||||||
- minify:
|
|
||||||
minify_html: true
|
|
||||||
```
|
|
||||||
|
|
||||||
The MkDocs wiki contains a [list of all available plugins][33].
|
|
||||||
|
|
||||||
!!! warning "Remember to re-add the `search` plugin"
|
!!! warning "Remember to re-add the `search` plugin"
|
||||||
|
|
||||||
If you have no `plugins` entry in your config file yet, you'll likely also
|
If you have no `plugins` entry in your config file yet, you'll likely also want to add the `search` plugin when adding additional plugins. MkDocs enables it by default if there is no `plugins` entry set.
|
||||||
want to add the `search` plugin. MkDocs enables it by default if there is
|
|
||||||
no `plugins` entry set.
|
|
||||||
|
|
||||||
[32]: https://github.com/byrnereese/mkdocs-minify-plugin
|
[32]: plugins/minify-html.md
|
||||||
[33]: https://github.com/mkdocs/mkdocs/wiki/MkDocs-Plugins
|
[33]: plugins/revision-date.md
|
||||||
|
[34]: plugins/search.md
|
||||||
|
[35]: https://github.com/mkdocs/mkdocs/wiki/MkDocs-Plugins
|
||||||
|
|
||||||
## Full example
|
## Full example
|
||||||
|
|
||||||
|
32
docs/plugins/minify-html.md
Normal file
32
docs/plugins/minify-html.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Minify HTML
|
||||||
|
|
||||||
|
[mkdocs-minify-plugin][1] is an extension that minifies HTML by stripping all whitespace from the generated documentation.
|
||||||
|
|
||||||
|
[1]: https://github.com/byrnereese/mkdocs-minify-plugin
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Install the plugin using `pip` with the following command:
|
||||||
|
|
||||||
|
``` sh
|
||||||
|
pip install mkdocs-minify-plugin
|
||||||
|
```
|
||||||
|
|
||||||
|
Next, add the following lines to your `mkdocs.yml`:
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
plugins:
|
||||||
|
- search
|
||||||
|
- minify:
|
||||||
|
minify_html: true
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! warning "Remember to re-add the `search` plugin"
|
||||||
|
|
||||||
|
If you have no `plugins` entry in your config file yet, you'll likely also
|
||||||
|
want to add the `search` plugin. MkDocs enables it by default if there is
|
||||||
|
no `plugins` entry set.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
The output is automatically minified by the plugin.
|
@ -9,7 +9,7 @@ be triggered from within a Git repository.
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Install the plugin with the following command:
|
Install the plugin using `pip` with the following command:
|
||||||
|
|
||||||
``` sh
|
``` sh
|
||||||
pip install mkdocs-git-revision-date-localized-plugin
|
pip install mkdocs-git-revision-date-localized-plugin
|
||||||
@ -19,9 +19,16 @@ Next, add the following lines to your `mkdocs.yml`:
|
|||||||
|
|
||||||
``` yaml
|
``` yaml
|
||||||
plugins:
|
plugins:
|
||||||
|
- search
|
||||||
- git-revision-date-localized
|
- git-revision-date-localized
|
||||||
```
|
```
|
||||||
|
|
||||||
|
!!! warning "Remember to re-add the `search` plugin"
|
||||||
|
|
||||||
|
If you have no `plugins` entry in your config file yet, you'll likely also
|
||||||
|
want to add the `search` plugin. MkDocs enables it by default if there is
|
||||||
|
no `plugins` entry set.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
The date is automatically added at the bottom of each page, e.g.:
|
The date is automatically added at the bottom of each page, e.g.:
|
20
docs/plugins/search.md
Normal file
20
docs/plugins/search.md
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Search
|
||||||
|
|
||||||
|
MkDocs enables the search plugin by default if there is no `plugins` entry set in `mkdocs.yml`. If additional plugins are installed, the `search` plugin must be added to your `mkdocs.yml`. See [Site search][1] for more information about how to use search with Material.
|
||||||
|
|
||||||
|
[1]: ../getting-started.md#site-search
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Add the following lines to your `mkdocs.yml`:
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
plugins:
|
||||||
|
- search
|
||||||
|
```
|
||||||
|
|
||||||
|
!!! warning "Remember to re-add the `search` plugin"
|
||||||
|
|
||||||
|
If you have no `plugins` entry in your config file yet, you'll likely also
|
||||||
|
want to add the `search` plugin. MkDocs enables it by default if there is
|
||||||
|
no `plugins` entry set.
|
@ -120,7 +120,10 @@ nav:
|
|||||||
- Metadata: extensions/metadata.md
|
- Metadata: extensions/metadata.md
|
||||||
- Permalinks: extensions/permalinks.md
|
- Permalinks: extensions/permalinks.md
|
||||||
- PyMdown: extensions/pymdown.md
|
- PyMdown: extensions/pymdown.md
|
||||||
- Revision date: extensions/revision-date.md
|
- Plugins:
|
||||||
|
- Minify HTML: plugins/minify-html.md
|
||||||
|
- Revision date: plugins/revision-date.md
|
||||||
|
- Search: plugins/search.md
|
||||||
- Specimen: specimen.md
|
- Specimen: specimen.md
|
||||||
- Customization: customization.md
|
- Customization: customization.md
|
||||||
- Compliance with GDPR: compliance.md
|
- Compliance with GDPR: compliance.md
|
||||||
|
Loading…
Reference in New Issue
Block a user