QuantEcon / quantecon-book-theme

A Jupyter Book Theme for QuantEcon Book Style Projects
BSD 3-Clause "New" or "Revised" License
41 stars 21 forks source link

ENH: Enable Compatibility with Jupyter Book == 0.14 + sphinx-book-theme #189

Closed mmcky closed 1 year ago

mmcky commented 1 year ago

We need to update the theme for compatibility with jupyter-book==0.14.0 and sphinx-book-theme

mmcky commented 1 year ago

@AakashGfude this is working nicely for straight html builds but breaks when running:

  1. jupyter notebooks
  2. pdf
  3. html

where the notebooks and the pdf are populated in the _build/html/_pdf and _notebooks folder.

Extension error (quantecon_book_theme):
Handler <function add_to_context at 0x12f8fedc0> for event 'html-page-context' threw an exception (exception: 'pdf_book_name')
Traceback (most recent call last):
  File "/Users/mmcky/anaconda3arm64/envs/quantecon/lib/python3.9/site-packages/sphinx/events.py", line 94, in emit
    results.append(listener.handler(self.app, *args))
  File "/Users/mmcky/anaconda3arm64/envs/quantecon/lib/python3.9/site-packages/quantecon_book_theme/__init__.py", line 188, in add_to_context
    context["pdf_book_path"] = "/_pdf/" + context["pdf_book_name"] + ".pdf"
KeyError: 'pdf_book_name'