diff --git a/Makefile b/Makefile index c8d986b32c..941899f547 100644 --- a/Makefile +++ b/Makefile @@ -847,11 +847,13 @@ prow-postsubmit: bazel-version-dist .PHONY: live-docs live-docs: - @docker run --rm -it -p 3000:3000 -v ${PWD}:/docs aledbf/mkdocs:0.1 + @docker build --pull -t kops/mkdocs images/mkdocs + @docker run --rm -it -p 3000:3000 -v ${PWD}:/docs kops/mkdocs .PHONY: build-docs build-docs: - @docker run --rm -it -v ${PWD}:/docs aledbf/mkdocs:0.1 build + @docker build --pull -t kops/mkdocs images/mkdocs + @docker run --rm -v ${PWD}:/docs kops/mkdocs build # Update machine_types.go .PHONY: update-machine-types diff --git a/docs/apireference/build/node_modules/jquery/README.md b/docs/apireference/build/node_modules/jquery/README.md index 09a4273e86..7e41eae5f3 100644 --- a/docs/apireference/build/node_modules/jquery/README.md +++ b/docs/apireference/build/node_modules/jquery/README.md @@ -47,7 +47,7 @@ define(["jquery"], function($) { ### Node -To include jQuery in [Node](nodejs.org), first install with npm. +To include jQuery in [Node](http://nodejs.org), first install with npm. ```sh npm install jquery diff --git a/images/mkdocs/Dockerfile b/images/mkdocs/Dockerfile new file mode 100644 index 0000000000..32c0c69df9 --- /dev/null +++ b/images/mkdocs/Dockerfile @@ -0,0 +1,40 @@ +# Copyright 2019 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM alpine:3.10 + +RUN apk update && apk add --no-cache \ + bash \ + git \ + git-fast-import \ + openssh \ + python3 \ + python3-dev \ + curl \ + && python3 -m ensurepip \ + && rm -r /usr/lib/python*/ensurepip \ + && pip3 install --upgrade pip setuptools \ + && rm -r /root/.cache \ + && rm -rf /var/cache/apk/* + +COPY requirements.txt /requirements.txt +RUN pip install -U -r /requirements.txt + +WORKDIR /docs + +EXPOSE 3000 + +COPY entrypoint.sh / + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/images/mkdocs/entrypoint.sh b/images/mkdocs/entrypoint.sh new file mode 100755 index 0000000000..19d8399278 --- /dev/null +++ b/images/mkdocs/entrypoint.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Copyright 2019 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o pipefail + +CMD=$1 + +if [ "$CMD" == "build" ]; +then + mkdocs build + exit 0; +fi + +mkdocs serve --dev-addr=0.0.0.0:3000 --livereload diff --git a/images/mkdocs/requirements.txt b/images/mkdocs/requirements.txt new file mode 100644 index 0000000000..af7386e4ca --- /dev/null +++ b/images/mkdocs/requirements.txt @@ -0,0 +1,5 @@ +mkdocs-material~=4.4.0 +mkdocs~=1.0.4 +# mkdocs-awesome-pages-plugin~=1.2.0 +pymdown-extensions~=6.1 +pygments~=2.3.1 \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index ba02a1b654..b677bbaf71 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,7 +6,9 @@ markdown_extensions: - admonition - codehilite - pymdownx.inlinehilite - - pymdownx.tasklist(custom_checkbox=true) + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.superfences - toc: permalink: true theme: @@ -20,7 +22,6 @@ theme: accent: 'green' plugins: - search - - awesome-pages: - collapse_single_pages: true + extra_css: [extra.css] #google_analytics: ['UA-XXXXXXX-X', 'kubernetes.github.io'] diff --git a/requirements-docs.txt b/requirements-docs.txt deleted file mode 100644 index 0d2bfd4c83..0000000000 --- a/requirements-docs.txt +++ /dev/null @@ -1,5 +0,0 @@ -mkdocs-material~=2.7.0 -mkdocs-awesome-pages-plugin~=1.2.0 -mkdocs~=0.17.0 -pygments~=2.2.0 -pymdown-extensions~=4.10 \ No newline at end of file