News for hackers. Stuff that matters.
Re:Interesting ideas in Observable Framework by theK on Monday March 04, 2024 @12:03AM (#39587205)
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.

Re:Interesting ideas in Observable Framework by mbostock on Monday March 04, 2024 @01:24AM (#39587566)
We’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.
Re:Interesting ideas in Observable Framework by crabmusket on Monday March 04, 2024 @07:41AM (#39589738)
This is great to hear, though your decision does make sense! I'm really keen to play with Framework.
Re:Interesting ideas in Observable Framework by crabmusket on Monday March 04, 2024 @07:40AM (#39589730)
Yes, 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.
Re:Interesting ideas in Observable Framework by mbostock on Monday March 04, 2024 @08:45AM (#39590384)
You can write ```mermaid run=false for that.
Re:Interesting ideas in Observable Framework by simonw on Monday March 04, 2024 @08:25AM (#39590168)
There's a trick you can use there (which works with GFM and with Framework too): wrap a block in four backticks like this:

    Here is a mermaid example:
    ````
    ```mermaid
    Code here
    ```
    ````
    Copy that into a Markdown file to try it