Skip to content

Commit 6a45180

Browse files
committed
mkdocs: script automating python virtualenv use
1 parent 19786e8 commit 6a45180

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

docs/Developers/index.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,17 @@ approval.
1717
!!! tip inline end
1818
For simple changes you can straight-up just use the edit link available on
1919
every documentation page. It's the pen-icon to the right of the top
20-
heading. Write your changes, preview everything looks as expected and
21-
submit as proposed changes.
20+
heading. Write your changes, check the preview-tab everything looks as
21+
expected and submit as proposed changes.
2222

2323
Documentation is is written as markdown, processed using mkdocs ([docs](https://www.mkdocs.org/user-guide/writing-your-docs/#writing-your-docs)) and the Material theme ([docs](https://squidfunk.github.io/mkdocs-material/reference/)). The Material theme is not just styling, but provides additional syntax extensions.
2424

25-
Setup your system for mkdocs and Material:
26-
```
27-
pip3 install -r requirements-mkdocs.txt
28-
```
29-
30-
To test your local changes while writing them and before making a pull-request:
31-
```
32-
cd ~/IOTstack
33-
mkdocs serve
25+
To test your local changes while writing them and before making a pull-request,
26+
start a local mkdocs server:
27+
``` console
28+
$ ~/IOTstack/scripts/development/mkdocs-serve.sh
3429
```
30+
And then open [http://127.0.0.1:8000/](http://127.0.0.1:8000/) in a browser.
3531

3632
## Creating a new service
3733

scripts/development/mkdocs-serve.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
set -eu
3+
4+
# Install location agnostic "cd ~/IOTstack"
5+
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
6+
7+
# Create python virtualenv and install any changes to the requirements:
8+
virtualenv .virtualenv-mkdocs
9+
source .virtualenv-mkdocs/bin/activate
10+
pip3 install --upgrade -r requirements-mkdocs.txt
11+
12+
mkdocs serve "$@"

0 commit comments

Comments
 (0)