[add] config
But I don't know why we need to freeze a config object? It's looked weired forcing use merge to update configuration?
Ref: #66
@chunibyo-wly Thanks!
Just a comment about "why we need to freeze": it is basically because immutability keeps ease of maintenance and reproduction.
Always generating a fresh struct keeps the entire library unchaged, i.e., we can guarantee latexify.function has no side effect and we could get exactly the same result every time we called latexify.function even it is invoked from multiple threads. Immutability is also applied in the entire process of this library, especially tree transformation chains in get_latex: all transformers always return a new AST (with references to possibly old subtrees for efficiency).
We may add some functionality to override the "global" config in the future. This kind of functionality should be explicitly mentioned that "invoking this method causes side effect and not thread safe."
By the way, there are several pull requests that may affect config so there would be some collisions when merging. I guess it is better to merge this pull request first, and request others to merge main after merging this one.
@chunibyo-wly Hi, I like this change, and would like to merge it soon! If you could resolve the comments above, I'd really appreciate it.
sorry, I forgot to check my email
@ZibingZhang ~Yeah, but it could be processed after merging this PR.~ We need to apply the change (because it affects the interface of get_latex.
I applied a monkey patch to remain expand_functions as is to merge this PR. After fixing the linter error I will merge it.
@chunibyo-wly Thanks for your work! I think this is a very important change for this repository.