Opened 10 years ago

Closed 9 years ago

#7501 closed enhancement (fixed)

Include CodeMirror in SageNB and use it to edit data files

Reported by: was Owned by: boothby
Priority: major Milestone: sage-4.4.2
Component: notebook Keywords:
Cc: Merged in: sagenb-0.8
Authors: William Stein, Jason Grout, Mitesh Patel Reviewers: Jason Grout, Tim Dumol
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by mpatel)

After an extensive evaluation, we all decided that CodeMirror is the best JavaScript code editor to include in Sage. It's faster and more robust than EditArea. Initially, we will include it only for editing Data --> file, then maybe later adapt it for input cells.

See this screenshot.

Apply both

to SageNB 0.7.4 (cf. #8051) OR get a trial spkg from #8194.

Attachments (2)

sagenb_7501-part1.patch (199.3 KB) - added by was 10 years ago.
sagenb_7501-part2.patch (1.7 KB) - added by was 10 years ago.

Download all attachments as: .zip

Change History (16)

Changed 10 years ago by was

Changed 10 years ago by was

comment:1 Changed 10 years ago by jason

Positive review to William's patch, as a proof-of-concept patch.

In the end, codemirror gets included on every page---that shouldn't be.

comment:2 Changed 10 years ago by jason

  • Authors set to William Stein, Jason Grout
  • Reviewers set to Jason Grout

comment:3 Changed 10 years ago by jason

For the next step: these people apparently worked on an autocompletion function:

http://groups.google.com/group/codemirror/browse_frm/thread/37a078e69b26a213#

comment:4 Changed 9 years ago by mpatel

  • Report Upstream set to N/A

I can rebase this and try to include it in SageNB 0.7.x (cf. #8051) or, perhaps, 0.8.

comment:5 Changed 9 years ago by mpatel

  • Status changed from new to needs_work

comment:6 Changed 9 years ago by mpatel

  • Description modified (diff)
  • Status changed from needs_work to needs_review
  • Summary changed from notebook -- include codemirror in sage to Include CodeMirror in SageNB and use it to edit data files

See the description for links to rebased patches. I've adjusted line numbers' style so they line up with the lines in the editor.

comment:7 follow-up: Changed 9 years ago by mpatel

I should have said that the "rebased" patches are actually new. It seem easier to do this given the extent of changes to SageNB since the original patches were made. Also, the original set

  • Includes codemirror.js on every page.
  • Refers to parsesage.js and sage/css/pythoncolors.css, which seem to be missing. The new patches just use CodeMirror's Python parser and style.
  • Does not align the automatic line numbers with lines of text in the editor.

Part A just adds CodeMirror to the repository. Part B configures it for the data file page.

comment:8 in reply to: ↑ 7 Changed 9 years ago by mpatel

Replying to mpatel:

  • Includes codemirror.js on every page.

Or more pages than necessary, at least.

comment:9 follow-up: Changed 9 years ago by drkirkby

  • Status changed from needs_review to needs_info

Has any of this been tested on Solaris?

comment:10 in reply to: ↑ 9 Changed 9 years ago by mpatel

  • Status changed from needs_info to needs_review

Replying to drkirkby:

Has any of this been tested on Solaris?

I haven't. But if you have a spare moment, please test the patches and let us know!

Note: CodeMirror? runs entirely in the browser.

comment:11 Changed 9 years ago by drkirkby

I would never have enough time to test individuals patches. But William is keen a Solaris port is completed very soon and if things don't get checked, then it hampers that port.

Dave

comment:12 Changed 9 years ago by timdumol

  • Authors changed from William Stein, Jason Grout to William Stein, Jason Grout, Mitesh Patel
  • Reviewers changed from Jason Grout to Jason Grout, Tim Dumol
  • Status changed from needs_review to positive_review

Looks ok to me, and it is extremely unlikely that this can have any negative effect on *any* platform, since, as Mitesh said, it's totally in the browser.

comment:13 Changed 9 years ago by timdumol

  • Merged in set to sagenb-0.8

comment:14 Changed 9 years ago by timdumol

  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.