Skip to content

Commit

Permalink
feat: add log and raise an error if the theme is not "material"
Browse files Browse the repository at this point in the history
  • Loading branch information
aladjadj committed May 21, 2022
1 parent 758ee8b commit 1234dab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@
"""

import tempfile
import logging
import os
from mkdocs.plugins import BasePlugin
from mkdocs.theme import Theme
from mkdocs.utils import warning_filter
from mkdocs.contrib.search import SearchPlugin
from mkdocs_monorepo_plugin.plugin import MonorepoPlugin
from pymdownx.emoji import to_svg

log = logging.getLogger(__name__)
log.addFilter(warning_filter)


class TechDocsCore(BasePlugin):
def __init__(self):
Expand All @@ -47,6 +52,9 @@ def on_config(self, config):
theme_override = {}
if "theme" in config:
theme_override = config["theme"]
if config["theme"].name != "material":
log.critical("[mkdocs-techdocs-core] The theme must be 'material'")
raise SystemExit(1)

config["theme"] = Theme(
name="material",
Expand Down

0 comments on commit 1234dab

Please sign in to comment.