Skip to content

Commit ea02f33

Browse files
committed
Merge branch 'master' into refactor/compatibility
2 parents 638d019 + 0a43974 commit ea02f33

File tree

13 files changed

+84
-38
lines changed

13 files changed

+84
-38
lines changed

CHANGELOG

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
mkdocs-material-8.1.4+insiders-4.5.2 (2022-01-08)
2+
3+
* Fixed #3440: Content tab indicator not moving when using linking
4+
* Fixed #3445: Content tab switch flickers/jitters when using linking
5+
16
mkdocs-material-8.1.4+insiders-4.5.1 (2022-01-02)
27

38
* Added support for setting initial state of cookie consent

docs/insiders/changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ template: overrides/main.html
66

77
## Material for MkDocs Insiders
88

9+
### 4.5.2 <small>_ January 8, 2022</small> { id="4.5.2" }
10+
11+
- Fixed #3440: Content tab indicator not moving when using linking
12+
- Fixed #3445: Content tab switch flickers/jitters when using linking
13+
914
### 4.5.1 <small>_ January 2, 2022</small> { id="4.5.1" }
1015

1116
- Added support for setting initial state of cookie consent

docs/publishing-your-site.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ contents:
2929
name: ci # (1)!
3030
on:
3131
push:
32-
branches: # (2)!
33-
- master
32+
branches:
33+
- master # (2)!
3434
- main
3535
jobs:
3636
deploy:
@@ -126,8 +126,8 @@ contents:
126126
image: python:latest
127127
pages:
128128
stage: deploy
129-
only: # (1)!
130-
- master
129+
only:
130+
- master # (1)!
131131
- main
132132
script:
133133
- pip install mkdocs-material

docs/reference/code-blocks.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ theme:
6161
```
6262

6363
1. :man_raising_hand: I'm a code annotation! I can contain `code`, __formatted
64-
text__, images, ... basically anything that can be expressed in Markdown.
64+
text__, images, ... basically anything that can be written in Markdown.
6565

6666
??? info "Enabling code annotations for a specific code block"
6767

@@ -181,7 +181,7 @@ theme:
181181
```
182182

183183
1. :man_raising_hand: I'm a code annotation! I can contain `code`, __formatted
184-
text__, images, ... basically anything that can be expressed in Markdown.
184+
text__, images, ... basically anything that can be written in Markdown.
185185
````
186186

187187
_Result_:
@@ -193,7 +193,7 @@ theme:
193193
```
194194

195195
1. :man_raising_hand: I'm a code annotation! I can contain `code`, __formatted
196-
text__, images, ... basically anything that can be expressed in Markdown.
196+
text__, images, ... basically anything that can be written in Markdown.
197197

198198
#### Stripping comments
199199

docs/reference/icons-emojis.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
template: overrides/main.html
3-
icon: material/emoticon-wink-outline
3+
icon: material/emoticon-happy-outline
44
---
55

66
# Icons + Emojis

material/assets/javascripts/bundle.d85bccd8.min.js renamed to material/assets/javascripts/bundle.5e13d264.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/javascripts/bundle.d85bccd8.min.js.map renamed to material/assets/javascripts/bundle.5e13d264.min.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/javascripts/workers/search.c0c1e814.min.js renamed to material/assets/javascripts/workers/search.b6ff8c07.min.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/assets/javascripts/workers/search.c0c1e814.min.js.map renamed to material/assets/javascripts/workers/search.b6ff8c07.min.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/base.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
"base": base_url,
185185
"features": features,
186186
"translations": {},
187-
"search": "assets/javascripts/workers/search.c0c1e814.min.js" | url
187+
"search": "assets/javascripts/workers/search.b6ff8c07.min.js" | url
188188
} -%}
189189
{%- if config.extra.version -%}
190190
{%- set _ = app.update({ "version": config.extra.version }) -%}
@@ -213,7 +213,7 @@
213213
</script>
214214
{% endblock %}
215215
{% block scripts %}
216-
<script src="{{ 'assets/javascripts/bundle.d85bccd8.min.js' | url }}"></script>
216+
<script src="{{ 'assets/javascripts/bundle.5e13d264.min.js' | url }}"></script>
217217
{% for path in config["extra_javascript"] %}
218218
<script src="{{ path | url }}"></script>
219219
{% endfor %}

mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ theme:
5555
# - header.autohide
5656
# - navigation.expand
5757
- navigation.indexes
58-
# - navigation.instant
58+
- navigation.instant
5959
- navigation.sections
6060
- navigation.tabs
6161
# - navigation.tabs.sticky

src/assets/javascripts/components/content/annotation/list/index.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ import {
3434

3535
import {
3636
getElement,
37-
getElements
37+
getElements,
38+
getOptionalElement
3839
} from "~/browser"
3940
import { renderAnnotation } from "~/templates"
4041

@@ -118,8 +119,10 @@ export function mountAnnotationList(
118119
const annotations = new Map<number, HTMLElement>()
119120
for (const marker of findAnnotationMarkers(container)) {
120121
const [, id] = marker.textContent!.match(/\((\d+)\)/)!
121-
annotations.set(+id, renderAnnotation(+id))
122-
marker.replaceWith(annotations.get(+id)!)
122+
if (getOptionalElement(`li:nth-child(${id})`, el)) {
123+
annotations.set(+id, renderAnnotation(+id))
124+
marker.replaceWith(annotations.get(+id)!)
125+
}
123126
}
124127

125128
/* Keep list if there are no annotations to render */

src/assets/javascripts/polyfills/index.ts

+47-14
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* Polyfills
2525
* ------------------------------------------------------------------------- */
2626

27-
/* Polyfill for `Object.entries` */
27+
/* Polyfill `Object.entries` */
2828
if (!Object.entries)
2929
Object.entries = function (obj: object) {
3030
const data: [string, string][] = []
@@ -36,7 +36,7 @@ if (!Object.entries)
3636
return data
3737
}
3838

39-
/* Polyfill for `Object.values` */
39+
/* Polyfill `Object.values` */
4040
if (!Object.values)
4141
Object.values = function (obj: object) {
4242
const data: string[] = []
@@ -48,16 +48,49 @@ if (!Object.values)
4848
return data
4949
}
5050

51-
/* Polyfill for `Element.scrollTo` */
52-
if (typeof Element !== "undefined" && !Element.prototype.scrollTo)
53-
Element.prototype.scrollTo = function (
54-
x?: ScrollToOptions | number, y?: number
55-
): void {
56-
if (typeof x === "object") {
57-
this.scrollLeft = x.left!
58-
this.scrollTop = x.top!
59-
} else {
60-
this.scrollLeft = x!
61-
this.scrollTop = y!
51+
/* ------------------------------------------------------------------------- */
52+
53+
/* Polyfills for `Element` */
54+
if (typeof Element !== "undefined") {
55+
56+
/* Polyfill `Element.scrollTo` */
57+
if (!Element.prototype.scrollTo)
58+
Element.prototype.scrollTo = function (
59+
x?: ScrollToOptions | number, y?: number
60+
): void {
61+
if (typeof x === "object") {
62+
this.scrollLeft = x.left!
63+
this.scrollTop = x.top!
64+
} else {
65+
this.scrollLeft = x!
66+
this.scrollTop = y!
67+
}
6268
}
63-
}
69+
70+
/* Polyfill `Element.replaceWith` */
71+
if (!Element.prototype.replaceWith)
72+
Element.prototype.replaceWith = function (
73+
...nodes: Array<string | Node>
74+
): void {
75+
const parent = this.parentNode
76+
if (parent) {
77+
if (nodes.length === 0)
78+
parent.removeChild(this)
79+
80+
/* Replace children and create text nodes */
81+
for (let i = nodes.length - 1; i >= 0; i--) {
82+
let node = nodes[i]
83+
if (typeof node !== "object")
84+
node = document.createTextNode(node)
85+
else if (node.parentNode)
86+
node.parentNode.removeChild(node)
87+
88+
/* Replace child or insert before previous sibling */
89+
if (!i)
90+
parent.replaceChild(node, this)
91+
else
92+
parent.insertBefore(this.previousSibling!, node)
93+
}
94+
}
95+
}
96+
}

0 commit comments

Comments
 (0)