This might be a big meta, but I’m looking for a way to have a (versioned) jupyter notebook inside anvil forms (or whatever unit you use for ‘views’; I’m not sure I’m using the concept of ‘form’ right.
For context, I’m trying to build a ‘textbook’ where you can only see one chapter at a time, and the next chapter only unlocks when you have solved the exercises for the previous. Embedding a jupyter notebook would be a cool way to have a ‘rich text component’ (markdown that renders on the spot), which is ideal for writing long form.
A few users would be editors (have read and write access to that content), most users would be readers only, but those would do exercises (hence a form, where you can ‘post’ the exercises once they are done. Then the DB would store their solution.
Welcome to the Anvil Forum!
And thank you for giving a big picture (goals). Context is often the key to many situations.
I’ve no experience with Jupyter. However, there are two other “big meta” ideas that might combine to make this work.
- Hosting the notebook on a web site. I seem to recall more than one service that does this.
- Embedding that site in an Anvil form, via “iframe”. That’s been discussed recently.
This forum’s Search feature is outstanding, so I encourage you to use it to find out more about the topics you’re interested in.
1 Like
Thanks. I found a post about embedding ‘a site’ on an iframe, with a ‘demo’ app in anvil. I pressed the button and the app opened in the editor, but nothing was showing inside the iframe. Not sure this is what was intended. I’m not a frontend person, so it might well be everything was working fine and I did something wrong.
Embedding this way is an option, yes. One problem I can see is that the content would not be versioned with the rest of the app. Which could be a deal breaker for my use case.
Do you just need markdown or functional code cells as well? Markdown components are easy to add into anvil (please search the forum). If you need a full notebook embedded, you may look into DeepNote or CoCalc notebooks. It may be possible to combine those with Anvil’s Uplink to send data between the apps. I’m sure there are other ways to do it too. Good luck!!
1 Like