When using untracked Text-based Notebooks and/or an untracked Jupyter Notebooks in combinatio with git_untracked_show_sourcelink == False, the build fails with an error:
Extension error (sphinx_book_theme.header_buttons.launch):
Handler <function add_launch_buttons at 0x0000022D88AD22A0> for event 'html-page-context' threw an exception (exception: 'sourcename')
Traceback (most recent call last):
File "C:\Users\douden\AppData\Roaming\Python\Python312\site-packages\sphinx\events.py", line 98, in emit
results.append(listener.handler(self.app, *args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\douden\AppData\Roaming\Python\Python312\site-packages\sphinx_book_theme\header_buttons\launch.py", line 62, in add_launch_buttons
context["sourcename"].endswith(".md")
~~~~~~~^^^^^^^^^^^^^^
KeyError: 'sourcename'
The cause is line 262 in sphinx_last_updated_by_git.py:
del context['sourcename']
Deleting this line will have as effect:
- The above error will disappear.
- Source files will still be included in the html-ouput, but the links to the source will be removed.
When using untracked Text-based Notebooks and/or an untracked Jupyter Notebooks in combinatio with
git_untracked_show_sourcelink == False, the build fails with an error:The cause is line 262 in sphinx_last_updated_by_git.py:
Deleting this line will have as effect: