-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: use special comment lines to divide code into notebook-like cells #63
Comments
👍 |
Let me add that displaying the results of each cell inline, right before the next cell division, would be awesome and would make Atom work more like a notebook. I guess that is harder from a technical perspective though. |
I like the idea of cells, good suggestion. But I also don't want my editor to become a notebook so I don't know that I'm on board with holding all results to the bottom of each cell. Given that we don't have a harsh of a visual break between cells (like the notebook does) I think it would be confusing to collect results at cell breaks |
Yeah, I think I'd prefer the results to stay inline, i.e. have the cell-evaluation work like manually evaling all lines in the cell instead of working like the |
Maybe a compromise would be to have cell Eval when evaluating the cell division line, and line eval for all other lines? |
I think that another keybindings for cell eval is fine to distinguish // Spencer
|
Once atom/atom#9930 lands, we could easily implement @cdsousa's suggestion (along with a setting to switch to sequential inline evaluation of all lines in the cell). |
atom/atom#9930 has been merged |
Would this be a good time to revive this? |
I've just noticed that Hydrogen now supports this (just search for "cell" in the page). |
I would dearly love to have this feature. So much so that I'd been looking at what might be necessary to implement it. In Hydrogen, the code to select the current cell is (https://github.com/nteract/hydrogen/blob/d850f50df78e20ff7d5918884155bb67bfa02cde/lib/code-manager.coffee):
The Regex just checks if this is a "cell delimiter line" so I'm sure it would be easy to substitute in a regex for "##" until something else emerges. Then in terms of atom-juno-client, it seems like you'd just need to either update the blocks.coffee code (https://github.com/JunoLab/atom-julia-client/blob/master/lib/misc/blocks.coffee) to add something about the cell... Or maybe write a cells.coffee set of code with a 'get' function. Finally, then you'd need to add something to evaluation.coffee (https://github.com/JunoLab/atom-julia-client/blob/master/lib/runtime/evaluation.coffee) to use the cell instead of the block. I have zero free time, and have never done anything with coffee, etc. but I might be able to defer more important work to do this :) |
I picked up from @dgleich's comment above, and got an initial version of this working. I don't really have time to make this better, and don't think it's quite ready for merging, but the commit is here if someone wants to run with it: JobJob@f2bff9b It just adds one command: Edit: found a little time to also add |
Very basic cell based eval, partially addressing JunoLab#63 Adds two commands: `run-cell` and `run-cell-and-move`. When either command is executed, the code in the current cell is eval'd. Cells are delimited with `#---` Gotcha: doesn't support anything to do with selections, probably won't do what users expect when these commands are run when text is selected.
Partially addresses JunoLab#63 Adds two commands: `run-cell` and `run-cell-and-move`. When either command is executed, the code in the current cell is eval'd. Results are displayed block style, below the cell delimiter. Cells are delimited with `#---` by default, but this also adds an option to set the delimiter in the julia-client settings. Gotcha: doesn't support anything to do with selections, probably won't do what users expect when the commands added are run when text is selected.
Partially addresses JunoLab#63 Adds two commands: `run-cell` and `run-cell-and-move`. When either command is executed, the code in the current cell is eval'd. Results are displayed block style, below the cell delimiter. Cells are delimited with `#---` by default, but this also adds an option to set the delimiter in the julia-client settings. Gotcha: doesn't support anything to do with selections, probably won't do what users expect when the commands added are run when text is selected.
Just wanted to add some kudos here! This is great to have! |
Should this be closed now? |
Sure, makes sense. |
I love working in Jupyter but I miss a full fledged editor too many times.
On the other hand I'm also liking working in Atom+atom-julia-client but then I miss the custom block/cell code division.
I think the approach Matlab editor uses for solving this is a good trade-off.
Do you think it would be feasible to have a special comment line (e.g.,
## this splits cells
or#== this splits cells ==#
) and a key shortcut to evaluate the cursor current cell?The text was updated successfully, but these errors were encountered: