-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Pluto ux process file drop #707
Conversation
Looks great! In Windows the file path is generated with backslashes as directory separators, which gives the following error:
However, I would prefer to use relative paths here so that the notebook stays portable. This could be either a temporary directory or relative to the home directory (as in your implementation).
The line You could also support SQLite files (with extensions sqlite, sqlite3 or db), then adding the table name as 2nd argument to Maybe you can re-use the file extensions defined in TableIO here? |
Thank you so much @lungben ! I've noticed the CSV mime type, and the code handles that as Excel, but the TableIO then handles correctly (kudos for that!) I also agree with the relative paths: Between
what do you think is best? |
I am not sure how the MIME types are set, by the browser? Excel associates itself per default with the csv extension, this gives (at least on my machine) the MIME type "application/vnd.ms-excel" for csv files. For "sqlite" files no MIME type is set at all for me. Thus I think it is safer to rely on the file extensions than on the MIME type (although not perfect). For the storage of the imported files, I think they should be next to the notebook file, i.e. option 1. The folder should be unique per notebook so that multiple notebook.jl files in the same directory are supported, each with its own assets folder. Suggestion: Not sure about @fonsp plans for the package environments (#142 ), but such an assets folder could also be used to store Project.toml and Manifect.toml files. Edit: |
Summary of the status
|
I registered TableIOInterface yesterday evening, it should be available in the Registry in 3 days. Update: the package is registered. |
Looks great! 2 minor points:
|
7c597be
to
cdeb527
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
2 minor points:
- Could you please rebase on master? It would be good to check if this PR works correctly with the most recent Pluto changes, especially with the automatic function wrapping.
- When pulling a file on an empty cell, this cell is shortly marked with a non-empty cell warning before upload of the file is finished.
- I rebased to master - can't say I understand if it works or breaks (Seems to work)
- Silly me! Fixed! Thanks for catching!!
Update: A function-like test seems to break |
Cells which contain Therefore, in principle at least the TableIO templates should still work. |
Good job on putting the javascript in its own file |
Works perfectly for me, thanks!!! |
One thing is missing: if the notebook is renamed / moved using the Pluto functionality, the .assets directory should be moved, too. I am currently adding support of this into TableIOInterface so that the generated code does not need to be modified when the notebook is moved. |
Very good point Benjamin; I'll try to fix this - I think I know how |
Some comments:
What do you think? |
Maybe to make it really fancy: |
-> Added 4 lines that move the assets folder along with the notebook! Benjamin, I'll fix the message-hover issue too. Also, LocalResource it is! Also, files that don't have special code will get copied and we'll add a filename = "path_to_file" string so the user know what to do next. I'll also try the |
9c3f7a7
to
2c286b3
Compare
src/webserver/Dynamic.jl
Outdated
|
||
get_template_code = (filename, directory, iofilecontents) -> begin | ||
path = string(raw"$(dirname(@__FILE__))", "/", directory, "/", filename) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, please use this format so that it still works after moving / renaming the notebook.
joinpath(split(@__FILE__, '#')[1] * ".assets", "my_file.jpg")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: make sure the name change the dir name changes too (maybe that happens already)
This reverts commit 81d81be.
oops sorry |
Is anything still missing here? |
Can you add a |
Also, we now support file-drops to cells with code (adds cell after it)
[Diff since v0.12.18](v0.12.18...v0.12.19) **Closed issues:** - GPU usage and console messages (#685) - Feature Proposal: Exported HTML can be passed to a static site generator (#794) - wait and resume execution on button press (#803) - Latex code not appropriately displayed (#817) - Python doesn't work in Pluto (#818) - add pluto - pluto not found - Julia 1.5.3 macOS (#819) - Cell output not shown correctly if in-line comment ends with semicolon (#820) - _llvm (#821) - Can't move cells (#822) - Conditions on list comprehensions and execution order (#824) - Electron app (#825) - Errors when pressing Ctrl+C to stop Pluto (#827) - Failed to load notebook error (#829) - Popup docs don't work for some symbols (#832) - Running a notebook deleted contents of `.julia/registries` (#834) - Ctrl+C broken with `julia -e "Pluto.run()"` instead of the REPL (#836) - Edit or remove default header and footer in exported static PDF (#837) - Parameters.jl dynamically created macros confuse Pluto (#838) - Feature request: Open URL from terminal (#840) - Notebook gets stuck in forever loading state after restarting my PC while running it (#849) - Syntax highlighting of @. (#854) - File not found when file newly created while session is running (#855) - Weird output from a mix of MathJax, Markdown and PlutoUI (#856) - Misaligned plots when plotting with UnicodePlots.jl using BrailleCanvas (#870) **Merged pull requests:** - Pluto ux process file drop (#707) (@pankgeorg) - Dralbase state managment (#710) (@dralletje) - PLJ-785 CodeMirror Eject to TextArea - Reload from TextArea in Offline HTML export (#805) (@pankgeorg) - Dralbase state managment: Fix front-end tests (#809) (@pankgeorg) - Update README.md (#814) (@fonsp) - Regard `:=` in macros as einsum notation (take 2) (#816) (@mcabbott) - 🧸 Open your own files as samples (#828) (@fonsp) - Handle filters in generators, closes #824 (#839) (@Pangoraw) - Update `== nothing` to `=== nothing` in Parse.jl (#841) (@heetbeet)
#950 |
Excel (and everything TableIO supports)
Summary of the status
test26.jl.Pluto.jl.-.Google.Chrome.2020-12-30.17-40-05_Trim.mp4