Comments (6)
@jonatanklosko here is the issue: imagine I want to ship some livebook with some data. I can put it all on a zip file and I can tell folks to unpack and run it. How to do so? :)
Do we at least ensure that ENV.file today points to the livebook.md
? Because if it does, I guess we can use Path.join(__DIR__, "file/foo/bar")
?
from livebook.
Changing the directory can lead to unexpected results. Imagine you go to /project
and start Livebook server. Then you create notebook in memory, work on stuff and use File.write/read
(so you naturally work within /project
). Now you save the notebook somewhere else (just to have the notebook persisted). If we switch cwd, then the existing code will start writing/reading into different place and they user may not even notice that.
By default I'd expect cwd to reflect wherever I start the Livebook server, and it's more that Mix and Attached are very specific cases, where cwd is different by their nature.
from livebook.
Do we at least ensure that ENV.file today points to the livebook.md? Because if it does, I guess we can use Path.join(DIR, "file/foo/bar")?
We don't, but this sounds like an option. This way we could also put File.cd!(__DIR__)
at the top to achieve what we want? One detail I'm not sure about is that for cell errors we would report notebook.livemd:n
, whereas it's actually this_specific_cell:n
.
from livebook.
This way we could also put File.cd!(DIR) at the top to achieve what we want?
It would, yeah. So let's go with setting the file name to the livebook path. And if it is memory, we set it to "in-memory.livemd"?
I am not sure if the specific cell matters, because we always show errors close to the cell anyway and all of the cell IDs are private?
from livebook.
I am not sure if the specific cell matters, because we always show errors close to the cell anyway and all of the cell IDs are private?
Yeah, my only point was that we would say notebook.livemd:3
, but the 3
refers to the line in the cell, rather than line 3 in notebook.livemd
.
from livebook.
@jonatanklosko oh, I see. We could set the file to something like "notebook.livemd#cell:3" but it means __ENV__.file
will be wrong but __DIR__
is still right.
from livebook.
Related Issues (20)
- Completion of struct fields doesn't work when code is split over multiple lines. HOT 3
- Livebook Crashes on Mac when navigating to the file
- Intellisense not working for remote execution smart cell HOT 2
- Bug when opening a notebook from URL or from source HOT 2
- Allow drag and drop in a notebook to upload to a particular storage
- Prevent `esc` from exiting cell editor while using vim key bindings HOT 13
- Provide a better experience when opening an empty notebook
- Is it possible to get an Autosave every 1 second option? HOT 5
- Zero trust configuration issues HOT 6
- `nil` autosave location causes option to be missing from HTML on Settings and notebooks are not saved. HOT 4
- Problem with `lb:*` cookies HOT 2
- ImageComponent crashes livebook if passed non-binary `contents` HOT 1
- Race condition on smart cell evaluation HOT 1
- Store app password in stamp encrypted data HOT 4
- Information loss with current variable name binding model (JSON -> Json) HOT 6
- Crash on Windows when trying to save file if a nearby filename contains an emoji HOT 3
- Livebook not working on window 10 HOT 2
- Livebook cannot connect to the default runtime HOT 20
- Deployed apps don't reevaluate cells marked as 'Reevaluates automatically' HOT 6
- Support epmdless runtimes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from livebook.