Skip to content

Commit

Permalink
Use Docker for testing documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
curry684 committed Jan 25, 2025
1 parent a621ea5 commit 0b68954
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
12 changes: 4 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@ Check the Symfony CLI output for IP and port information where the site is runni

## Update documentation

To serve the MkDocs site in `/docs` install dependencies:

```sh
pip install mkdocs mkdocs-material mkdocs-material-extensions

Then serve the docs with live updates:
To serve the MkDocs site in `/docs` ensure you have installed Docker, and run the provided script
to serve the docs with live updates:

```sh
bin/serve-docs
```

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

```shell
# Bind to localhost port 4000
bin/serve-docs -a 127.0.0.1:4000
bin/serve-docs 127.0.0.1:4000
```
On pushes to the `master` branch the docs are automatically released to https://omines.github.io/antispam-bundle/
8 changes: 5 additions & 3 deletions bin/serve-docs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
set -e
cd $(dirname $0)/../docs

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

docker run --rm -it -p ${BIND}:8000 -v .:/docs squidfunk/mkdocs-material

0 comments on commit 0b68954

Please sign in to comment.