Skip to content

Commit db5eee5

Browse files
committed
Improved installation instructions
1 parent 4d7f3d6 commit db5eee5

File tree

2 files changed

+68
-6
lines changed

2 files changed

+68
-6
lines changed

docs/getting-started.md

+47-6
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,48 @@ If not, we recommended using [`docker`][docker].
2020

2121
Material for MkDocs can be installed with `pip`:
2222

23-
```
24-
pip install mkdocs-material
25-
```
23+
=== "Latest"
24+
25+
``` sh
26+
pip install mkdocs-material
27+
```
28+
29+
=== "8.x <small>version range</small>"
30+
31+
``` sh
32+
pip install mkdocs-material=="8.*" #(1)!
33+
```
34+
35+
1. Material for MkDocs uses [semantic versioning][^1], which is why it's a
36+
good idea to limit upgrades to the current major version.
37+
38+
This will make sure that you don't accidentally [upgrade to the next
39+
major version], which may include breaking changes that silently break
40+
your site. Additionally, you can use `pip freeze` to create a lockfile,
41+
so builds are reproducible at all times:
42+
43+
```
44+
pip freeze > requirements.txt
45+
```
46+
47+
Now, the lockfile can be used for installation:
48+
49+
```
50+
pip install -r requirements.txt
51+
```
52+
53+
[^1]:
54+
Note that improvements of existing features are sometimes released as
55+
patch releases, like for example improved rendering of content tabs, as
56+
they're not considered to be new features.
2657

2758
This will automatically install compatible versions of all dependencies:
2859
[MkDocs], [Markdown], [Pygments] and [Python Markdown Extensions]. Material for
2960
MkDocs always strives to support the latest versions, so there's no need to
3061
install those packages separately.
3162

63+
[semantic versioning]: https://semver.org/
64+
[upgrade to the next major version]: upgrade.md
3265
[Markdown]: https://python-markdown.github.io/
3366
[Pygments]: https://pygments.org/
3467
[Python Markdown Extensions]: https://facelessuser.github.io/pymdown-extensions/
@@ -39,9 +72,17 @@ The official [Docker image] is a great way to get up and running in a few
3972
minutes, as it comes with all dependencies pre-installed. Pull the image for the
4073
`latest` version with:
4174

42-
```
43-
docker pull squidfunk/mkdocs-material
44-
```
75+
=== "Latest"
76+
77+
```
78+
docker pull squidfunk/mkdocs-material
79+
```
80+
81+
=== "8.x <small>version range</small>"
82+
83+
```
84+
docker pull squidfunk/mkdocs-material:8
85+
```
4586

4687
The `mkdocs` executable is provided as an entry point and `serve` is the
4788
default command. If you're not familiar with Docker don't worry, we have you

docs/insiders/getting-started.md

+21
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,27 @@ pip install -e mkdocs-material
128128
[Pull App]: https://github.com/apps/pull
129129
[publish]: https://github.com/squidfunk/mkdocs-material-insiders/blob/master/.github/workflows/publish.yml
130130

131+
## Upgrading
132+
133+
When upgrading Insiders, you should always check the version of Material for
134+
MkDocs which makes up the first part of the version qualifier, e.g.Insiders
135+
`4.x.x` is currently based on `8.x.x`:
136+
137+
```
138+
8.x.x-insiders-4.x.x
139+
```
140+
141+
If the major version increased, it's a good idea to consult the [upgrade
142+
guide] and go through the steps to ensure your configuration is up to date and
143+
all necessary changes have been made. If you installed Insiders via `pip`, you
144+
can upgrade your installation with the following command:
145+
146+
```
147+
pip install --upgrade git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git
148+
```
149+
150+
[upgrade guide]: ../upgrade.md
151+
131152
## Caveats
132153

133154
This sections describes some aspects to consider when using Insiders together

0 commit comments

Comments
 (0)