Skip to content

Commit

Permalink
chore: Merge pull request #124 from attakei/fix/issue-123
Browse files Browse the repository at this point in the history
Initialize of builder classes support create_builder for Sphinx 5.x and later

Refs: #123
Refs: sphinx-doc/sphinx#10702
  • Loading branch information
attakei committed Aug 1, 2022
2 parents 4891c6f + 6a99bcc commit 939e66b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sphinx_revealjs/builders.py
Expand Up @@ -3,10 +3,12 @@
import logging
from typing import Any, Dict, List, Tuple

from sphinx import version_info as sphinx_versoin
from sphinx.application import Sphinx
from sphinx.builders.dirhtml import DirectoryHTMLBuilder
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.config import Config
from sphinx.environment import BuildEnvironment
from sphinx.locale import __

from sphinx_revealjs.directives import raw_json
Expand All @@ -28,8 +30,12 @@ class RevealjsHTMLBuilder(StandaloneHTMLBuilder):
default_translator_class = RevealjsSlideTranslator
search = False

def __init__(self, app): # noqa: D107
super().__init__(app)
def __init__(self, app, env: BuildEnvironment = None): # noqa: D107
# TODO: Remove it if this not need support Sphinx 4.x and older
if sphinx_versoin[0] < 5:
super().__init__(app)
else:
super().__init__(app, env)
self.revealjs_slide = None

def init(self): # noqa
Expand Down

0 comments on commit 939e66b

Please sign in to comment.