att / rcloud

Collaborative data analysis and visualization
http://rcloud.social
MIT License
430 stars 142 forks source link

mini.js could be more flexible about the page it's hosted in #2650

Closed gordonwoodhull closed 4 years ago

gordonwoodhull commented 5 years ago

Currently it requires ?notebook=hash but it could also take the notebook id from a path in the URL, to allow using mini.js with notebooks that have index.html as an asset.

E.g. we could fall back to:

var notebook = window.location.pathname.replace(/\/notebook.R\/([a-z0-9]+)\/index.html/, '$1'),

Further

  1. the asset might not be index.html
  2. for generality, the ID could be specified via a hidden HTML tag or JS (not sure of the use case though)
gordonwoodhull commented 4 years ago

Need to deal with notebook.R user and path as well. Ended up rewriting this again.