Skip to content

Commit a650949

Browse files
committed
Updated Insiders documentation
1 parent b825d22 commit a650949

File tree

5 files changed

+87
-41
lines changed

5 files changed

+87
-41
lines changed

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
mkdocs-material-6.2.3+insiders-1.14.0 (2020-12-30)
2+
3+
* Added support for sharing searches
4+
15
mkdocs-material-6.2.3 (2020-12-27)
26

37
* Added back hidden overflow on root container
163 KB
Loading

docs/changelog/insiders.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ template: overrides/main.html
66

77
## Material for MkDocs Insiders
88

9+
### 1.14.0 <small>_ December 30, 2020</small>
10+
11+
- Added support for sharing searches
12+
913
### 1.13.2 <small>_ December 22, 2020</small>
1014

1115
- Fixed version selector + sticky tabs navigation rendering issues

docs/insiders.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ The following features are currently exclusively available to sponsors:
103103
- [x] [Color palette toggle][15]
104104
- [x] [Versioning][14]
105105
- [x] [Site language selection][13]
106-
- [x] [Sticky navigation tabs][18]
106+
- [x] [Sticky navigation tabs][19]
107+
- [x] [Admonition inline blocks][12]
107108
- [x] [Search suggestions][16]
108109
- [x] [Search highlighting][17]
109-
- [x] [Admonition inline blocks][12]
110-
- [x] [Remove generator notice][19]
110+
- [x] [Search sharing][18]
111+
- [x] [Remove generator notice][20]
111112

112113
</div>
113114

@@ -137,7 +138,6 @@ the public for general availability.
137138

138139
#### $ 2,000 – Black Pearl
139140

140-
- [x] Deep linking of search results
141141
- [x] [Color palette toggle][15]
142142
- [ ] Code block palette toggle
143143

@@ -147,31 +147,34 @@ the public for general availability.
147147

148148
- [x] [Search suggestions][16]
149149
- [x] [Search highlighting][17]
150-
- [ ] List of last searches
150+
- [x] [Search sharing][18]
151151

152152
[16]: setup/setting-up-site-search.md#search-suggestions
153153
[17]: setup/setting-up-site-search.md#search-highlighting
154+
[18]: setup/setting-up-site-search.md#search-sharing
154155

155156
#### $ 3,000 – Caribbean Red
156157

157-
- [x] [Sticky navigation tabs][18]
158-
- [x] [Remove generator notice][19]
158+
- [x] [Sticky navigation tabs][19]
159+
- [x] [Remove generator notice][20]
159160
- [ ] Support for index pages
160161

161-
[18]: setup/setting-up-navigation.md#sticky-navigation-tabs
162-
[19]: setup/setting-up-the-footer.md#remove-generator
162+
[19]: setup/setting-up-navigation.md#sticky-navigation-tabs
163+
[20]: setup/setting-up-the-footer.md#remove-generator
163164

164165
#### Future
165166

166-
- [ ] [Material for MkDocs Live Edit][20]
167+
- [ ] [Material for MkDocs Live Edit][21]
167168
- [ ] Improved search result summaries
169+
- [ ] List of last searches
170+
- [ ] Table of contents follows active anchor
168171
- [ ] Table of contents auto-collapse
169172
- [ ] Table of contents shows which sections have search results
170173
- [ ] Native lightbox for (inline) images
171174
- [ ] New layouts and styles (e.g. vertical)
172175
- [ ] ... and much more ...
173176

174-
[20]: https://twitter.com/squidfunk/status/1338252230265360391
177+
[21]: https://twitter.com/squidfunk/status/1338252230265360391
175178

176179
### Goals completed
177180

@@ -207,10 +210,10 @@ implemented behind feature flags; all configuration changes are
207210
backward-compatible. This means that your users will be able to build the
208211
documentation locally with Material for MkDocs and when they push their changes,
209212
it can be built with Insiders (e.g. as part of GitHub Actions). Thus, it's
210-
recommended to [install Insiders][21] only in CI, as you don't want to expose
213+
recommended to [install Insiders][22] only in CI, as you don't want to expose
211214
your `GH_TOKEN` to users.
212215

213-
[21]: publishing-your-site.md#github-pages
216+
[22]: publishing-your-site.md#github-pages
214217

215218
### Terms
216219

@@ -219,7 +222,7 @@ commercial project. Can we use Insiders under the same terms and conditions?_
219222

220223
Yes. Whether you're an individual or a company, you may use _Material for MkDocs
221224
Insiders_ precisely under the same terms as Material for MkDocs, which are given
222-
by the [MIT license][22]. However, we kindly ask you to respect the following
225+
by the [MIT license][23]. However, we kindly ask you to respect the following
223226
guidelines:
224227

225228
- Please __don't distribute the source code__ of Insiders. You may freely use
@@ -230,7 +233,7 @@ guidelines:
230233
- If you cancel your subscription, you're removed as a collaborator and will
231234
miss out on future updates of Insiders. However, you may __use the latest
232235
version__ that's available to you __as long as you like__. Just remember that
233-
[GitHub deletes private forks][23].
236+
[GitHub deletes private forks][24].
234237

235-
[22]: license.md
236-
[23]: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/removing-a-collaborator-from-a-personal-repository
238+
[23]: license.md
239+
[24]: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/removing-a-collaborator-from-a-personal-repository

docs/setup/setting-up-site-search.md

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -203,22 +203,57 @@ A demo is worth a thousand words — check it out at
203203
[11]: ../assets/screenshots/search-highlighting.png
204204
[12]: https://squidfunk.github.io/mkdocs-material-insiders/reference/code-blocks/?h=code+blocks
205205

206+
### Search sharing
207+
208+
[:octicons-file-code-24: Source][8] ·
209+
:octicons-unlock-24: Feature flag ·
210+
:octicons-beaker-24: Experimental ·
211+
[:octicons-heart-fill-24:{: .tx-heart } Insiders only][8]{: .tx-insiders }
212+
213+
When _search sharing_ is activated, a :material-share-variant: share button is
214+
rendered next to the reset button, which allows to deep link to the current
215+
search query and result. It can be enabled via `mkdocs.yml` with:
216+
217+
``` yaml
218+
theme:
219+
features:
220+
- search.share
221+
```
222+
223+
When a user clicks the share button, the URL is automatically copied to the
224+
clipboard.
225+
226+
<figure markdown="1">
227+
228+
[![Search sharing][13]][13]
229+
230+
<figcaption markdown="1">
231+
232+
A demo is worth a thousand words — check it out at
233+
[squidfunk.github.io/mkdocs-material-insiders][14]
234+
235+
</figcaption>
236+
</figure>
237+
238+
[13]: ../assets/screenshots/search-share.png
239+
[14]: https://squidfunk.github.io/mkdocs-material-insiders/setup/setting-up-site-search/?q=share+search
240+
206241
### Offline search
207242

208-
[:octicons-file-code-24: Source][13] ·
209-
[:octicons-cpu-24: Plugin][14] · :octicons-beaker-24: Experimental
243+
[:octicons-file-code-24: Source][15] ·
244+
[:octicons-cpu-24: Plugin][16] · :octicons-beaker-24: Experimental
210245

211246
If you distribute your documentation as `*.html` files, the built-in search
212247
will not work out-of-the-box due to the restrictions modern browsers impose for
213-
security reasons. This can be mitigated with the [localsearch][14] plugin in
214-
combination with @squidfunk's [iframe-worker][15] polyfill.
248+
security reasons. This can be mitigated with the [localsearch][16] plugin in
249+
combination with @squidfunk's [iframe-worker][17] polyfill.
215250

216-
For setup instructions, refer to the [official documentation][16].
251+
For setup instructions, refer to the [official documentation][18].
217252

218-
[13]: https://github.com/squidfunk/mkdocs-material/blob/master/src/base.html
219-
[14]: https://github.com/wilhelmer/mkdocs-localsearch/
220-
[15]: https://github.com/squidfunk/iframe-worker
221-
[16]: https://github.com/wilhelmer/mkdocs-localsearch#installation-material-v5
253+
[15]: https://github.com/squidfunk/mkdocs-material/blob/master/src/base.html
254+
[16]: https://github.com/wilhelmer/mkdocs-localsearch/
255+
[17]: https://github.com/squidfunk/iframe-worker
256+
[18]: https://github.com/wilhelmer/mkdocs-localsearch#installation-material-v5
222257

223258
## Customization
224259

@@ -232,12 +267,12 @@ your needs.
232267

233268
### Query transformation
234269

235-
[:octicons-file-code-24: Source][17] ·
270+
[:octicons-file-code-24: Source][19] ·
236271
:octicons-mortar-board-24: Difficulty: _easy_
237272

238273
When a user enters a query into the search box, the query is pre-processed
239274
before it is submitted to the search index. Material for MkDocs will apply the
240-
following transformations, which can be customized by [extending the theme][18]:
275+
following transformations, which can be customized by [extending the theme][20]:
241276

242277
``` ts
243278
/**
@@ -277,7 +312,7 @@ export function defaultTransform(query: string): string {
277312
If you want to switch to the default behavior of the `mkdocs` or `readthedocs`
278313
template, both of which don't transform the query prior to submission, or
279314
customize the `transform` function, you can do this by [overriding the
280-
`config` block][19]:
315+
`config` block][21]:
281316

282317
``` html
283318
{% block config %}
@@ -294,19 +329,19 @@ customize the `transform` function, you can do this by [overriding the
294329
The `transform` function will receive the query string as entered by the user
295330
and must return the processed query string to be submitted to the search index.
296331

297-
[17]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/transform/index.ts
298-
[18]: ../customization.md#extending-the-theme
299-
[19]: ../customization.md#overriding-blocks
332+
[19]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/transform/index.ts
333+
[20]: ../customization.md#extending-the-theme
334+
[21]: ../customization.md#overriding-blocks
300335

301336
### Custom search
302337

303-
[:octicons-file-code-24: Source][20] ·
338+
[:octicons-file-code-24: Source][22] ·
304339
:octicons-mortar-board-24: Difficulty: _challenging_
305340

306-
Material for MkDocs implements search as part of a [web worker][21]. If you
341+
Material for MkDocs implements search as part of a [web worker][23]. If you
307342
want to switch the web worker with your own implementation, e.g. to submit
308343
search to an external service, you can add a custom JavaScript file to the `docs`
309-
directory and [override the `config` block][19]:
344+
directory and [override the `config` block][21]:
310345

311346
``` html
312347
{% block config %}
@@ -323,8 +358,8 @@ message format using _discriminated unions_, i.e. through the `type` property
323358
of the message. See the following interface definitions to learn about the
324359
message formats:
325360

326-
- [:octicons-file-code-24: `SearchMessage`][22]
327-
- [:octicons-file-code-24: `SearchIndex` and `SearchResult`][23]
361+
- [:octicons-file-code-24: `SearchMessage`][24]
362+
- [:octicons-file-code-24: `SearchIndex` and `SearchResult`][25]
328363

329364
The sequence and direction of messages is rather intuitive:
330365

@@ -333,7 +368,7 @@ The sequence and direction of messages is rather intuitive:
333368
- :octicons-arrow-right-24: `SearchQueryMessage`
334369
- :octicons-arrow-left-24: `SearchResultMessage`
335370

336-
[20]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/worker
337-
[21]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
338-
[22]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/worker/message/index.ts
339-
[23]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/_/index.ts
371+
[22]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/worker
372+
[23]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers
373+
[24]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/worker/message/index.ts
374+
[25]: https://github.com/squidfunk/mkdocs-material/blob/master/src/assets/javascripts/integrations/search/_/index.ts

0 commit comments

Comments
 (0)