Skip to content

Commit

Permalink
mdbook-slide-evaluator: add an example on how to run a local chromedr…
Browse files Browse the repository at this point in the history
…iver
  • Loading branch information
michael-kerscher committed Aug 14, 2024
1 parent 7e51a7d commit 0385205
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions mdbook-slide-evaluator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,46 @@ can focus on the worst violations first.

# How to run

## start a selenium docker container
## start a webdriver compatible browser

### Alternative: Docker

start a selenium docker container and mount the book folder into the container
at /book/

```
$ docker run -d -p 4444:4444 -p 7900:7900 --volume /path/to/my/workspace/comprehensive-rust/book:/book --shm-size="2g" selenium/standalone-chromium:latest
```

As the tool is running with a different base directory, you can use a relative
directory e.g. ../book/ like

```
$ cargo run -- ../book
```

### Alternative: Local webdriver browser with webdriver-manager

use [webdriver-manager](https://pypi.org/project/webdriver-manager/) to install
a e.g. a chromedriver onto your system with:

```
$ pip install selenium webdriver-manager
$ python3
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install(), port=4444))
# end the session when you are done.
```

You can provide the absolute path here as the browser has the same view on the
filesystem:

```
docker run -d -p 4444:4444 -p 7900:7900 --volume /path/to/my/workspace/comprehensive-rust/book:/book --shm-size="2g" selenium/standalone-chromium:latest
$ cargo run -- /path/to/my/workspace/comprehensive-rust/book
```

## run mdbook-slide-size
Expand Down

0 comments on commit 0385205

Please sign in to comment.