rosschapman / if-ross-wrote-javascript

I'm building a universal JavaScript app for all of my code dreams
0 stars 1 forks source link

New fields: type, source #28

Open rosschapman opened 6 years ago

rosschapman commented 6 years ago

On "type" field

Could be one of:

- Article
- Book
- Academic Paper 

Define as enum? Should be fixed categories or tags? Probably the former. Would we want more types like:

- Magazine Article
- Web Article
- Hardcover Book
- etc...

No, instead we can define a source for that. But maybe it's something more general like "short form" or "long form." Maybe it's just best to keep it to Book or Article and that's it. It doesn't seem like there's really anything in between.

Source field

Good for articles. Might also be enum:

- Web
- Magazine
- Friend?
- Recommendation?

But doesn't it breakdown if you want to do Medium as source. Should source be url? So maybe Source is object. Again, this matters most for articles.


Source = {
  type: String (online publication, email newsletter, social media ...),
  name: String (Facebook, Medium, JavaScript Weekly),
  locator: String (url), 
}
rosschapman commented 6 years ago

Possible enum library to use or borrow from: http://2ality.com/2016/01/enumify.html.