Skip to content

Commit

Permalink
Merge pull request #16 from feelpp/patch-1
Browse files Browse the repository at this point in the history
resolves #14: add cell options
  • Loading branch information
prudhomm authored Jan 28, 2024
2 parents e929836 + d6abdfe commit b1827cd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/dynamic-notebook-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,24 @@ module.exports.register = function register(registry) {
}
const exampleBlock = self.createExampleBlock(block, '', attrs, { 'content_model': 'compound' })
exampleBlock.setTitle('Results')

//Hide code option (hide only the cell code)
if (block.isOption('hide_code')) {
exampleBlock.setTitle('')
block.addRole('hide')
}

// //Open option (automatically open the cell results)
// if (block.isOption('open')){
// exampleBlock.addRole('open')
// }

//Hide output option (hide the cell results)
if (block.isOption('hide_output')) {
exampleBlock.setTitle('')
exampleBlock.addRole('hide')
}

const result = response[index]
let cacheResultDir = doc.getAttribute('dynamic-blocks-cache-result')
if (cacheResultDir !== undefined) {
Expand Down

0 comments on commit b1827cd

Please sign in to comment.