Comments (6)
Never mind everyone, I added the feature myself with PR #46.
from pyforest.
Seconding this! I'm sure many of use have the first cell in markdown as the title block. Wondering what type of fix would be needed? Not familiar with JS, but I'm assuming this chunk in src/pyforest/_importable.py
is where it needs to go:
display(
Javascript(
"""
if (window._pyforest_update_imports_cell) {{ window._pyforest_update_imports_cell({!r}); }}
""".format(
"\n".join(statements)
)
)
)
from pyforest.
Happy to hear that you also thought about this :)
I am afraid, that the fix needs to be in JS and not in Python.
Most likely somewhere around here in src/pyforest/static/utils.js
function setup_lab(notebookTracker) {
window._pyforest_update_imports_cell = function (imports_string) {
var cell = notebookTracker.currentWidget.model.cells.get(0).value;
cell.text = get_new_cell_content(imports_string, cell.text);
};
}
function setup_notebook(Jupyter) {
window._pyforest_update_imports_cell = function (imports_string) {
var cell_doc = Jupyter.notebook.get_cell(0).code_mirror.getDoc();
cell_doc.setValue(get_new_cell_content(imports_string, cell_doc.getValue()));
};
}
Because this is the position where pyforest selects the cell to be updated. Currently, it is just the first cell.
from pyforest.
Mmmm. Adding this and using the return value should do it. https://gist.github.com/tnwei/6005afe55cb8898ba87daa36fce23392
from pyforest.
Submitted a pull request, feedback appreciated!
from pyforest.
Just for the protocol: the last state of your PR #29 was that you need to find a way to make your PR work on JupyterLab. Any progress here? Can someone else help?
from pyforest.
Related Issues (20)
- Import modules that are not installed on the machine
- Add TextBlob to NLP HOT 3
- trai_test_split import deprecated HOT 1
- Custom families / local files HOT 2
- Custom families HOT 7
- Help messages HOT 1
- Incompatible with dask in processes scheduler HOT 5
- After using pyforest the console keep output "<IPython.core.display.Javascript object>" HOT 11
- imports not written HOT 12
- Add AWS Data Wrangler support HOT 1
- auto-completion seems not work at all when using modules imported by pyforest in pycharm HOT 1
- Didn't succeed in installing pyforest HOT 3
- Pyforest doesn't show import lines in VSCode HOT 3
- Imports work but are not imputed in the first cell on kaggle notebooks platform HOT 2
- How can I use it in .py file? HOT 2
- adding mailbox package HOT 1
- It missed a commonly-used package "random" HOT 2
- Empty lines in the output when using LazyImport HOT 1
- Seed all imported libraries 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 pyforest.