successfully manipularing generate_toc_html
+import pathlib
from typing import Any, Dict, Optional
import sphinx_book_theme
@@ -5,17 +6,14 @@ from docutils.nodes import document
from sphinx.application import Sphinx
from sphinx.util import logging
-SPHINX_LOGGER = logging.getLogger(__name__)
+HERE = pathlib.Path(__file__).parent
def setup(app: Sphinx):
- raise ValueError("Make noise")
-
- results = sphinx_book_theme.setup(app)
-
+ app.add_html_theme("sphinx_pymedphys_theme", str(HERE))
app.connect("html-page-context", add_to_context)
- return results
+ return {"parallel_read_safe": False, "parallel_write_safe": False}
def add_to_context(
@@ -25,14 +23,12 @@ def add_to_context(
context: Dict[str, Any],
doctree: Optional[document], # pylint: disable = unused-argument
):
- SPHINX_LOGGER.error("a test")
-
sbt_generate_toc_html = context["generate_toc_html"]
print(context)
def generate_toc_html():
initial_html = sbt_generate_toc_html()
initial_html += "<h1>FOOBAR</h1>"
- return "<h1>FOOBAR</h1>"
+ return initial_html
context["generate_toc_html"] = generate_toc_html
