From ace46058864bc95491e81330854e330ff123fa73 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sat, 16 Dec 2023 09:56:32 +0100 Subject: [PATCH] Feature: Replace Gitpod by Codespace on docs/main branch (#2703) * Delete gitpod config * Update python dependencies * Fix deprecated mkdocs configurations * Feature: Replace Gitpod by Codespace #2702 * Update documentation * Bump DavidAnson/markdownlint-cli2-action to v14 --- .devcontainer/devcontainer.json | 37 ++++++++++++++++++++++++ .github/workflows/lint-documentation.yml | 2 +- .gitpod.yml | 12 -------- README.md | 15 +++------- mkdocs.yml | 4 +-- requirements.txt | 8 ++--- 6 files changed, 48 insertions(+), 30 deletions(-) create mode 100644 .devcontainer/devcontainer.json delete mode 100644 .gitpod.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..eec4c20c9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,37 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bookworm", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [8000], + + "waitFor": "onCreateCommand", + "updateContentCommand": "pip3 install --user -r requirements.txt", + + "postAttachCommand": { + "server": "mkdocs serve" + }, + + "portsAttributes": { + "8000": { + "label": "Doc", + "onAutoForward": "openPreview" + } + }, + + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python" + ] + } + } + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/workflows/lint-documentation.yml b/.github/workflows/lint-documentation.yml index 713c8d1a7..c82a3052e 100644 --- a/.github/workflows/lint-documentation.yml +++ b/.github/workflows/lint-documentation.yml @@ -10,6 +10,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: DavidAnson/markdownlint-cli2-action@v6 + - uses: DavidAnson/markdownlint-cli2-action@v14 with: globs: 'docs/**/*.md' \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index e2ab04466..000000000 --- a/.gitpod.yml +++ /dev/null @@ -1,12 +0,0 @@ -image: python:latest - -tasks: - - name: mkdocs-material - init: pip install -r requirements.txt - command: | - export PATH="$PATH:/home/gitpod/.local/bin" - mkdocs serve - -ports: - - port: 8000 - onOpen: open-preview diff --git a/README.md b/README.md index ce952d5ea..99976875d 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,14 @@ # IoT Hub Portal Documentation -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/CGI-FR/IoT-Hub-Portal/tree/docs/main) - ## Quick start > The documentation of IoT Hub Portal is based on [https://squidfunk.github.io/mkdocs-material](mkdocs-material). ## Configure dev environment -To install mkdocs-material and required dependencies, you have to run the following command at the root of the project: - -```console -pip install -r requirements.txt -``` +To contribute to IoT Hub Portal's documentation: -After the installation python dependencies, your can start a local review of documentation site by the following command at the root of the project: +- Solution 1: Open this branch on Codespace +- Solutuion 2: Open this branch on a devcontainer using VS Code. -```console -mkdocs serve -``` +On both solutions, a pre-configured development environment will be built, and the documentation website will be run and opened on an embedded browser. diff --git a/mkdocs.yml b/mkdocs.yml index 71ec45c2c..4526377bb 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -71,8 +71,8 @@ markdown_extensions: - pymdownx.caret - pymdownx.details - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg - pymdownx.highlight: anchor_linenums: true linenums: true diff --git a/requirements.txt b/requirements.txt index d50529fca..15568057d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -mkdocs-material==9.0.6 -mike==1.1.2 -mkdocs-macros-plugin==0.7.0 -mkdocs-swagger-ui-tag==0.4.0 \ No newline at end of file +mkdocs-material==9.5.2 +mike==2.0.0 +mkdocs-macros-plugin==1.0.4 +mkdocs-swagger-ui-tag==0.6.7 \ No newline at end of file