Skip to content

Commit

Permalink
fix: cleanup html_context for sphinx 7.3 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Apr 28, 2024
1 parent 1c24dad commit 4a61561
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/shibuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ def _initialize_builder(app: Sphinx):
app.add_js_file("shibuya.js")
app.add_css_file("print.css", media='print')

if hasattr(app.config, 'html_context'):
edit_source_link = create_edit_source_link(app.config.html_context)
app.config.html_context.update({
"edit_source_link": edit_source_link,
"expandtoc": normalize_globaltoc,
})

if isinstance(app.builder, StandaloneHTMLBuilder):
edit_source_link = create_edit_source_link(app.config.html_context)
app.builder.templates.environment.globals['expandtoc'] = normalize_globaltoc
app.builder.templates.environment.globals['edit_source_link'] = edit_source_link
app.builder.highlighter.formatter = WrapLineFormatter

if isinstance(app.builder, DirectoryHTMLBuilder):
Expand Down

0 comments on commit 4a61561

Please sign in to comment.