Coder Social home page Coder Social logo

asg017 / atom-observable Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 1.0 7.25 MB

Render Observable notebooks in Atom!

Home Page: https://atom.io/packages/atom-observable

License: MIT License

JavaScript 99.69% CSS 0.07% HTML 0.23%
atom atom-package javascript observable-notebook observablehq

atom-observable's People

Contributors

asg017 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

erickwang

atom-observable's Issues

Import local notebooks

Right now, this just uses the defaultResolver of the unofficial compiler, meaning it imports from observablehq.com notebook directly.

But, it would be cool to support local notebooks that are in your file system. For example, you could have:

$ ls
main.notebook.js other.notebook.js

Then, in main.notebook.js:

import {test} from "./other.notebook.js"

test should now have the test variable from the local other.notebook.js.

This would involve creating a new resolve function and passing it into the Compile constructor. The defaultResolver is a good example to work off of.

Maybe it should be a setting too - since maybe this is a security concern?

Better shortcut? (is Mac supported?)

I just defaulted to Ctrl+Alt+O (since ao == atom observable), but I'm sure something else may make more sense. Does it work with Cmd on macs? I haven't tested that yet

Make syntax highlighter for Observable syntax

Adding syntax highlighting for Observable syntax would be really helpful - for the extra keywords (viewof, mutable), cell/block syntax, etc

I'm not too familiar with how this works, though :/

Add new builtin variables

Since this is running on atom, we could set up a background server that can provide data/API's to the observable runtime to enhance these notebooks.

For example, imagine a env builtin variable that looks up environmental variables, like:

token = env`API_TOKEN`

data = fetch(`https://some.server.com/data?token=${token}`)

Or maybe, a way to directly access files from the filesystem - like:

data = d3.csvParse(await fs(`/home/user/projects/weather/data.csv`))

Or maybe, re-write require to require js modules from the local filesystem (like a node_modules directory)

I'd love to hear suggestions for what are some other cool default variables that could exist!

Fix styling of rendered notebook

I haven't investigated this much, but there seems to be some default styling from Atom that also affects the injected iframe. For example, the markdown just looks a little off - wrong font, sizing, max-width compared to observablehq.com. We do have inspector css in the iframe, but maybe there's more CSS we have to add, or some atom-specific styling we have to turn on/off?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.