Skip to content

Commit 3daf8e2

Browse files
committed
Improved social cards documentation
1 parent 403580b commit 3daf8e2

File tree

2 files changed

+55
-18
lines changed

2 files changed

+55
-18
lines changed

docs/creating-your-site.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,21 @@ Simply add the following lines to `mkdocs.yml` to enable the theme. Note that
4545
since there are several [installation methods], minimal configuration might be
4646
slightly different:
4747

48-
=== "pip, docker"
48+
=== ":fontawesome-brands-python: pip"
4949

5050
``` yaml
5151
theme:
5252
name: material
5353
```
5454

55-
=== "git"
55+
=== ":fontawesome-brands-docker: docker"
56+
57+
``` yaml
58+
theme:
59+
name: material
60+
```
61+
62+
=== ":fontawesome-brands-git-alt: git"
5663

5764
``` yaml
5865
theme:

docs/setup/setting-up-social-cards.md

+46-16
Original file line numberDiff line numberDiff line change
@@ -105,33 +105,63 @@ The following configuration options are available:
105105

106106
#### Dependencies
107107

108-
Two Python packages are installed alongside to generate the social preview
109-
images, both of which are based on the [Cairo Graphics] library:
108+
Two Python packages are installed alongside Material for MkDocs to generate the
109+
social preview images, both of which are based on the [Cairo Graphics] library:
110110

111111
- [Pillow] – Python imaging library
112112
- [CairoSVG] – Converter for `*.svg` files
113113

114-
In order for the [built-in social cards] plugin to work, follow the
115-
[installation guide] for the [Cairo Graphics] library for your operating system,
116-
and make sure that `zlib`, `libjpeg`, `libfreetype` and `libffi` are installed.
117-
Otherwise you might see warnings such as:
114+
The [Docker image] for Insiders comes with all dependencies pre-installed. If
115+
you don't want to use Docker, see the following section which explains how to
116+
install all dependencies on your system:
118117

119-
```
120-
no library called "cairo" was found
121-
no library called "libcairo-2" was found
122-
cannot load library 'libcairo.so.2': error 0x7e
123-
cannot load library 'libcairo.2.dylib': error 0x7e
124-
cannot load library 'libcairo-2.dll': error 0x7e
125-
```
118+
=== ":material-apple: macOS"
119+
120+
Make sure [Homebrew] is installed, which is a modern package manager for
121+
macOS. Next, use the following command to install all necessary
122+
dependencies:
123+
124+
```
125+
brew install cairo freetype libffi libjpeg libpng zlib
126+
```
127+
128+
=== ":fontawesome-brands-windows: Windows"
129+
130+
As stated in the [installation guide], the easiest way to get up and running
131+
with the [Cairo Graphics] library on Windows is by installing [GTK+], since
132+
it has Cairo as a dependency.
133+
134+
=== ":material-linux: Linux"
126135

127-
_Don't want to bother? The [Docker image] for Insiders comes with all
128-
dependencies pre-installed._
136+
There are several package managers for Linux with varying availability per
137+
distribution. The [installation guide] explains how to install the [Cairo
138+
Graphics] library for your distribution:
139+
140+
=== ":material-ubuntu: Ubuntu"
141+
142+
```
143+
apt-get install libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
144+
```
145+
146+
=== ":material-fedora: Fedora"
147+
148+
```
149+
yum install cairo-devel freetype-devel libffi-devel libjpeg-devel libpng-devel zlib-devel
150+
```
151+
152+
=== ":fontawesome-brands-suse: openSUSE"
153+
154+
```
155+
zypper install cairo-devel freetype-devel libffi-devel libjpeg-devel libpng-devel zlib-devel
156+
```
129157

130158
[Cairo Graphics]: https://www.cairographics.org/
131159
[Pillow]: https://pillow.readthedocs.io/
132160
[CairoSVG]: https://cairosvg.org/
133-
[installation guide]: https://www.cairographics.org/download/
134161
[Docker image]: ../insiders/getting-started.md#with-docker
162+
[Homebrew]: https://brew.sh/
163+
[installation guide]: https://www.cairographics.org/download/
164+
[GTK+]: https://www.gtk.org/docs/installations/windows/
135165

136166
#### Caching <small>recommended</small> { #caching data-toc-label="Caching" }
137167

0 commit comments

Comments
 (0)