4 ms·
Paraphrased from the article: > Everything in a code block with the js content hint will be executed in the users browser immediately. If you want to show the
by theK 3y ago
Paraphrased from the article:
> Everything in a code block with the js content hint will be executed in the users browser immediately. If you want to show the code you have to hint 'js echo'
Am I the only one thinking that it would have been better for backwards compatibility if it where the other way around? I.e: having an opt-in code hint like 'js exec' that runs code in a user's browser and leaving the widely used 'js' hint alone? The way this currently is set up, you cannot integrate that renderer in an existing app without having to manage where it is allowed to run.
- mbostock 3y agoWe’re planning to allow changing the default options for blocks (either per-page in front matter or across an entire project using the project config); you could then make `js run=false` the default and `js run` to opt-in to live code as you wish. But we chose to make live code the default since that’s our primary use case.
- crabmusket 3y agoThis is great to hear, though your decision does make sense! I'm really keen to play with Framework.
- crabmusket 3y agoYes, it has the same issue as e.g. automatically rendering Mermaid diagrams on GitHub: now you can't just show a block of Mermaid code, without dropping the language annotation.