Skip to content

MkDocs 環境サンプル

MkDocs によるドキュメント作成ができる環境サンプルです。ベースイメージを python とし、必要なライブラリを postcreate.sh でインストールします:

ディレクトリ構成

.devcontainer/
├── devcontainer.json
└── scripts
    └── postcreate.sh

設定

devcontainer.json

{
  "name": "MkDocs",
  "image": "mcr.microsoft.com/devcontainers/python:3",
  "postCreateCommand": "bash .devcontainer/scripts/postcreate.sh",
  "features": {},
  "customizations": {
    "vscode": {
      "settings": {
        "editor.formatOnSave": true
      },
      "extensions": ["esbenp.prettier-vscode"]
    }
  }
}

postcreate.sh

#!/bin/bash

pip install mkdocs
pip install mkdocs-material