Opened 5 years ago
Last modified 5 years ago
#1817 new enhancement
Use ACE or similar JS code editor in csledit.xul and Scaffold
| Reported by: | simon | Owned by: | simon |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | styles | Version: | future |
| Keywords: | helpwanted | Cc: | ajlyon |
Description
Looks very nice, and supports JS and XML syntax highlighting, paren matching, etc.
Change History (5)
comment:1 Changed 5 years ago by fbennett
comment:2 Changed 5 years ago by fbennett
I've taken a closer look at Ace, with a view to building a small and simple IDE plugin to companion with the test-fixture system described at #1818. I've not been able to get the Ace editor to appear in an XUL document, although it clearly imports okay, has a full set of methods on its object, and is able demonstrate its presence by breaking input nodes to which I attach it. It does look very promising, but it doesn't look like I'll be able to draw on it until there is a worked example of how to make it work inside XUL.
comment:3 Changed 5 years ago by fbennett
With some help from the Ace support list, I've gotten it running in a plugin. It works as in the simple example provided in the ReadMe, but the target ID to which the editor attaches should be on an hbox element. If the target node is textbox, it won't work.
comment:4 Changed 5 years ago by ajlyon
- Cc ajlyon added
As of r9468, Scaffold uses ACE. Thanks to Simon for pointing it out, and to Frank for figuring out how to make it work in an XUL context.
Still would be nice to use more of ACE's functionality, but that can be left for another day and another ticket. Leaving the ticket open until we ace csledit.xul or replace it with another IDE.
comment:5 Changed 5 years ago by ajlyon
- Component changed from scaffold to styles
Removing "scaffold" as component, since that part's done. Do we still want to make csledit.xul or something use ACE?
This looks just terrific.
Re the CSL editor project, I've been trying to push the idea of offering users a straightforward code editor (for which this seems perfect), but with two-way clickable connections between the CSL code and text elements in the rendered citation.
If citeproc-js were extended slightly to track node positions and macro-generated elements, preview citations could be rendered with clickable areas that highlight their own origin in the CSL code. That simple feedback would get a lot over users over the conceptual hurdle with CSL, which I think is the best way forward -- if we bring users closer to CSL, rather than the other way around, we vastly expand the manpower base for style maintenance, which is a major bottleneck at the moment.
If anyone wants to pick that idea up, I'd be very happy to help out on the citeproc-js end.