Added documentation for navigation footer and code actions

This commit is contained in:
squidfunk 2023-01-02 14:45:15 +01:00
parent 050bda6609
commit 2b9136d100
3 changed files with 60 additions and 13 deletions

View File

@ -439,6 +439,9 @@
"edit": { "edit": {
"$ref": "#/definitions/icon" "$ref": "#/definitions/icon"
}, },
"view": {
"$ref": "#/definitions/icon"
},
"logo": { "logo": {
"$ref": "#/definitions/icon" "$ref": "#/definitions/icon"
}, },
@ -580,6 +583,20 @@
"announce.dismiss" "announce.dismiss"
] ]
}, },
{
"title": "Edit this page",
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#code-actions",
"enum": [
"content.action.edit"
]
},
{
"title": "View source of this page",
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#code-actions",
"enum": [
"content.action.view"
]
},
{ {
"title": "Code annotations", "title": "Code annotations",
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#code-annotations", "markdownDescription": "https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#code-annotations",
@ -622,6 +639,13 @@
"navigation.expand" "navigation.expand"
] ]
}, },
{
"title": "Navigation footer",
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#navigation-footer",
"enum": [
"navigation.footer"
]
},
{ {
"title": "Section index pages", "title": "Section index pages",
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#section-index-pages", "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#section-index-pages",

View File

@ -97,47 +97,54 @@ Some popular choices:
[Repository icon default]: https://github.com/squidfunk/mkdocs-material/blob/master/material/.icons/fontawesome/brands/git-alt.svg [Repository icon default]: https://github.com/squidfunk/mkdocs-material/blob/master/material/.icons/fontawesome/brands/git-alt.svg
[icon search]: ../reference/icons-emojis.md#search [icon search]: ../reference/icons-emojis.md#search
#### Edit button #### Code actions
[:octicons-tag-24: 0.1.0][Edit button support] · [:octicons-tag-24: 9.0.0][Code actions support] ·
:octicons-milestone-24: Default: _automatically set_ :octicons-unlock-24: Feature flag
If the repository URL points to a [GitHub], [GitLab] or [Bitbucket] repository, If the [repository URL] points to a [GitHub], [GitLab] or [Bitbucket] repository,
an edit button is displayed at the top of each document. This behavior can be buttons for code actions can be added at the top of each document. Currently,
changed by setting [`edit_uri`][edit_uri] in `mkdocs.yml`: two types of code actions are supported: `edit` and `view` (GitHub only). Add
the following lines to `mkdocs.yml`:
=== "Customize edit path" === ":material-file-edit-outline: Edit this page"
``` yaml ``` yaml
edit_uri: edit/master/docs/ theme:
features:
- code.action.edit
``` ```
=== "Hide edit button" === ":material-file-eye-outline: View source of this page"
``` yaml ``` yaml
edit_uri: "" theme:
features:
- code.action.view
``` ```
The icon of the edit button can be changed with the following lines: The icon of the edit and view buttons can be changed with the following lines:
``` yaml ``` yaml
theme: theme:
icon: icon:
edit: material/pencil # (1)! edit: material/pencil # (1)!
view: material/eye
``` ```
1. Enter a few keywords to find the perfect icon using our [icon search] and 1. Enter a few keywords to find the perfect icon using our [icon search] and
click on the shortcode to copy it to your clipboard: click on the shortcode to copy it to your clipboard:
<div class="mdx-iconsearch" data-mdx-component="iconsearch"> <div class="mdx-iconsearch" data-mdx-component="iconsearch">
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="material file edit" /> <input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="material pencil" />
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file"> <div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
<div class="mdx-iconsearch-result__meta"></div> <div class="mdx-iconsearch-result__meta"></div>
<ol class="mdx-iconsearch-result__list"></ol> <ol class="mdx-iconsearch-result__list"></ol>
</div> </div>
</div> </div>
[Edit button support]: https://github.com/squidfunk/mkdocs-material/releases/tag/0.1.0 [Code actions support]: https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.0
[repository URL]: #repository
[edit_uri]: https://www.mkdocs.org/user-guide/configuration/#edit_uri [edit_uri]: https://www.mkdocs.org/user-guide/configuration/#edit_uri
[GitHub]: https://github.com/ [GitHub]: https://github.com/
[GitLab]: https://about.gitlab.com/ [GitLab]: https://about.gitlab.com/

View File

@ -8,6 +8,22 @@ configure via `mkdocs.yml`.
## Configuration ## Configuration
### Navigation
[:octicons-tag-24: 9.0.0][Navigation footer support] ·
:octicons-unlock-24: Feature flag
The footer can include links to the previous and next page of the current page.
If you wish to enable this behavior, add the following lines to `mkdocs.yml`:
``` yaml
theme:
features:
- navigation.footer
```
[Navigation footer support]: https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.0
### Social links ### Social links
[:octicons-tag-24: 1.0.0][Social links support] · [:octicons-tag-24: 1.0.0][Social links support] ·