Skip to content

Commit 0b68954

Browse files
committed
Use Docker for testing documentation
1 parent a621ea5 commit 0b68954

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

.github/CONTRIBUTING.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,18 @@ Check the Symfony CLI output for IP and port information where the site is runni
2222

2323
## Update documentation
2424

25-
To serve the MkDocs site in `/docs` install dependencies:
26-
27-
```sh
28-
pip install mkdocs mkdocs-material mkdocs-material-extensions
29-
30-
Then serve the docs with live updates:
25+
To serve the MkDocs site in `/docs` ensure you have installed Docker, and run the provided script
26+
to serve the docs with live updates:
3127

3228
```sh
3329
bin/serve-docs
3430
```
3531

3632
By default MkDocs binds to port 8000 and is thus accessible on http://127.0.0.1:8000. If you get a port
37-
conflict, append the `-a` parameter for custom binding:
33+
conflict, pass the bind target as a parameter:
3834

3935
```shell
4036
# Bind to localhost port 4000
41-
bin/serve-docs -a 127.0.0.1:4000
37+
bin/serve-docs 127.0.0.1:4000
4238
```
4339
On pushes to the `master` branch the docs are automatically released to https://omines.github.io/antispam-bundle/

bin/serve-docs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
set -e
33
cd $(dirname $0)/../docs
44

5-
echo "If need be install mkdocs with 'pip install mkdocs-material mkdocs-material-extensions'"
6-
echo "You can choose a different port with 'bin/serve-docs -a 127.0.0.1:4000'"
5+
BIND=${1:-8000}
6+
echo "Serving documentation on http://127.0.0.1:${BIND}"
7+
echo "If you get an 'address already in use' error from Docker, pass another port and/or binding as parameter to this script."
78
echo
8-
mkdocs serve $@
9+
10+
docker run --rm -it -p ${BIND}:8000 -v .:/docs squidfunk/mkdocs-material

0 commit comments

Comments
 (0)