lute-v3 icon indicating copy to clipboard operation
lute-v3 copied to clipboard

Investigating using "plug-ins" for additional parser support

Open jzohrab opened this issue 1 year ago • 2 comments

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

jzohrab avatar Jan 05 '24 16:01 jzohrab

I think the default parser can be taken off and become a plug-in. All parsers are available as plug-ins.

GrimPixel avatar Feb 11 '24 00:02 GrimPixel

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.

jzohrab avatar Feb 11 '24 02:02 jzohrab

Already done and in production! :tada:

jzohrab avatar May 31 '24 20:05 jzohrab