Skip to content

Commit

Permalink
FIX: add back BESIII logo (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Jan 14, 2024
1 parent f662538 commit 9334ba7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
29 changes: 1 addition & 28 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 = {
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ sty =
docutils
pre-commit >=1.4.0
pybtex
requests
Sphinx
dev =
%(doc)s
Expand Down

0 comments on commit 9334ba7

Please sign in to comment.