Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize of builder classes support create_builder for Sphinx 5.x and later #124

Merged
merged 1 commit into from Aug 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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