Comments (4)
Hi IntranetFactory,
It mimics the Jupyter notebook behavior right now. So it's intentional, it has the same behavior for the shortcuts too:
this.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
if (event.ctrlKey) {
this.runtime.controls.emit({ id: this.cell.id, type: "RUN_CELL", focusNextCell: false, insertNewCell: false });
} else if (event.shiftKey) {
this.runtime.controls.emit({ id: this.cell.id, type: "RUN_CELL", focusNextCell: true, insertNewCell: false });
} else if (event.altKey) {
this.runtime.controls.emit({ id: this.cell.id, type: "RUN_CELL", focusNextCell: true, insertNewCell: true });
}
}
});
It kind of makes sense for their usecase as it originates from a REPL (ipython), but I'm not sure it's something that makes sense for Starboard moving forward. I'm considering changing that behavior.
from starboard-notebook.
So not a bug but a feature. It seemed so broken that I assumed that there must be some wired reason for that behavior.
Do you have any plans to make the editor configurable? For my use case I'd like to disable that "feature", remove some cell types, and replace the # %% with ``` (so persist the notebook as markdown) and I'm wondering if I should fork or if you might consider to add configuration or accept a PR ?
from starboard-notebook.
Yeah I imagine we can change that behavior w.r.t. last cell insertion, or at least allow it to be configured.
I've thought about the format for a long time for notebooks, and persisting cells as completely valid markdown is not really possible. Three issues from the top of my head:
Cells have metadata, as they do in most notebook systems, which can be any arbitrary data. While you can put some tags (see example below), how would you put richer data in there and how would we escape it? Squeezing it as a JSON string or something on a single line defeats any git diff friendliness (as well as becoming a huge pain to edit manually).
```javascript tag1 tag2 tag3
console.log("hello")
```
Secondly there is the issue of code blocks in a markdown cell itself, what happens if I type ` or add it in some markdown content and serialize it: does it become a cell upon loading? What if code in a cell contains that string (it starts a multiline string in some languages!). How about if I type only a single
` tag, and forget the second one in content, will a new cell start?
Thirdly what is the "outer" cell? Is any content not inside a cell considered as markdown? Can we have a markdown cell within a markdown cell? How is HTML treated in markdown?
I am not trying dissuade you, but I think it is simply difficult to map it to normal markdown and back. What I propose would be performing this conversion back and forth (markdown to notebook format) outside of the editor itself in your own project, which would give you complete freedom. Depending on your usecase maybe none of the above will be issues.
It can make sense to "export" a notebook as markdown, but with some information loss.
Curious what you are looking to build!
from starboard-notebook.
I have changed the behavior - it no longer adds a new cell at the end.
from starboard-notebook.
Related Issues (20)
- Markdown hard break breaking the editor
- npm install fails with 0.15.3 HOT 1
- `px.bar` fails in Python HOT 2
- import plotly.js? HOT 1
- "503 first byte timeout" on `pd.read_csv(pyodide.open_url(url))` HOT 3
- captcha broken on account recovery page HOT 3
- Using Pyodide > 0.20 HOT 1
- Token `thread_open` not supported by Markdown parser. HOT 2
- litHtml HOT 2
- Authentication problem on https://starboard.gg HOT 2
- Js exception with pandas - df[‘a’] / df.a HOT 3
- Issue in notebook https://starboard.gg/#python HOT 1
- Markdown editor not working - possible package version mismatches
- Development documentation is not updated HOT 1
- starboard as a publishing platform? HOT 2
- Interactive plots: Access to current cell output (CURRENT_HTML_OUTPUT_ELEMENT) from python possible?
- Request: "Run all"
- Glitch on initial load of HTML cells
- Is there a demo of vue?
- New release with Pyodide 0.25? HOT 2
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 starboard-notebook.