From 2b9136d100c224c226c25e3c52c33ab8cccedf37 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Mon, 2 Jan 2023 14:45:15 +0100 Subject: [PATCH] Added documentation for navigation footer and code actions --- docs/schema/theme.json | 24 +++++++++++++++++++ docs/setup/adding-a-git-repository.md | 33 ++++++++++++++++----------- docs/setup/setting-up-the-footer.md | 16 +++++++++++++ 3 files changed, 60 insertions(+), 13 deletions(-) diff --git a/docs/schema/theme.json b/docs/schema/theme.json index 97cafc24e..a9e16ac9e 100644 --- a/docs/schema/theme.json +++ b/docs/schema/theme.json @@ -439,6 +439,9 @@ "edit": { "$ref": "#/definitions/icon" }, + "view": { + "$ref": "#/definitions/icon" + }, "logo": { "$ref": "#/definitions/icon" }, @@ -580,6 +583,20 @@ "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", "markdownDescription": "https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#code-annotations", @@ -622,6 +639,13 @@ "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", "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#section-index-pages", diff --git a/docs/setup/adding-a-git-repository.md b/docs/setup/adding-a-git-repository.md index e14cf940a..700e8a74e 100644 --- a/docs/setup/adding-a-git-repository.md +++ b/docs/setup/adding-a-git-repository.md @@ -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 [icon search]: ../reference/icons-emojis.md#search -#### Edit button +#### Code actions -[:octicons-tag-24: 0.1.0][Edit button support] · -:octicons-milestone-24: Default: _automatically set_ +[:octicons-tag-24: 9.0.0][Code actions support] · +:octicons-unlock-24: Feature flag -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 -changed by setting [`edit_uri`][edit_uri] in `mkdocs.yml`: +If the [repository URL] points to a [GitHub], [GitLab] or [Bitbucket] repository, +buttons for code actions can be added at the top of each document. Currently, +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 - edit_uri: edit/master/docs/ + theme: + features: + - code.action.edit ``` -=== "Hide edit button" +=== ":material-file-eye-outline: View source of this page" ``` 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 theme: icon: edit: material/pencil # (1)! + view: material/eye ``` 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:
- +
    - [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 [GitHub]: https://github.com/ [GitLab]: https://about.gitlab.com/ diff --git a/docs/setup/setting-up-the-footer.md b/docs/setup/setting-up-the-footer.md index c0954be62..0ad550992 100644 --- a/docs/setup/setting-up-the-footer.md +++ b/docs/setup/setting-up-the-footer.md @@ -8,6 +8,22 @@ configure via `mkdocs.yml`. ## 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 [:octicons-tag-24: 1.0.0][Social links support] ·