Skip to content

Commit

Permalink
Fix issue with overriding pygments_style in sphinx 7.3.0+
Browse files Browse the repository at this point in the history
Fixes #3
  • Loading branch information
TDKorn committed May 15, 2024
1 parent 221fe5f commit 2d92545
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sphinx_github_style/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ def setup(app: Sphinx) -> Dict[str, Any]:
linkcode_func = get_linkcode_resolve(linkcode_url)
set_conf_val(app, 'linkcode_resolve', linkcode_func)

if not get_conf_val(app, 'pygments_style'):
set_conf_val(app, 'pygments_style', 'sphinx_github_style.GitHubStyle')

app.add_lexer('python', GitHubLexer)
app.add_css_file('github_style.css')
app.config.pygments_style = 'sphinx_github_style.GitHubStyle'

return {'version': sphinx.__display_version__, 'parallel_read_safe': True}

Expand Down

0 comments on commit 2d92545

Please sign in to comment.