@@ -275,7 +275,8 @@ def html(self):
275
275
if self ['hide_code' ]:
276
276
code_class += ' thebelab-hidden'
277
277
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 )
279
280
280
281
281
282
class ThebeOutputNode (docutils .nodes .container ):
@@ -302,7 +303,7 @@ def __init__(self, rawsource='', *children, text='Make live', **attributes):
302
303
def html (self ):
303
304
text = self ['text' ]
304
305
return ('<button title="Make live" class="thebelab-button" id="thebelab-activate-button" ' +
305
- f 'onclick="initThebelab()">{ text } </button>' )
306
+ 'onclick="initThebelab()">{}</button>' . format ( text ) )
306
307
307
308
### Doctree transformations
308
309
@@ -685,13 +686,15 @@ def add_thebelab_library(doctree, env):
685
686
686
687
# Specify the thebelab config inline, a separate file is not supported
687
688
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 )),
689
691
format = 'html'
690
692
))
691
693
692
694
# Add thebelab library after the config is specified
693
695
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 ),
695
698
format = 'html'
696
699
))
697
700
0 commit comments