@@ -97,47 +97,54 @@ Some popular choices:
97
97
[Repository icon default] : https://github.com/squidfunk/mkdocs-material/blob/master/material/.icons/fontawesome/brands/git-alt.svg
98
98
[icon search] : ../reference/icons-emojis.md#search
99
99
100
- # ### Edit button
100
+ # ### Code actions
101
101
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
104
104
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` :
108
109
109
- === "Customize edit path "
110
+ === ":material-file- edit-outline : Edit this page "
110
111
111
112
` ` ` yaml
112
- edit_uri: edit/master/docs/
113
+ theme:
114
+ features:
115
+ - code.action.edit
113
116
` ` `
114
117
115
- === "Hide edit button "
118
+ === ":material-file-eye-outline : View source of this page "
116
119
117
120
` ` ` yaml
118
- edit_uri: ""
121
+ theme:
122
+ features:
123
+ - code.action.view
119
124
` ` `
120
125
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 :
122
127
123
128
` ` ` yaml
124
129
theme:
125
130
icon:
126
131
edit: material/pencil # (1)!
132
+ view: material/eye
127
133
` ` `
128
134
129
135
1. Enter a few keywords to find the perfect icon using our [icon search] and
130
136
click on the shortcode to copy it to your clipboard :
131
137
132
138
<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 " />
134
140
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
135
141
<div class="mdx-iconsearch-result__meta"></div>
136
142
<ol class="mdx-iconsearch-result__list"></ol>
137
143
</div>
138
144
</div>
139
145
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
141
148
[edit_uri] : https://www.mkdocs.org/user-guide/configuration/#edit_uri
142
149
[GitHub] : https://github.com/
143
150
[GitLab] : https://about.gitlab.com/
0 commit comments