Skip to content

Commit

Permalink
Adding MkDocs for documentation. (#2)
Browse files Browse the repository at this point in the history
* Adding MkDocs for documentation. This commit introduces a minimal implementation of MkDocs.

* Changed the port from 8001 to 8101
  • Loading branch information
vanbuiten authored Jan 31, 2024
1 parent 61b20da commit 212b086
Show file tree
Hide file tree
Showing 7 changed files with 828 additions and 2 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM python:3.12

WORKDIR /opt/meldingen-core

# Install Poetry
RUN set eux; \
curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python; \
cd /usr/local/bin; \
ln -s /opt/poetry/bin/poetry; \
poetry config virtualenvs.create false

COPY ./pyproject.toml ./poetry.lock /opt/meldingen-core/

# Allow installing dev dependencies to run tests
ARG INSTALL_DEV=false
RUN set -eux; \
if [ "$INSTALL_DEV" = "true" ]; then \
poetry install --no-root; \
else \
poetry install --no-root --only main; \
fi

COPY . /opt/meldingen-core
ENV PYTHONPATH=/opt/meldingen-core
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: "3"

services:
meldingen-core:
image: amsterdam/meldingen-core
build:
context: .
args:
INSTALL_DEV: ${INSTALL_DEV-true}
volumes:
- ".:/opt/meldingen-core"

docs:
image: amsterdam/meldingen-core
ports:
- "8101:8000"
volumes:
- ".:/opt/meldingen-core"
entrypoint: mkdocs serve -f /opt/meldingen-core/mkdocs.yml --dev-addr=0.0.0.0:8000
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Welcome to "Meldingen" core
2 changes: 2 additions & 0 deletions docs/summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* [Home](index.md)
* [Summary](summary.md)
37 changes: 37 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
site_name: Meldingen Core
site_description: The "Meldingen" core
repo_url: https://github.com/Amsterdam/meldingen-core

theme:
name: "material"
language: "en"
palette:
# Palette toggle for light mode
- scheme: default
toggle:
icon: material/weather-night
name: Switch to dark mode
# Palette toggle for dark mode
- scheme: slate
toggle:
icon: material/weather-sunny
name: Switch to light mode
features:
- navigation.tabs
- navigation.footer

extra:
generator: false

plugins:
search:
lang: "en"
literate-nav:
nav_file: "summary.md"
mkdocstrings:
handlers:
python:
options:
docstring_style: numpy
show_docstring_examples: true
annotations_path: brief
744 changes: 742 additions & 2 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ python = "^3.12"
isort = "^5.13.2"
mypy = "^1.8.0"
black = "^23.12.1"
mkdocstrings = {version = "^0.24.0", extras = ["python"]}
mkdocs-material = "^9.5.6"
mkdocs-literate-nav = "^0.6.1"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 212b086

Please sign in to comment.