Replies: 9 comments 7 replies
-
I don't know of a codemirror or Ace mode for math.js, could be interesting indeed. Would you be interested in checking out what would be needed to implement such a mode? |
Beta Was this translation helpful? Give feedback.
-
@josdejong Sure. Doing some initial assessment already. I'll share more details once I can scope minimal implementation. |
Beta Was this translation helpful? Give feedback.
-
any news about this? it would be an amazing feature for the software i'm developing |
Beta Was this translation helpful? Give feedback.
-
No news. I've marked the topic with "help wanted", feel free to jump on to it :) |
Beta Was this translation helpful? Give feedback.
-
I've been looking into this as well recently. I've been writing my own lexer and parser for an own proto-editor, just for fun and/or potentially integrating that with our product which has a formula editor that is quite basic. I should have a bit more time in the coming weeks. I could take a look at getting a simple ruleset going for codemirror. I've used codemirror on very basic terms in the past, and given that the MathJS syntax is fairly simple, one line statements etc., it shouldn't overly difficult... (How hard can it be, said the man that jinxed himself) |
Beta Was this translation helpful? Give feedback.
-
Sorry, haven't got much time to check on this. Would love to spend time someday on it. |
Beta Was this translation helpful? Give feedback.
-
Here is an attempt in codemirror 5. https://github.com/dvd101x/CoolPropJavascriptDemo The method to make it work was:
Stuff to be defined
Also here is a better syntax highlighter working on highlight js + codejar |
Beta Was this translation helpful? Give feedback.
-
I think CodeMirror with the JS extension would provide good enough syntax highlighting. That is the approach I'm currently following. But for auto-completion, you'll probably need to define the symbols manually. I have tried to extract the typed function definitions from the mathjs object with no luck. But if you can get the list of available functions it is not hard to implement the autocompletion. |
Beta Was this translation helpful? Give feedback.
-
math notepad is an awesome tool, though I wanted to use text area for taking math.js supported expressions as input and wanted to provide user IntelliSense and colored formatting to help to detect the errors while entering the equations. I think codemirror is a good lib to enable the math.js editor. I understand math.js is not language itself, though for long expressions or equations it can be helpful to get autocomplete and color coding on the formula.
Beta Was this translation helpful? Give feedback.
All reactions