orppst / pst-gui

web based front end for the tool
Mozilla Public License 2.0
0 stars 0 forks source link

Syntax highlighting and preview for Justifications #112

Closed DJWalker42 closed 1 month ago

DJWalker42 commented 3 months ago

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.

AllanEngland commented 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.

AllanEngland commented 1 month ago

React Ace would allow us to syntax highlight the edit box, but by default doesn't support the formats we're using.

AllanEngland commented 1 month ago

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.

AllanEngland commented 1 month ago

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.