Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Editor 如何设计Belab的输入框(使用codemirror)?_Editor_Codemirror - Fatal编程技术网

Editor 如何设计Belab的输入框(使用codemirror)?

Editor 如何设计Belab的输入框(使用codemirror)?,editor,codemirror,Editor,Codemirror,我正在尝试将与我的web应用程序集成。现在到目前为止,使用他们的示例代码,我能够成功地集成。Belab使用代码镜像编辑器作为其输入字段。根据,我们甚至可以使用Codemirror本身提供的配置设置定制Codemirror编辑器 现在,当我试图使用ThebeLab提供的自定义代码镜像编辑器时,它不起作用。它甚至不会在控制台中抛出任何类型的错误。即使如此,ThebeLab在其官方网页上提供的例子本身也不起作用 现在,这个问题已经在他们的官方网站上提出并关闭了。根据他们的说法,该解决方案已经提供了更

我正在尝试将与我的web应用程序集成。现在到目前为止,使用他们的示例代码,我能够成功地集成。Belab使用代码镜像编辑器作为其输入字段。根据,我们甚至可以使用Codemirror本身提供的配置设置定制Codemirror编辑器

现在,当我试图使用ThebeLab提供的自定义代码镜像编辑器时,它不起作用。它甚至不会在控制台中抛出任何类型的错误。即使如此,ThebeLab在其官方网页上提供的例子本身也不起作用

现在,这个问题已经在他们的官方网站上提出并关闭了。根据他们的说法,该解决方案已经提供了更新版本(0.5.1)的Belab javascript。我也在使用更新的版本,即0.5.1,但它仍然不起作用

这是我的代码:

<html>
    <head>
        <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
        <title>Thebe Lab examples</title>

        <!-- Configure and load Thebe !-->
        <script type="text/x-thebe-config">
        {
            bootstrap: true,
            requestKernel: true,
            kernelOptions: {
                name: "python3",
                serverSettings: {
                    "baseUrl": "http://127.0.0.1:8888",
                    "token": "test-secret"
                }
            },
            codeMirrorConfig: {
                theme: "abcdef"
            },
        }
        </script>

        <script type="text/javascript" src="https://unpkg.com/thebelab@latest" ></script>
    </head>
    <body>
        <h1>Thebe Lab: using a local server</h1>

        <p>This page illustrates how to setup Thebe Lab, using a local Jupyter server as kernel provider. This assumes that you have started the local server as:
            <pre>
                jupyter notebook --NotebookApp.token=test-secret --NotebookApp.allow_origin='<span id="origin">*</span>'
            </pre>
        and that it's running on port 8888
        </p>

        <pre data-executable="true" data-language="python">print("Hello!")</pre>

        <script type="text/javascript">
            document.getElementById('origin').innerHTML = location.origin;
        </script>
    </body>
</html>

这是实验室的例子
{
引导:是的,
是的,
内核选项:{
名称:“蟒蛇3号”,
服务器设置:{
“baseUrl”:http://127.0.0.1:8888",
“令牌”:“测试机密”
}
},
代码镜像配置:{
主题:“abcdef”
},
}
Thebe实验室:使用本地服务器
本页说明如何使用本地Jupyter服务器作为内核提供程序来设置BE实验室。这假定您已以以下方式启动本地服务器:
jupyter笔记本--NotebookApp.token=测试机密--NotebookApp.allow_origin='*'
它在8888端口上运行

打印(“你好!”) document.getElementById('origin').innerHTML=location.origin;

请尽快帮我离开这里。谢谢。

我对此也有意见。今天我又开了一张票来解决这个问题,因为我也有同样的经历。我的解决方案是使用CSS和jQuery覆盖样式,这并不理想,但很有效。@Joe谢谢你让我知道。