Skip to content

Commit 2b9136d

Browse files
committed
Added documentation for navigation footer and code actions
1 parent 050bda6 commit 2b9136d

File tree

3 files changed

+60
-13
lines changed

3 files changed

+60
-13
lines changed

docs/schema/theme.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@
439439
"edit": {
440440
"$ref": "#/definitions/icon"
441441
},
442+
"view": {
443+
"$ref": "#/definitions/icon"
444+
},
442445
"logo": {
443446
"$ref": "#/definitions/icon"
444447
},
@@ -580,6 +583,20 @@
580583
"announce.dismiss"
581584
]
582585
},
586+
{
587+
"title": "Edit this page",
588+
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#code-actions",
589+
"enum": [
590+
"content.action.edit"
591+
]
592+
},
593+
{
594+
"title": "View source of this page",
595+
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#code-actions",
596+
"enum": [
597+
"content.action.view"
598+
]
599+
},
583600
{
584601
"title": "Code annotations",
585602
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#code-annotations",
@@ -622,6 +639,13 @@
622639
"navigation.expand"
623640
]
624641
},
642+
{
643+
"title": "Navigation footer",
644+
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#navigation-footer",
645+
"enum": [
646+
"navigation.footer"
647+
]
648+
},
625649
{
626650
"title": "Section index pages",
627651
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#section-index-pages",

docs/setup/adding-a-git-repository.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,47 +97,54 @@ Some popular choices:
9797
[Repository icon default]: https://github.com/squidfunk/mkdocs-material/blob/master/material/.icons/fontawesome/brands/git-alt.svg
9898
[icon search]: ../reference/icons-emojis.md#search
9999

100-
#### Edit button
100+
#### Code actions
101101

102-
[:octicons-tag-24: 0.1.0][Edit button support] ·
103-
:octicons-milestone-24: Default: _automatically set_
102+
[:octicons-tag-24: 9.0.0][Code actions support] ·
103+
:octicons-unlock-24: Feature flag
104104

105-
If the repository URL points to a [GitHub], [GitLab] or [Bitbucket] repository,
106-
an edit button is displayed at the top of each document. This behavior can be
107-
changed by setting [`edit_uri`][edit_uri] in `mkdocs.yml`:
105+
If the [repository URL] points to a [GitHub], [GitLab] or [Bitbucket] repository,
106+
buttons for code actions can be added at the top of each document. Currently,
107+
two types of code actions are supported: `edit` and `view` (GitHub only). Add
108+
the following lines to `mkdocs.yml`:
108109

109-
=== "Customize edit path"
110+
=== ":material-file-edit-outline: Edit this page"
110111

111112
``` yaml
112-
edit_uri: edit/master/docs/
113+
theme:
114+
features:
115+
- code.action.edit
113116
```
114117

115-
=== "Hide edit button"
118+
=== ":material-file-eye-outline: View source of this page"
116119

117120
``` yaml
118-
edit_uri: ""
121+
theme:
122+
features:
123+
- code.action.view
119124
```
120125

121-
The icon of the edit button can be changed with the following lines:
126+
The icon of the edit and view buttons can be changed with the following lines:
122127

123128
``` yaml
124129
theme:
125130
icon:
126131
edit: material/pencil # (1)!
132+
view: material/eye
127133
```
128134

129135
1. Enter a few keywords to find the perfect icon using our [icon search] and
130136
click on the shortcode to copy it to your clipboard:
131137

132138
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
133-
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="material file edit" />
139+
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="material pencil" />
134140
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
135141
<div class="mdx-iconsearch-result__meta"></div>
136142
<ol class="mdx-iconsearch-result__list"></ol>
137143
</div>
138144
</div>
139145

140-
[Edit button support]: https://github.com/squidfunk/mkdocs-material/releases/tag/0.1.0
146+
[Code actions support]: https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.0
147+
[repository URL]: #repository
141148
[edit_uri]: https://www.mkdocs.org/user-guide/configuration/#edit_uri
142149
[GitHub]: https://github.com/
143150
[GitLab]: https://about.gitlab.com/

docs/setup/setting-up-the-footer.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,22 @@ configure via `mkdocs.yml`.
88

99
## Configuration
1010

11+
### Navigation
12+
13+
[:octicons-tag-24: 9.0.0][Navigation footer support] ·
14+
:octicons-unlock-24: Feature flag
15+
16+
The footer can include links to the previous and next page of the current page.
17+
If you wish to enable this behavior, add the following lines to `mkdocs.yml`:
18+
19+
``` yaml
20+
theme:
21+
features:
22+
- navigation.footer
23+
```
24+
25+
[Navigation footer support]: https://github.com/squidfunk/mkdocs-material/releases/tag/9.0.0
26+
1127
### Social links
1228
1329
[:octicons-tag-24: 1.0.0][Social links support] ·

0 commit comments

Comments
 (0)