From 99a0c72d4978f07690daba417492d21ec377e1a4 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Mon, 5 Feb 2024 13:29:47 +0100 Subject: [PATCH] Remove dependence on mkdocs-simple-hooks Since mkdocs v1.4, the hooks are a native feature --- docs/hooks.py | 7 ++++--- mkdocs.yml | 6 +++--- requirements.txt | 1 - 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/hooks.py b/docs/hooks.py index cdb31a52..4a6957d9 100644 --- a/docs/hooks.py +++ b/docs/hooks.py @@ -1,6 +1,7 @@ import os import shutil -def copy_fonts(config, **kwargs): - site_dir = config['site_dir'] - shutil.copytree('docs/static/fonts', os.path.join(site_dir, 'get')) + +def on_post_build(config, **kwargs): + site_dir = config["site_dir"] + shutil.copytree("docs/static/fonts", os.path.join(site_dir, "get")) diff --git a/mkdocs.yml b/mkdocs.yml index bf0482aa..210b3ab7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -67,13 +67,13 @@ markdown_extensions: emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:materialx.emoji.to_svg +hooks: + - docs/hooks.py + plugins: - search - minify: minify_html: true - - mkdocs-simple-hooks: - hooks: - on_post_build: "docs.hooks:copy_fonts" nav: - "Getting started": index.md diff --git a/requirements.txt b/requirements.txt index 17b0fc1a..9c2212a8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ # The documentation uses 'mkdocs', which is written in Python mkdocs-material mkdocs-minify-plugin -mkdocs-simple-hooks