diff --git a/README.md b/README.md index b403492e72..21522cf4cb 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,16 @@ Allows for faster separate re-runs of some of the more involved processes: 1. `yarn dev:extension-types` compile declaration types for `@k8slens/extensions` 1. `yarn dev-run` runs app in dev-mode and auto-restart when main process file has changed +## Development (documentation) + +Run a local instance of `mkdocs serve` in a docker container for developing the Lens Documentation. + +> Prerequisites: docker, yarn + +* `yarn mkdocs-serve-local` - local build and serve of mkdocs with auto update enabled + +Go to [localhost:8000](http://127.0.0.1:8000) + ## Developer's ~~RTFM~~ recommended list: - [TypeScript](https://www.typescriptlang.org/docs/home.html) (front-end/back-end) @@ -53,6 +63,8 @@ Allows for faster separate re-runs of some of the more involved processes: - [ElectronJS](https://www.electronjs.org/docs) (chrome/node) - [NodeJS](https://nodejs.org/dist/latest-v12.x/docs/api/) (api docs) + + ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/lensapp/lens. \ No newline at end of file diff --git a/mkdocs/Dockerfile b/mkdocs/Dockerfile new file mode 100644 index 0000000000..81a82d3443 --- /dev/null +++ b/mkdocs/Dockerfile @@ -0,0 +1,35 @@ +ARG PYTHON_VERSION=3.8.1-alpine3.11 + +FROM python:${PYTHON_VERSION} as builder + +ENV PYTHONUNBUFFERED 1 + +# Set build directory +WORKDIR /wheels + +# Copy files necessary +COPY ./requirements.txt . + +# Perform build and cleanup artifacts +RUN \ + apk add --no-cache \ + git \ + git-fast-import \ + && apk add --no-cache --virtual .build gcc musl-dev \ + && python -m pip install --upgrade pip \ + && pip install -r requirements.txt \ + && apk del .build gcc musl-dev \ + && rm -rf /usr/local/lib/python3.8/site-packages/mkdocs/themes/*/* \ + && rm -rf /tmp/* + + + +# Set final MkDocs working directory +WORKDIR /docs + +# Expose MkDocs development server port +EXPOSE 8000 + +# Start development server by default +ENTRYPOINT ["mkdocs"] +CMD ["serve", "--dev-addr=0.0.0.0:8000"] diff --git a/mkdocs/requirements.txt b/mkdocs/requirements.txt new file mode 100644 index 0000000000..021158cbc9 --- /dev/null +++ b/mkdocs/requirements.txt @@ -0,0 +1,4 @@ +# Direct dependencies +mkdocs==1.1.2 +mkdocs-material==6.1.0 +mkdocs-git-revision-date-localized-plugin==0.7.3 diff --git a/package.json b/package.json index f5251d1cba..8d0016fb2e 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "download:kubectl": "yarn run ts-node build/download_kubectl.ts", "download:helm": "yarn run ts-node build/download_helm.ts", "build:tray-icons": "yarn run ts-node build/build_tray_icon.ts", - "lint": "eslint $@ --ext js,ts,tsx --max-warnings=0 src/" + "lint": "eslint $@ --ext js,ts,tsx --max-warnings=0 src/", + "mkdocs-serve-local": "docker build -t mkdocs-serve-local:latest mkdocs/ && docker run --rm -it -p 8000:8000 -v ${PWD}:/docs mkdocs-serve-local:latest" }, "config": { "bundledKubectlVersion": "1.17.11",