xaml-math icon indicating copy to clipboard operation
xaml-math copied to clipboard

Extensible definition dictionary

Open ForNeVeR opened this issue 7 years ago • 5 comments

To avoid polluting our main formula dictionary (i.e. PredefinedTexFormulas.xml) with various localized formula names (like this), I propose to add a dictionary extension mechanism.

Users should be able to provide theirs own dictionary files that will be merged with the existing definitions.

Also, these Russian localized definitions should be extracted from the default dictionary and should became opt-in functionality (I still want to redistribute them alongside WPF-Math because personally I need those, and I think they're generally useful for people around the world).

And don't forget to add end-user documentation explaining how to make and apply these definition files!

ForNeVeR avatar Feb 24 '17 12:02 ForNeVeR

This might be a reason to get rid of the DSL and define the operators using a builder-syntax in-code... haven't thought it through fully though.

alexreg avatar Feb 26 '17 22:02 alexreg

I think that's a separate issue. When planning this, I thought that we could simply split our XML definitions (e.g. PredefinedTexFormulas.xml) to multiple files and load them on demand (for example, pass resource names to TexFormulaParser constructor or something like this).

I'm not sure if we'll ever want to completely replace all our PredefinedTexFormulas with C# code, but some additional flexibility perhaps wouldn't hurt.

ForNeVeR avatar Feb 27 '17 03:02 ForNeVeR

I don't think that's nearly as elegant, if I'm honest... keeping everything in code makes the extensibility aspect really easy.

alexreg avatar Feb 27 '17 03:02 alexreg

Alright, let's think about that a little more.

I'd like to settle things like this before releasing the "stable" version 1.0, that should have a stable and extensible API we won't accidentally break.

ForNeVeR avatar Feb 27 '17 04:02 ForNeVeR

Agreed. I know abandoning the XML definition format may seem like a bit of a waste now, but I think it could be the optimal way forward, especially as far as extensibility is concerned. The DSL could grow to unwieldy proportions otherwise...

alexreg avatar Feb 27 '17 04:02 alexreg