Congratulations, I like the idea, quite useful for learning JS I think ;)
Show HN: A simple JavaScript notebook in one file
21–30 of 35 posts
Re: Show HN: A simple JavaScript notebook in one file
#22Unfortunately I've yet to grasp what a "notebook" is. ("Jupyter"??) I did try googling and reading about it.
HN enlighten us!
Re: Show HN: A simple JavaScript notebook in one file
#23If you're looking for next steps: You can actually run user code using `import`, which will allow your users to import code from external websites using familiar `import {x} from "https://some-url.com/bla.js"` syntax at the top of cells. Here's how:
const exportsInCell = await import(URL.createObjectURL(new Blob([USER_CODE], { type: "text/javascript" })));
And with some transpilation you can support top-level await in eval [1]. Just some pointers![0]: https://starboard.gg & https://github.com/gzuidhof/starboard-notebook
[1]: https://github.com/gzuidhof/starboard-notebook/blob/master/s...
Re: Show HN: A simple JavaScript notebook in one file
#24Earlier quoted context omitted.
If you download and open up the html file, it contains, what is essentially, a screenshot with explanations. (A very simple screenshot, but one you can extrapolate from.)
But that requires us downloading and opening it. A lot of effort if one just wants to take a quick look. A screenshot or demo would be better.
Re: Show HN: A simple JavaScript notebook in one file
#25Unfortunately I've yet to grasp what a "notebook" is. ("Jupyter"??) I did try googling and reading about it.
So at this point people have come to call this concept in general a "notebook". Basically a development environment with cells where you can add markup and HTML and stuff.
Hope that helped a bit.
Re: Show HN: A simple JavaScript notebook in one file
#26Very cool, I'm building something similar (with a larger scope) [0] (it also has one-file exports, but it does load stuff from a CDN so it's not as contained to a single file as this project is.) If you're looking for next steps: You can actually run user code using `import`, which will allow your users to import code from external websites using familiar `import {x} from " https://some-url.com/bla.js "` syntax at th…
I have experimented with async/await with js+help.html.
The import pointer is very interesting, thank you for that.
My impulse is to try to write a function to import a code from a URI.
Re: Show HN: A simple JavaScript notebook in one file
#27Very cool, I'm building something similar (with a larger scope) [0] (it also has one-file exports, but it does load stuff from a CDN so it's not as contained to a single file as this project is.) If you're looking for next steps: You can actually run user code using `import`, which will allow your users to import code from external websites using familiar `import {x} from " https://some-url.com/bla.js "` syntax at th…
Edit: Suddenly got both!
Re: Show HN: A simple JavaScript notebook in one file
#28Earlier quoted context omitted.
If you download and open up the html file, it contains, what is essentially, a screenshot with explanations. (A very simple screenshot, but one you can extrapolate from.)
You can instead use githack[1] to quickly serve files directly from your repository. [1]: https://raw.githack.com
I wonder what "Files are automatically optimized" means, exactly?
Have tried this out.
(See comment https://news.ycombinator.com/item?id=27452226)
Re: Show HN: A simple JavaScript notebook in one file
#29Re: Show HN: A simple JavaScript notebook in one file
#30This is a very simple Javascript notebook in one completely self-contained HTML file. It was inspired by the concept of Jupyter notebooks. You can enter Javascript code and execute it in the browser, completely locally and possibly offline. The performance can be pretty good. You can put in HTML documentation and also use HTML to provide UI for simple tools. All you need is the js+help.html file, which contains basic…
https://rawcdn.githack.com/timcwinkler/javascript-notebook/9...
(There must be some resource limits, but I don't know what they are. Maybe there aren't limits? This is fast.)