Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding MkDocs for documentation. #2

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading