Skip to content

Commit 3db3fea

Browse files
authored
Merge pull request #192 from bas-amop/dw/materialdocs
Change docs theme to material
2 parents 554251e + 7297607 commit 3db3fea

File tree

4 files changed

+77
-13
lines changed

4 files changed

+77
-13
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ jobs:
2626
- name: Install dependencies 🛠️
2727
run: |
2828
python -m pip install --upgrade pip
29-
python -m pip install mkdocs mkdocs-autoapi mkdocs-include-markdown-plugin mkdocstrings[python] mkdocs-render-swagger-plugin
29+
python -m pip install .
30+
python -m pip install --group docs
3031
- name: Build docs 📖
3132
run: mkdocs build
3233
- name: Deploy docs 🚀

mkdocs.yml

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,49 @@
11
site_name: PolarRoute-Server
22
repo_url: https://github.com/bas-amop/polarroute-server/
33
edit_uri: edit/main/docs/
4-
theme: readthedocs
4+
theme:
5+
name: material
6+
logo: https://cdn.web.bas.ac.uk/bas-style-kit/0.7.3/img/logos-symbols/bas-roundel-inverse-transparent-64.png
7+
favicon: https://cdn.web.bas.ac.uk/bas-style-kit/0.7.3/img/favicon/favicon-16x16.png
8+
icon:
9+
repo: fontawesome/brands/github
10+
features:
11+
# Enables copying of code blocks
12+
- content.code.copy
13+
# Enables "edit this page" to contribute to docs
14+
- content.action.edit
15+
palette:
16+
# Palette toggle for light mode
17+
- media: "(prefers-color-scheme: light)"
18+
scheme: default
19+
primary: orange
20+
toggle:
21+
icon: material/brightness-7
22+
name: Switch to dark mode
23+
# Palette toggle for dark mode
24+
- media: "(prefers-color-scheme: dark)"
25+
scheme: slate
26+
primary: orange
27+
toggle:
28+
icon: material/brightness-4
29+
name: Switch to light mode
30+
531
plugins:
632
- search
7-
- mkdocstrings
33+
- mkdocstrings:
34+
handlers:
35+
python:
36+
paths:
37+
- .
38+
options:
39+
docstring_style: google
40+
# show_object_full_path: true
41+
merge_init_into_class: true
42+
show_docstring_functions: true
43+
show_docstring_classes: true
44+
show_source: false
845
- mkdocs-autoapi:
46+
autoapi_dir: .
947
autoapi_ignore:
1048
- "manage.py"
1149
- "polarrouteserver/settings/*"
@@ -18,15 +56,15 @@ plugins:
1856
- "polarrouteserver/celery.py"
1957
- "polarrouteserver/urls.py"
2058
- "polarrouteserver/wsgi.py"
59+
- "polarrouteserver/_version.py"
2160
- "tests/*"
2261
autoapi_file_patterns:
2362
- "*.py"
2463
autoapi_add_nav_entry: Python Package API Reference
2564
- include-markdown:
2665
rewrite_relative_urls: true
2766
- render_swagger
28-
markdown_extensions:
29-
- attr_list
67+
3068
nav:
3169
- Home: index.md
3270
- vehicle-management.md
@@ -36,4 +74,18 @@ nav:
3674
- configuration.md
3775
- development.md
3876
- changelog.md
39-
- API Reference: api.md
77+
- API Reference: api.md
78+
79+
markdown_extensions:
80+
- toc:
81+
permalink: True
82+
- admonition
83+
- pymdownx.details
84+
- pymdownx.superfences
85+
- attr_list
86+
- pymdownx.emoji:
87+
emoji_index: !!python/name:material.extensions.emoji.twemoji # (1)!
88+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
89+
90+
91+
copyright: Copyright © 2026 British Antarctic Survey

polarrouteserver/route_api/models.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Representations of database objects with the Django object relational model."""
2+
13
import logging
24

35
from celery.result import AsyncResult
@@ -11,6 +13,8 @@
1113

1214

1315
class Mesh(models.Model):
16+
"Mesh"
17+
1418
id = models.BigAutoField(primary_key=True)
1519
meshiphi_version = models.CharField(max_length=60, null=True)
1620
md5 = models.CharField(max_length=64)
@@ -35,6 +39,8 @@ class Meta:
3539

3640

3741
class Vehicle(models.Model):
42+
"Vehicle objects"
43+
3844
# Required properties
3945
vessel_type = models.CharField(
4046
max_length=150, default=None, unique=True, primary_key=True
@@ -59,6 +65,8 @@ class Vehicle(models.Model):
5965

6066

6167
class Route(models.Model):
68+
"Represents a route."
69+
6270
requested = models.DateTimeField(default=timezone.now)
6371
calculated = models.DateTimeField(null=True)
6472
info = models.JSONField(null=True)

pyproject.toml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@ dev = [
5858
prod = [
5959
"gunicorn"
6060
]
61-
docs = [
62-
"mkdocs",
63-
"mkdocs-autoapi",
64-
"mkdocs-include-markdown-plugin",
65-
"mkdocstrings[python]",
66-
"mkdocs-render-swagger-plugin",
67-
]
6861
build = [
6962
"build"
7063
]
@@ -75,6 +68,16 @@ cov-badge = [
7568
"coverage-badge"
7669
]
7770

71+
[dependency-groups]
72+
docs = [
73+
"mkdocs",
74+
"mkdocs-material",
75+
"mkdocs-autoapi",
76+
"mkdocs-include-markdown-plugin",
77+
"mkdocstrings[python]",
78+
"mkdocs-render-swagger-plugin",
79+
]
80+
7881
[project.scripts]
7982
request_route = "request_route.request_route:main"
8083

0 commit comments

Comments
 (0)