Skip to content

Commit 7ac4403

Browse files
committed
Replace f-strings for compatibility
1 parent 90ed179 commit 7ac4403

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

jupyter_sphinx/execute.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ def html(self):
275275
if self['hide_code']:
276276
code_class += ' thebelab-hidden'
277277
code = self.astext()
278-
return f'<pre class="{code_class}" data-executable="true" data-language="python">{code}</pre>'
278+
return '<pre class="{}" data-executable="true" data-language="python">{}</pre>'\
279+
.format(code_class, code)
279280

280281

281282
class ThebeOutputNode(docutils.nodes.container):
@@ -302,7 +303,7 @@ def __init__(self, rawsource='', *children, text='Make live', **attributes):
302303
def html(self):
303304
text = self['text']
304305
return ('<button title="Make live" class="thebelab-button" id="thebelab-activate-button" ' +
305-
f'onclick="initThebelab()">{text}</button>')
306+
'onclick="initThebelab()">{}</button>'.format(text))
306307

307308
### Doctree transformations
308309

@@ -685,13 +686,15 @@ def add_thebelab_library(doctree, env):
685686

686687
# Specify the thebelab config inline, a separate file is not supported
687688
doctree.append(docutils.nodes.raw(
688-
text=f'\n<script type="text/x-thebe-config">\n{json.dumps(thebe_config)}\n</script>',
689+
text='\n<script type="text/x-thebe-config">\n{}\n</script>'
690+
.format(json.dumps(thebe_config)),
689691
format='html'
690692
))
691693

692694
# Add thebelab library after the config is specified
693695
doctree.append(docutils.nodes.raw(
694-
text=f'\n<script type="text/javascript" src="{env.config.jupyter_sphinx_thebelab_url}"></script>',
696+
text='\n<script type="text/javascript" src="{}"></script>'
697+
.format(env.config.jupyter_sphinx_thebelab_url),
695698
format='html'
696699
))
697700

0 commit comments

Comments
 (0)