diff --git a/.github/osia_convert.rb b/.github/osia_convert.rb index 6f0db5bb..64738d11 100644 --- a/.github/osia_convert.rb +++ b/.github/osia_convert.rb @@ -41,6 +41,10 @@ def output_apps(apps) stars = a['stars'] lang = a['lang'] + date_added = a['date_added'] + screenshots = a['screenshots'] + license = a['license'] + o << "- #{name}" if desc.nil? @@ -49,6 +53,10 @@ def output_apps(apps) o << ": #{desc} " if desc.size>0 end + unless itunes.nil? + o << "[` App Store`](#{itunes}) " + end + unless tags.nil? o << '`Swift` ' if tags.include? 'swift' end @@ -62,9 +70,42 @@ def output_apps(apps) end o << "\n" - o << " - #{link}\n" - o << " - #{homepage}\n" unless homepage.nil? - o << " - #{itunes}\n" unless itunes.nil? + + show_details = !homepage.nil? || !screenshots.nil? || !license.nil? || !date_added.nil? + + if (!show_details) + o << " - #{link}\n" + else + details = "
#{link}\n" + + details_list = [] + unless date_added.nil? + date = DateTime.parse(date_added) + formatted_date = date.strftime "%B %e, %Y" + details_list.push "Added #{formatted_date}" + end + + unless license.nil? + details_list.push "License: `#{license}`" + end + + unless homepage.nil? + details_list.push homepage + end + + details << ' ' + details << details_list[0] + details_list[1..-1].each { |x| details << " - #{x}" } + + unless screenshots.nil? + screenshots.each_with_index do |s, i| + details << " ![#{name} image #{i+1}](#{screenshots[i]})" unless screenshots.nil? + end + end + + details << "\n
\n" + o << details + end end o end diff --git a/.github/schema.json b/.github/schema.json index fb8ca50a..ef6d1910 100644 --- a/.github/schema.json +++ b/.github/schema.json @@ -147,6 +147,11 @@ "title": "Date Added", "description": "Date when project was added.", "type": "string" + }, + "screenshots": { + "title": "Screenshots", + "description": "Links to screenshot images.", + "type": "array" } }, "required": ["title", "category", "source"], diff --git a/contents.json b/contents.json index c1667a15..e4ee3fc3 100644 --- a/contents.json +++ b/contents.json @@ -235,7 +235,8 @@ "swift" ], "date_added": "Fri Nov 6 06:19:26 2015 -0800", - "suggested_by": "@dkhamsing" + "suggested_by": "@dkhamsing", + "screenshots": [ "https://raw.githubusercontent.com/artsy/emergence/master/docs/screenshots/featured.png", "https://raw.githubusercontent.com/artsy/emergence/master/docs/screenshots/show.png"] }, { "title": "EX Player",