44 :width: 100%
55 :height: 500px
66
7- .. shinyeditor ::
7+ .. shinylive-editor ::
88 :width: 100%
99 :height: 500px
1010
@@ -67,14 +67,14 @@ def html(self):
6767 style = css (height = self ["height" ], width = self ["width" ])
6868 type = self ["type" ]
6969 code = self ["code" ]
70- if type == "shinyeditor " :
70+ if type == "shinylive-editor " :
7171 # TODO: allow the layout to be specified (right now I don't think we need
7272 # horizontal layout, but maybe someday we will)
73- code = "#| layout: vertical\n " + code
74- # the class for the editor currently is, somewhat confusingly, pyshiny
75- type = "shiny"
73+ code = "#| standalone: true\n #| layout: vertical\n " + code
7674
77- return f'<pre class="py{ type } " style="{ style } "><code>{ code } </code></pre>'
75+ return (
76+ f'<pre class="shinylive-python" style="{ style } "><code>{ code } </code></pre>'
77+ )
7878
7979
8080def _run (self : SphinxDirective , type : str ):
@@ -99,9 +99,9 @@ def run(self):
9999 return _run (self , "shinyapp" )
100100
101101
102- class ShinyEditorDirective (BaseDirective ):
102+ class ShinyliveEditorDirective (BaseDirective ):
103103 def run (self ):
104- return _run (self , "shinyeditor " )
104+ return _run (self , "shinylive-editor " )
105105
106106
107107class CellDirective (BaseDirective ):
@@ -151,7 +151,7 @@ def skip(self: Sphinx, node: Element):
151151 man = (skip , None ),
152152 )
153153 app .add_directive ("shinyapp" , ShinyAppDirective )
154- app .add_directive ("shinyeditor " , ShinyEditorDirective )
154+ app .add_directive ("shinylive-editor " , ShinyliveEditorDirective )
155155 app .add_directive ("cell" , CellDirective )
156156 app .add_directive ("terminal" , TerminalDirective )
157157
0 commit comments