Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] DataCollections improvements #1712

Closed
Tracked by #1499
caendesilva opened this issue Jun 5, 2024 · 3 comments
Closed
Tracked by #1499

[2.x] DataCollections improvements #1712

caendesilva opened this issue Jun 5, 2024 · 3 comments

Comments

@caendesilva
Copy link
Member

caendesilva commented Jun 5, 2024

Overview

Changes needed to improve the data collections feature, that we save for v2 as they may be breaking

Support standalone Yaml files

We need to change the parsing so we don't need front matter blocks. (Fixed in #1733)

>warning Note that the Yaml file should start with `---` to be parsed correctly.

Normalize class name

It bugs me that it is DataCollections instead of DataCollection. This works fine when it's a facade, so DataCollections::get() is semantic* (so is DataCollection::get()), however, since these classes are also used as instances containing data, it makes less sense for it to be plural, because now calling DataCollections::markdown() implies (many) DataCollections due to the return. Singularizing this would also match the Illuminate Collection.

Additionally, no Laravel facades are plural, however our Includes is plural (and some others, but Includes is a sibling class to this and should match)

*DataCollections::get() is not fully semantic as it may imply it will return multiple collections.

@caendesilva caendesilva changed the title Change add prefix to data collections directory to match includes [2.x] DataCollections improvements Jun 5, 2024
@caendesilva
Copy link
Member Author

caendesilva commented Jun 8, 2024

We may also want to consider excluding README.md files from Markdown collections

Edit: No, this is too specific. Better for user to chain ->reject or use conditional continues

@caendesilva
Copy link
Member Author

caendesilva commented Jun 23, 2024

Should we add a warning if a data collection file is empty?

Edit: This now causes an exception

@caendesilva
Copy link
Member Author

Fixed in #1732

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant