georgjaehnig / webpages-to-ebook

Create an EPUB from a list of URLs. Standing on the shoulders of Wget, Readability and Pandoc.
MIT License
193 stars 16 forks source link

JSON besides YAML #13

Closed vinipsmaker closed 3 years ago

vinipsmaker commented 4 years ago

Can we have support for JSON config too? I read both formats map to the same data model, and it's a JS project after all, so maybe it's not that complex to add this feature?

georgjaehnig commented 4 years ago

Would be possible – just curious: why you would need it?

vinipsmaker commented 4 years ago

just curious: why you would need it?

I can't understand YAML. Tried many times already.

georgjaehnig commented 4 years ago

You mean, you don't know how to edit it?

vinipsmaker commented 4 years ago

I don't know how to write YAML. I always copy'n'paste an example and change stuff to suit my needs.

Every time I try to really study the format, it looks easy on the first rules, but the rules escalate pretty quickly and the understanding on my head gets all messed up. JSON has a pretty small and understandable set of rules that you can hold in your head all at once. That doesn't happen with YAML.

georgjaehnig commented 4 years ago

Well, the data structure in the definitions is very simply, it's not going deep at all. I know that YAML has some weird rules e.g. for multi-line strings but there are none of these in the definition files.

Have a look at https://github.com/georgjaehnig/webpages-to-ebook/blob/master/definitions/paulgraham.yml

sukiletxe commented 4 years ago

Also, if I remember correctly, json is also valid yaml (except probably comments).

georgjaehnig commented 3 years ago

Yup, seems so:

making YAML 1.2 a superset of JSON.

So you simply write JSON into the YAML files.

I'm closing this.