From 9334ba70ddb759e1c621b4a32e269d1b794f83aa Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Sun, 14 Jan 2024 17:39:39 +0100 Subject: [PATCH] FIX: add back BESIII logo (#49) --- docs/conf.py | 29 +---------------------------- setup.cfg | 1 - 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7d091a8..a0e8496 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,15 +1,6 @@ -"""Configuration file for the Sphinx documentation builder. - -This file only contains a selection of the most common options. For a full -list see the documentation: -https://www.sphinx-doc.org/en/master/usage/configuration.html -""" - -import contextlib import os from typing import Dict -import requests from docutils import nodes from pybtex.plugin import register_plugin from pybtex.richtext import Tag, Text @@ -33,25 +24,6 @@ copyright = "2020, BESIII" -# -- Fetch logo -------------------------------------------------------------- -def fetch_logo(url: str, output_path: str) -> None: - if os.path.exists(output_path): - return - online_content = requests.get(url, allow_redirects=True) - with open(output_path, "wb") as stream: - stream.write(online_content.content) - - -LOGO_PATH = "_static/logo.jpg" -with contextlib.suppress(requests.exceptions.ConnectionError): - fetch_logo( - url="https://paluma.ruhr-uni-bochum.de/images/besIII/BES3_logo.jpg", - output_path=LOGO_PATH, - ) -if os.path.exists(LOGO_PATH): - html_logo = LOGO_PATH - - # -- General configuration --------------------------------------------------- master_doc = "index.md" source_suffix = { @@ -104,6 +76,7 @@ def fetch_logo(url: str, output_path: str) -> None: graphviz_output_format = "svg" html_copy_source = True # needed for download notebook button html_favicon = "_static/favicon.ico" +html_logo = "https://github.com/redeboer/bossdoc/assets/29308176/71ae5632-3aa9-4756-b4bb-8af397c62951" html_show_copyright = False html_show_sourcelink = False html_show_sphinx = False diff --git a/setup.cfg b/setup.cfg index 1eaf48c..a3c0355 100644 --- a/setup.cfg +++ b/setup.cfg @@ -65,7 +65,6 @@ sty = docutils pre-commit >=1.4.0 pybtex - requests Sphinx dev = %(doc)s