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

Add data in JSON format #30

Open
SidOfc opened this issue Sep 15, 2019 · 3 comments
Open

Add data in JSON format #30

SidOfc opened this issue Sep 15, 2019 · 3 comments
Labels

Comments

@SidOfc
Copy link

@SidOfc SidOfc commented Sep 15, 2019

Hello!

Before I start with this issue I'd like to commend all the contributors to this project for their efforts so far, great job!

I am the author of the cani gem which pulls JSON data from the caniuse repo for viewing in the terminal with curses and fzf. When I saw this project I was instantly fired up to add support for checking email client feature support as well.

When I checked out the repo I noticed a significant difference in the way data is handled, it seems everything is more or less there w.r.t. caniuse's data format, but the data is stored in markdown format. While easy to read and write it does not allow library authors to extend / build upon the awesome data set that you all are creating very easily.

This left me wondering whether there are any plans for this repo to also support a JSON data format, or whether there would be an interest in converting it to JSON otherwise.

I would love to have a JSON data source, so much in fact that I would even dig in caniuse's format (been a while since I checked it out though) and make an attempt to recreate such a JSON file specifically for this repo based on the existing markdown data.

Would love to hear your opinions on this, I personally think JSON is far superior to markdown for storing the data and JSON can still be used to generate the required markdown files as well by using some kind of build script I think.

Thank you very much for all your efforts in bringing light into the darkness that is email support!

@hteumeuleu

This comment has been minimized.

Copy link
Owner

@hteumeuleu hteumeuleu commented Sep 16, 2019

Hi there! Thanks for the suggestion. We currently plan to implement an API at some point, so all data will be available as JSON. (It's not so much a problem of converting the data but more making sure that we can get a reliable host to receive the API calls.)

For now, as you noticed, the data is implemented through YAML in the front-matter format for Jekyll/GitHub pages. This choice was made deliberately to have the least possible steps between the data and its visual representation.

But a subset of the data is actually used in JSON through the site search engine (https://www.caniemail.com/assets/js/features.json). The file is generated here. You could probably generate a similar file with all the data using a Jekyll filter like {{ site.features | jsonify }}.

@hteumeuleu

This comment has been minimized.

Copy link
Owner

@hteumeuleu hteumeuleu commented Sep 16, 2019

I'm just realizing that I'm an idiot and that the data folder of Jekyll can perfectly work with JSON files. So I might move the files structure there at some point.

@SidOfc

This comment has been minimized.

Copy link
Author

@SidOfc SidOfc commented Sep 16, 2019

This sounds like music to my ears :)

Don't be too harsh on yourself there, you've done a great job setting it all up and creating proper documentation for adding features! This is a feature in itself that not many seem to be able to reproduce, and like you said, transforming format A to format B is simple enough so no biggie there (aside from having to rewire some parts and logic to use JSON instead perhaps).

I can't stress enough how thankful I am for having a "caniuse" like interface for email clients, it allows developers to take email matters in their own hands more easily and more reliably. All I want to do is spread this knowledge to cani so that more developers can use it in "yet another" way they prefer (the terminal).

I'd be happy to donate you a crate of beer / some coffees or teas, and I'm not kidding about that, just hand me your bank account number or a donate button :)

Seeing as you already had plans to do this at some point, and even more so now, you can do with this issue what you want. Close it, keep it open until you've implemented it, all my questions have been answered 👍 🎉

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.