I don’t know how to do this from inside the laptop, but I found a way to do this using preprocessor and nbconvert.
, nbconvert.preprocessors.ExecutePreprocessor. preprocess ( preprocess_cell) .
- :
class MyExecutePreprocessor(ExecutePreprocessor):
def preprocess_cell(self, cell, resources, index):
cell, resources = super().preprocess_cell(cell, resources, index)
cell.metadata['widgets'] = {'stuff':'that is cool'}
return cell, resources
nbconvert.