jsvine / notebookjs

Render Jupyter/IPython notebooks on the fly, in the browser. (Or on the command line, if you'd like.)
MIT License
278 stars 47 forks source link

Be able to configure marked.js's options for need #17

Closed vitaminac closed 5 years ago

vitaminac commented 5 years ago

I load ipynb from the raw.githubusercontent.com/user/repo/branch/myipynb.ipynb, and the image are located base on url of gitcontent, We need to be able to pass de baseUrl or other options if we need marked.js to correctly render the image and other resources. By default the images are load relative to my website.

jsvine commented 5 years ago

Hi, @vitaminac, and thanks for raising this concern. I think an easier and more robust solution, however, may be for you just to override nb.markdown, replacing the value with your custom markdown converter, e.g.,:

var myMarked = require('marked');

myMarked.setOptions({ baseURL: "https://example.com" });

nb.markdown = myMarked;

Does that work for your use-case?