cauldron icon indicating copy to clipboard operation
cauldron copied to clipboard

Sharing output without the code

Open larsrinn opened this issue 7 years ago • 2 comments

Is it possible to save a notebook to an html file without including the code? I can think of many cases where you want to show only the results but keep the way how they were obtained private

larsrinn avatar Jun 16 '17 14:06 larsrinn

Yes, this is definitely a feature I've wanted to add for a while and is on the roadmap.

sernst avatar Jun 20 '17 01:06 sernst

So, because I needed this feature quickly, I tried tackling it myself. The approach I used was adding a new display-variable in the cauldron.json file:

{
[...]
  "summary": "[...]",
  "title": "[...]",
  "display": {
    "code": false,
    "errors": false
  }
}

Then I used these information in ProjectStep.dumps to decide whether the code or the error messages should be rendered: https://github.com/lmr2391/cauldron/commit/b4b5ab0428047612d310c35bc0052462aae5afbd

What do you think about that approach? Features that it doesn't support yet, that were nice, are:

  • Being able to decide whether you want to display the code for each step individually
  • Switching between displaying and hiding the code without having to rerun the step

larsrinn avatar Jun 25 '17 16:06 larsrinn