jupyter/nbviewerQuick Run | GitHub Enterprise | Base URL | Local Development | Contributing | Extensions | Configuration | Security
, and the invoke python module.
shell$ cd <path to repo> $ pip install -r requirements-dev.txt $ npm install $ invoke bower $ invoke less [-d]
This will download the relevant assets into nbviewer/static/components and create the built assets in nbviewer/static/build.
Pass -d or --debug to invoke less to create a CSS sourcemap, useful for debugging.
shell$ cd <path to repo> $ python -m nbviewer --debug --no-cache
This will automatically relaunch the server if a change is detected on a python file, and not cache any results. You can then just do the modifications you like to the source code and/or the templates then refresh the pages.
If you would like to contribute to the project, please read the CONTRIBUTING.md. The CONTRIBUTING.md file
explains how to set up a development installation and how to run the test suite.
Providers are sources of notebooks and directories of notebooks and directories.
nbviewer ships with several providers
urlgistgithublocalThere are already several providers proposed/requested. Some providers are more involved than others, and some, such as those which would require user authentication, will take some work to support properly.
A provider is implemented as a python module, which can expose a few functions:
uri_rewrites
If you just need to rewrite URLs (or URIs) of another site/namespace, implement
uri_rewrites, which will allow the front page to transform an arbitrary string
(usually an URI fragment), escape it correctly, and turn it into a "canonical"
nbviewer URL. See the dropbox provider
for a simple example of rewriting URLs without using a custom API client.
default_handlers
If you need custom logic, such as connecting to an API, implement
default_handlers. See the github provider
for a complex example of providing multiple handlers.
Error Handling
While you could re-implement upstream HTTP error handling, a small
convenience method is provided for intercepting HTTP errors.
On a given URL handler that inherits from BaseHandler, overload the
client_error_message and re-call it with your message (or None). See the
gist provider for an example of customizing the
error message.
Formats are ways to present notebooks to the user.
nbviewer ships with three providers:
htmlslidesscriptIf you'd like to write a new format, open a ticket, or speak up on gitter! We have some work yet to do to support your next big thing in notebook publishing, and we'd love to hear from you.
NBViewer is configurable using a config file, by default called nbviewer_config.py. You can modify the name and location of the config file that NBViewer looks for using the --config-file command line flag. (The location is always a relative path, i.e. relative to where the command python -m nbviewer is run, and never an absolute path.)
If you don't know which attributes of NBViewer you can configure using the config file, run python -m nbviewer --generate-config (or python -m nbviewer --generate-config --config-file="my_custom_name.py") to write a default config file which has all of the configurable options commented out and set to their default values. To change a configurable option to a new value, uncomment the corresponding line and change the default value to the new value.
You can also run python -m nbviewer --help-all to see all of the configurable options. This is a more comprehensive version of python -m nbviewer --help, which gives a list of the most common ones along with flags and aliases you can use to set their values temporarily via the command line.
The config file uses the standard configuration syntax for Jupyter projects. For example, to configure the default port used to be 9000, add the line c.NBViewer.port = 9000 to the config file. If you want to do this just once, you can also run python -m nbviewer --NBViewer.port=9000 at the command line. (NBViewer.port also has the alias port, making it also possible to do, in this specific case, python -m nbviewer --port=9000. However not all configurable options have shorthand aliases like this; you can check using the outputs of python -m nbviewer --help and python -m nbviewer --help-all to see which ones do and which ones don't.)
One thing this allows you to do, for example, is to write your custom implementations of any of the standard page rendering handlers included in NBViewer, e.g. by subclassing the original handlers to include custom logic along with custom output possibilities, and then have these custom handlers always loaded by default, by modifying the corresponding lines in the config file. This is effectively another way to extend NBViewer.
You can run the viewer as a JupyterHub 0.7+ service. Running the viewer as a service prevents users who have not authenticated with the Hub from accessing the nbviewer instance. This setup can be useful for protecting access to local notebooks rendered with the --localfiles option.
Add an entry like the following to your jupyterhub_config.py to have it start nbviewer as a managed service:
pythonc.JupyterHub.services = [ { # the /services/<name> path for accessing the notebook viewer 'name': 'nbviewer', # the interface and port nbviewer will use 'url': '[***] # the path to nbviewer repo 'cwd': '<path to repo>', # command to start the nbviewer 'command': ['python', '-m', 'nbviewer'] } ]
The nbviewer instance will automatically read the various JUPYTERHUB_* environment variables and configure itself accordingly. You can also run the nbviewer instance as an externally managed JupyterHub service, but must set the requisite environment variables yourself.
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像服务
在 Docker Desktop 配置镜像
Docker Compose 项目配置
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
在宝塔面板一键配置镜像
Synology 群晖 NAS 配置
飞牛 fnOS 系统配置镜像
极空间 NAS 系统配置服务
爱快 iKuai 路由系统配置
绿联 NAS 系统配置镜像
QNAP 威联通 NAS 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
来自真实用户的反馈,见证轩辕镜像的优质服务