Closed DJWalker42 closed 1 month ago
React Syntax Highlighter could be a suitable react component for this. Using Prism it supports asciidoc, latex & markdown. Unfortunately reStructuredText is a bit more elusive.
React Ace would allow us to syntax highlight the edit box, but by default doesn't support the formats we're using.
I've put together a little demo on the associated branch that shows a syntax highlighted preview for ascii (react-syntax-highlighter) and a rendered preview for Latex (react-latex)
Now looking at React Simple Code Editor for the possibility of highlighting in the editor window.
Swapped react-latex to the newer react-latex-next, however both only render previews of latex strings not whole documents. But it seems to work well for equations.
The data model has just three format types defined, if this is expanded to include something like markdown, it should be quite easy to add a preview for it using something such as react-markdown.
Still looking into react simple code editor.
For a better user experience we should provide some syntax highlighting for the text format of choice (LATEX, RST, ASCIIDOC, ...) for Justifications.
Also, it would be nice to have a preview tab to see the text rendered in the format of choice c.f. markdown.