diff --git a/guide/exporting.md b/guide/exporting.md index 705e0a07..105e7889 100644 --- a/guide/exporting.md +++ b/guide/exporting.md @@ -131,6 +131,24 @@ This command also accept multiple entries like for the [export command](#multipl See [Static Hosting](/guide/hosting). +## Exportable docker image + +To support the export feature, there is a bigger docker image with tag **playwright**. Just run following command in your work folder: + +```bash +docker run --name slidev --rm -it \ + -v ${PWD}:/slidev \ + -p 3030:3030 \ + -e NPM_MIRROR="https://registry.npmmirror.com" \ + tangramor/slidev:playwright +``` + +Then you can use the export feature like following under your work folder: + +```bash +docker exec -i slidev npx slidev export --timeout 2m --output slides.pdf +``` + ## Troubleshooting ### Timeout diff --git a/guide/install.md b/guide/install.md index ff78ed75..d30f19f3 100644 --- a/guide/install.md +++ b/guide/install.md @@ -69,10 +69,13 @@ docker run --name slidev --rm -it \ --user node \ -v ${PWD}:/slidev \ -p 3030:3030 \ + -e NPM_MIRROR="https://registry.npmmirror.com" \ tangramor/slidev:latest ``` -If your work folder is empty, it will generate a template `slides.md` and other related files under your work folder, and launch the server on port `3030`. +***Note***: You can use `NPM_MIRROR` to specify a npm mirror to speed up the installation process. + +If your work folder is empty, it will generate a template `slides.md` and other related files under your work folder, and launch the server on port `3030`. You can access your slides from `http://localhost:3030/` @@ -119,6 +122,7 @@ Or create a static image with following Dockerfile: FROM nginx:alpine COPY dist /usr/share/nginx/html + ``` Create the docker image: `docker build -t mystaticppt .`