fleather icon indicating copy to clipboard operation
fleather copied to clipboard

Add Custom AutoFormats with Fallback Autoformats

Open cotw-fabier opened this issue 1 year ago • 3 comments

Hi Guys,

One more PR here based on https://github.com/fleather-editor/fleather/issues/369. This introduces a simple factory to the AutoFormat class which allows us to build it with the fallback. To keep things simple I opted to initalize the fallback and then merge that with my new list of AutoFormats. I know this isn't the most efficient but I didn't know if you wanted to leave the fallback() factory alone. Another option would have been to introduce a nullable variable so we could just add them there which would also be pretty ergonomic.

If you prefer that I could roll that in and update the PR here.

I created a new example file with autoformats and also a sample for rendering based on the issue mentioned above. Simple, but should be advanced enough so people can understand the API without too much trouble!

Thanks for the awesome package!

cotw-fabier avatar Jun 25 '24 04:06 cotw-fabier

Hey @cotw-fabier. Are you still interested in moving this forward?

Amir-P avatar Jul 13 '24 18:07 Amir-P

Hey @cotw-fabier. Are you still interested in moving this forward?

Amir,

Sorry this fell down my list a bit but I am still quite interested. I took a second to look at this and it seem to make the change you're asking for I would have to rename the functions being called along with changing their reference. I think this is probably fine, but wanted to confirm?

I'm going to be out of town for a few days but will revisit next week when I return.

cotw-fabier avatar Jul 17 '24 22:07 cotw-fabier

Sorry this fell down my list a bit but I am still quite interested. I took a second to look at this and it seem to make the change you're asking for I would have to rename the functions being called along with changing their reference. I think this is probably fine, but wanted to confirm?

I'm not sure which functions you're talking about. What we discussed was to make the current auto formats public so that users can use a subset of them to instantiate AutoFormats class and also have AutoFormats.fallback to accept a list of additional auto formats. BTW, if it's still unclear to you, I can push the commit and you take care of example.

Amir-P avatar Jul 18 '24 07:07 Amir-P