-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Shields data format? #776
Comments
#1163 implements a rough version of this. It's not formalized, nor guaranteed to stay the same, though it's a great step in the right direction. |
@idleberg See #1226 and mightyiam/shields-badges-urls#22 about a project related to badge URL generation. In that thread I suggested we kickstart this issue, our publishing a data format. It's going to be a while before we have the kind of comprehensive data I'd like for all the badges, though we could certainly start with what we have. I'm curious your thoughts on the ideal content for that data format, and also the minimum useful content. You might also have some really valuable input for him, as I'm sure you've needed to solve some of the same problems as he's thinking through right now. |
I think that https://github.com/mightyiam/shields-badges-urls aims to provide what you intend to consume, @idleberg, but it is a JavaScript (TypeScript) API, rather than data. The nature of it includes string composition, so it did not occur to me to make it a data format, rather than code. But if simple rules are followed, perhaps the string compositions could be encapsulated in a data format, much like your example. Yet, wouldn't this be overkill? @idleberg would a JavaScript API be consumable in your use case? |
For an ideal experience in #701 we'd need name and possibly documentation and validation rules for each field, and a recipes for assembling the final string, with or without optional parameters like a branch. It would be good if some of that same code were used to define the server's route. It would be nice to have a way of dealing with mightyiam/shields-badge-data#23 that makes it easier to quickly pick through all the badges e.g. for a given github repo. |
Incorporating what I gathered from here, I have opened a PR on shields-badge-data. |
I'll take a look! |
Three main goals: 1. In the front end: a. Show form fields and automatically assemble badge URLs (#701) c. Group together examples for the same service b. Show deprecated services 2. Make it easy to changing the schema of `examples`, thanks to 100% validation. One challenge with frameworks is that when there are typos things fail silently which is pretty unfriendly to developers. The validation should really help with that. (This caught one bug in AUR, though I fixed it in #2405 which landed first.) 3. Produce a service definition export for external tool builders. (#776) 4. Build toward harmony between the front-end data structure and the `examples` key in the service classes. I aliased `staticPreview` to `staticExample` which starts this process. The old format: - Lacked a consistent machine-readable representation of the fields. - Flattened multiple examples for the same service were flattened. - Excluded deprecated services. The new format improves a few things, too: - It cleans up the naming. Since this file evolved over time, the names were a bit muddled (i.e. what was an example vs a preview). - It duplicated information (like `.svg`). (I can imagine dropping the `.svg` from our badge URLs someday, which would make the URLs easier to read and maintain.) - For a human reading the YAML file, providing the static example as a deconstructed object is more readable. Here are a couple snippets: ```yml - category: build name: AppVeyorCi isDeprecated: false route: format: '([^/]+/[^/]+)(?:/(.+))?' queryParams: [] examples: - title: AppVeyor example: {path: /appveyor/ci/gruntjs/grunt, queryParams: {}} preview: {label: build, message: passing, color: brightgreen} keywords: [] - title: AppVeyor branch example: {path: /appveyor/ci/gruntjs/grunt/master, queryParams: {}} preview: {label: build, message: passing, color: brightgreen} keywords: [] - category: downloads name: AmoDownloads isDeprecated: false examples: - title: Mozilla Add-on example: {path: /amo/d/dustman, queryParams: {}} preview: {path: /amo/d/dustman, queryParams: {}} keywords: [amo, firefox] ```
For several years I've been maintaining snippets for a variety of text editors to easily insert badges. The update process has been proven painful, especially due to lack of versioning. I'm surprised I could not find any data-sets of all available badges, since I expected you would use that to generate content, for instance your website.
I would love to see is that you offer all available badges is some data-format, e.g. JSON or YAML. Ideally, these would include name, category and URL.
Example:
I think this data could be used for multiple purposes, including generating content such as your static website, which potentially makes maintenance easier and less error-prone. Let me know what you think, and I can submit a draft for review.
The text was updated successfully, but these errors were encountered: