From 7024fa769525543de76d29bbf3a87258f42ab786 Mon Sep 17 00:00:00 2001 From: Dennis Siemensma Date: Mon, 1 Jul 2024 22:39:14 +0200 Subject: [PATCH] Shallow docs setup with MKDocs #1686 --- .readthedocs.yaml | 8 ++---- documentation/docs/index.md | 1 + {wiki => documentation/docs}/reference/API.md | 4 +-- .../static/screenshots/api/api-settings.png | Bin .../docs}/static/screenshots/api/support.png | Bin documentation/mkdocs.yml | 10 ++++++++ documentation/requirements.txt | 1 + provisioning/container/Containerfile-dev | 16 +++--------- provisioning/container/compose.dev.yml | 24 +++++------------- 9 files changed, 26 insertions(+), 38 deletions(-) create mode 100644 documentation/docs/index.md rename {wiki => documentation/docs}/reference/API.md (79%) rename {wiki => documentation/docs}/static/screenshots/api/api-settings.png (100%) rename {wiki => documentation/docs}/static/screenshots/api/support.png (100%) create mode 100644 documentation/mkdocs.yml create mode 100644 documentation/requirements.txt diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 61dc9901..035c55fe 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,13 +10,9 @@ build: tools: python: "3.12" -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: docs/conf.py - # Build documentation with MkDocs -#mkdocs: -# configuration: mkdocs.yml +mkdocs: + configuration: mkdocs.yml python: install: diff --git a/documentation/docs/index.md b/documentation/docs/index.md new file mode 100644 index 00000000..ef5b5d79 --- /dev/null +++ b/documentation/docs/index.md @@ -0,0 +1 @@ +# DSMR-reader documentation diff --git a/wiki/reference/API.md b/documentation/docs/reference/API.md similarity index 79% rename from wiki/reference/API.md rename to documentation/docs/reference/API.md index a917b0f6..23c35db2 100644 --- a/wiki/reference/API.md +++ b/documentation/docs/reference/API.md @@ -5,13 +5,13 @@ The application has an API, allowing you to insert/create readings and retrieve ## Configuration You can access the API-documentation by selecting the **Support** menu item in DSMR-reader. -![Support](/wiki/static/screenshots/api/support.png) +![Screenshot](/static/screenshots/api/support.png) ### Enable API The API is disabled by default in the application. You may enable it in the **Configuration**. -![API settings](/wiki/static/screenshots/api/api-settings.png) +![Screenshot](/static/screenshots/api/api-settings.png) ## API key diff --git a/wiki/static/screenshots/api/api-settings.png b/documentation/docs/static/screenshots/api/api-settings.png similarity index 100% rename from wiki/static/screenshots/api/api-settings.png rename to documentation/docs/static/screenshots/api/api-settings.png diff --git a/wiki/static/screenshots/api/support.png b/documentation/docs/static/screenshots/api/support.png similarity index 100% rename from wiki/static/screenshots/api/support.png rename to documentation/docs/static/screenshots/api/support.png diff --git a/documentation/mkdocs.yml b/documentation/mkdocs.yml new file mode 100644 index 00000000..261cf50f --- /dev/null +++ b/documentation/mkdocs.yml @@ -0,0 +1,10 @@ +site_name: DSMR-reader Documentation +site_url: https://github.com/dsmrreader/dsmr-reader +site_description: DSMR-reader +site_author: Dennis Siemensma +copyright: Dennis Siemensma +theme: readthedocs +locale: en +markdown_extensions: + - toc: + baselevel: 2 diff --git a/documentation/requirements.txt b/documentation/requirements.txt new file mode 100644 index 00000000..43876799 --- /dev/null +++ b/documentation/requirements.txt @@ -0,0 +1 @@ +mkdocs==1.6 diff --git a/provisioning/container/Containerfile-dev b/provisioning/container/Containerfile-dev index 6f87a865..4542f9c9 100644 --- a/provisioning/container/Containerfile-dev +++ b/provisioning/container/Containerfile-dev @@ -25,19 +25,11 @@ ENV POETRY_VIRTUALENVS_IN_PROJECT=true RUN pip install poetry COPY ./src/ /app/ RUN poetry install --with dev --no-root -EXPOSE 8000 ENTRYPOINT ["poetry", "run"] FROM local-dsmrreader-base AS local-dsmrreader-docs -WORKDIR /app-docs -COPY ./docs/requirements.txt /app-docs/ -RUN pip install -r requirements.txt - -FROM local-dsmrreader-docs AS local-dsmrreader-docs-en -EXPOSE 10000 -ENTRYPOINT sphinx-autobuild . /var/tmp/_build/html --host 0.0.0.0 --port 10000 -D language=en - -FROM local-dsmrreader-docs AS local-dsmrreader-docs-nl -EXPOSE 10000 -ENTRYPOINT sphinx-autobuild . /var/tmp/_build/html --host 0.0.0.0 --port 10000 -D language=nl +WORKDIR /app +COPY ./documentation/ /app/ +RUN pip install -r /app/requirements.txt +ENTRYPOINT ["mkdocs"] diff --git a/provisioning/container/compose.dev.yml b/provisioning/container/compose.dev.yml index cc3ec116..e0e60a0f 100644 --- a/provisioning/container/compose.dev.yml +++ b/provisioning/container/compose.dev.yml @@ -47,31 +47,19 @@ services: - ~/Desktop:/run/host/Desktop/ # http://localhost:10000 - dsmr-docs-en: - container_name: dsmr-docs-en - restart: 'unless-stopped' + dsmr-docs: + container_name: dsmr-docs + restart: 'on-failure' + command: 'serve --dev-addr 0.0.0.0:10000' build: context: . dockerfile: provisioning/container/Containerfile-dev - target: local-dsmrreader-docs-en + target: local-dsmrreader-docs volumes: - - ./docs:/app-docs + - ./documentation:/app ports: - '10000:10000' - # http://localhost:10001 - dsmr-docs-nl: - container_name: dsmr-docs-nl - restart: 'unless-stopped' - build: - context: . - dockerfile: provisioning/container/Containerfile-dev - target: local-dsmrreader-docs-nl - volumes: - - ./docs:/app-docs - ports: - - '10001:10000' - mosquitto: container_name: mosquitto-dev image: eclipse-mosquitto:2