sphinx_gallery.interactive_example#
Binder 和 Jupyterlite 工具函式。
與 Binder 和 Jupyterlite 的整合尚處於實驗階段。請注意,此 API 未來可能會變更。
警告
Binder 仍是 Beta 技術,因此點擊 Binder 連結的用戶體驗可能不穩定。
函式#
- sphinx_gallery.interactive_example.check_jupyterlite_conf(jupyterlite_conf, app)[原始碼]#
返回包含預設值的完整 JupyterLite 配置。
- sphinx_gallery.interactive_example.create_jupyterlite_contents(app, exception)[原始碼]#
根據「jupyterlite」配置建立 Jupyterlite 內容。
- sphinx_gallery.interactive_example.gen_binder_rst(fpath, binder_conf, gallery_conf)[原始碼]#
產生 Binder 徽章的 reST + 連結。
- 參數:
fpath (str) – 將產生 Binder 徽章的 .py 檔案路徑。
binder_conf (dict 或 None) –
如果是字典,則必須具有以下鍵
- ’binderhub_url’
正在執行 Binder 服務的 BinderHub 實例的 URL。
- ’org’
將文件推送至的 GitHub 組織。
- ’repo’
將文件推送至的 GitHub 儲存庫。
- ’branch’
文件所在的 Git 分支 (例如,gh-pages)。
- ’dependencies’
與 Binderspec 相符的相依性檔案路徑清單。
gallery_conf (dict) – Sphinx-Gallery 配置字典。
- 返回:
rst – 連結至此檔案的 Binder 徽章的 reStructuredText。
- 返回類型:
- sphinx_gallery.interactive_example.gen_binder_url(fpath, binder_conf, gallery_conf)[原始碼]#
根據 conf.py 中的配置產生 Binder URL。
- sphinx_gallery.interactive_example.gen_jupyterlite_rst(fpath, gallery_conf)[原始碼]#
產生 Binder 徽章的 reST + 連結。