在myBinder中安装custom.js文件? [英] install a custom.js file in myBinder?

查看:78
本文介绍了在myBinder中安装custom.js文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个面向公众的页面,我正在引导学生访问myBinder。为了简化学生的工作,我想自动运行所有单元,然后隐藏不需要与之交互的单元。通过在〜/ .jupyter / custom /目录中安装custom.js文件,我可以在本地计算机上使用它。但是,我似乎无法弄清楚如何使custom.js文件与mybinder创建的面向公众的Docker映像一起使用。是否可以设置mybinder以便我可以运行custom.js文件?

I have a public-facing page that I am directing students to on myBinder. To simplify things for the students, I'd like to automatically run all the cells and then hide the cells that they don't need to interact with. I was able to get this to work on my local machine by installing a custom.js file in the ~/.jupyter/custom/ directory. However, I can't seem to figure out how to get the custom.js file working with the public-facing docker image created by mybinder. Is it possible to set up mybinder so that I can run a custom.js file?

推荐答案

postBuild 文件,您将放置以下代码:

In a postBuild file you'd place something like the following code:

#!/bin/bash

# Create a custom directory and move the custom.js there
mkdir -p ~/.jupyter/custom
mv custom.js ~/.jupyter/custom/.

详细了解 postBuild 使用此处在Binder项目中文档。

在此示例中,我实现了此操作,以隐藏Edit app 按钮。 / appmode#client-side-customization rel = nofollow noreferrer> Appmode 。我的 custom.js 是存储库主目录中的文件。

See more about postBuild use here in the Binder project documentation.
In this example, I implemented this to hide the Edit app button for Appmode. My custom.js was a file in the main directory of the repository.

(注意:因为该文件包含要成为可执行文件,您不能简单地通过基于GitHub浏览器的界面来制作/编辑它。据我所知,您需要在本地工作并将可执行文件推送回您的存储库。有一个示例存储库,有用为可执行的postBuild文件的来源。)

(Note: because that file has to be executable you cannot simply make/edit it via the GitHub browser-based interface. As far as I know, you need to work locally and push the executable file back to your repo. There is a sample repo useful as a source of an executable postBuild file.)

这篇关于在myBinder中安装custom.js文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆