Skip to content
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

PLJ-785 CodeMirror Eject to TextArea - Reload from TextArea in Offline HTML export #805

Merged
merged 9 commits into from
Jan 23, 2021

Conversation

pankgeorg
Copy link
Collaborator

This PR changes the way the app loads CodeMirror: It creates a textarea in CellInput from which the CodeMirror is created.

On export, we get the code written in the CM into a fresh textarea, in the clone body. When the HTML reloads, the textarea gives its place to a CM instance.

Client JavaScript required.

@pankgeorg pankgeorg marked this pull request as draft December 30, 2020 11:16
@pankgeorg pankgeorg marked this pull request as ready for review December 30, 2020 12:08
@fonsp
Copy link
Owner

fonsp commented Jan 19, 2021

Can you (or @fonsp) run this, and post the resulting .html file as an example?

@pankgeorg
Copy link
Collaborator Author

@fonsp
Copy link
Owner

fonsp commented Jan 19, 2021

Looks great! I can't copy text though -- are these real codemirrors with input disabled, or standalone-mode outputs like highlighted code inside markdown?

@pankgeorg
Copy link
Collaborator Author

Looks great! I can't copy text though -- are these real codemirrors with input disabled, or standalone-mode outputs like highlighted code inside markdown?

real codemirrors with input disabled (and cursor disabled)
I can re-open the cursor to enable focus & copy (but then people will see a cursor which is like telling them - hey you can write - which they can't)

@fonsp
Copy link
Owner

fonsp commented Jan 20, 2021

Ah now I understand. I guess that showing the cursor is the lesser evil? That would look like https://fonsp.com/article-test-3/mycoolnotebook.html

Maybe we can set the blink speed to 99999999 or something hacky like that: https://github.com/codemirror/CodeMirror/search?q=cursorBlinkRate

@pankgeorg
Copy link
Collaborator Author

Ah now I understand. I guess that showing the cursor is the lesser evil? That would look like https://fonsp.com/article-test-3/mycoolnotebook.html

Maybe we can set the blink speed to 99999999 or something hacky like that: https://github.com/codemirror/CodeMirror/search?q=cursorBlinkRate

-1 seems to work perfectly!

@fonsp fonsp merged commit d5b8c77 into fonsp:master Jan 23, 2021
pankgeorg pushed a commit that referenced this pull request Jan 28, 2021
[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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants