Open joshka opened 2 months ago
I made a bunch of changes:
The idea behind this is to do similar changes to all the examples, and to make them take this form.
fix: tweaks
Given that there are other Repos with widget examples… how about a ratatui feature for an example base? Other widgets in other repos can also use them as a common base to demonstrate their widgets then.
Given that there are other Repos with widget examples… how about a ratatui feature for an example base? Other widgets in other repos can also use them as a common base to demonstrate their widgets then.
An example is just an app. Adding code to make writing examples easy is adding code to make writing apps easy. There shouldn't be an "example base", there should be functions that make using common parts of ratatui easy. Those changes are more difficult than cleaning up existing code to make it easier for new users to understand.
Given that there are other Repos with widget examples… how about a ratatui feature for an example base? Other widgets in other repos can also use them as a common base to demonstrate their widgets then.
An example is just an app. Adding code to make writing examples easy is adding code to make writing apps easy. There shouldn't be an "example base", there should be functions that make using common parts of ratatui easy. Those changes are more difficult than cleaning up existing code to make it easier for new users to understand.
This creates a common example base. My point is to make this common.rs
reusable for other repos too, not just examples within the ratatui repo. That way they can also be more consistent.
I think it might be better to incorporate that file in each example instead as it makes each example self contained as a single file.
Publishing public code locks you into supporting it and not making changes that would break code that uses it. I'd prefer this code to be copied instead of referenced.