latexcgi
latexcgi copied to clipboard
Make use of the recent support of `bibtex`'s syntax highlighting by Ace
It would be nice for latexcgi
to rely on the last release of Ace
which, starting from 1.12.0
, supports syntax highlighting for bibtex
(see https://github.com/ajaxorg/ace/issues/4837) : compare the first example on https://www.learnlatex.org/en/lesson-12 and the same content on https://ace.c9.io/build/kitchen-sink.html with “Bibtex” as selected Mode on the left panel.
hmm I should probably update ace (assuming I can imply drop that in) although I had been planning to switch or at least offer a option of switching to codemirror see issue #2 although perhaps? an updated ace is better at handling scripts that make use of combining characters.
actually I think there is nothing to do in the runlatex
script itself, the calling html is resposible for loding ce so typically
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.12/ace.min.js"></script>
I could (after some tests) update that URL in the examples here and separately in the template at learnlatex, but it's an issue for each calling page not an update I can make centrally.
https://cdnjs.cloudflare.com/ajax/libs/ace/1.12.3/ace.min.js
seems to be the latest
hmm I should probably update ace (assuming I can imply drop that in) although I had been planning to switch or at least offer a option of switching to codemirror see issue #2 although perhaps? an updated ace is better at handling scripts that make use of combining characters.
Does CodeMirror
support bibtex
language? BTW, I don't see anything related to LaTeX
for CodeMirror
6.
@davidcarlisle I don't know, at the time of issue 2 I got codemirror 5 integrated but cm 6 was in beta, I failed to integrate that so left it until it was released with more complete doc, I will look again.
Note though, lack of bibtex support means sub-optimal colouring whereas lack of support for combining characters makes the system unusable, so given choice of one or the other...
I can't read the examples in issue 2, but can still test editing in ace, which is unusably painful. If you put the cursor at the end of a character string and hit delete, some other random character half a line away is deleted, as (I think) the visual display is via the browser's unicode aware layout but the internal editor cursor position handling is maintained by the editor and does not take account of the combinations that occur when laying out Unicode text.
so my aim here is to make sure the core runlatex script will work with either editor and leave it to the calling page which to use. An updated ace should work with no change, using cm5 required some small changes, using cm6 not done yet
I'm a bit lost with this issue. AFAICS, still no BibTeX syntax highlighting for the first example at https://www.learnlatex.org/en/lesson-12.
@dbitouze I guess I'll try updating ace on a fork of learnlatex and see what breaks, might be the weekend. Note latexcgi as such doesn't really depend on the editor at all, it's more an issue for learnlatex