How to make nbviewer display local files?

大城市里の小女人 提交于 2020-01-03 18:34:08

问题


I've got nbviewer installed and working. I see it has a --localfiles option that takes a folder name. It says: "Serving local notebooks in /home/gb/S14/inclass, this can be a security risk"

But I can't figure out the URL format to get it to look for the file there. The code adds a handler for /localfile/(.*) but that doesn't seem to get triggered.

Anyone know how to format name to give to trigger loading a local file?


回答1:


One minute later and it occurs to me that the front page might not support even though the server does. Sure enough, http://localhost:5000/localfile/PythonReference.ipynb?create=1 renders the local notebook.




回答2:


Navigating to http://localhost:5000/localfile will display a directory browser, starting at the path you passed to --localfiles; you can then just click on a .ipynb file.



来源:https://stackoverflow.com/questions/22020129/how-to-make-nbviewer-display-local-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!