lute-v3
lute-v3 copied to clipboard
Investigating using "plug-ins" for additional parser support
fanyingfx has created a fork for a different parser (chinese) with extra dependencies. Rather than forking, I feel extra parsers could be implemented with a "plug-in" approach -- but I have no idea of what's involved.
https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/ has notes on this approach, which sounds rather applicable.
To investigate:
- how plugins would be found, and how parsers would be "registered" -- either they register themselves, or the main program finds them and pulls them in
- change the current parser registry to do run time "registration" and "deregistration" of supported and not-supported parsers
- proof-of-concept parser registration with a sample
I think the default parser can be taken off and become a plug-in. All parsers are available as plug-ins.
Defaults would stay in the core release to simplify start up for new people -- but that's still a long way off. This plug in stuff could be very tough.
Already done and in production! :tada: