diff --git a/.github/osia_convert.rb b/.github/osia_convert.rb index 3b4cac50..896ba3a0 100644 --- a/.github/osia_convert.rb +++ b/.github/osia_convert.rb @@ -8,7 +8,6 @@ ARCHIVE = 'ARCHIVE.md' APPSTORE = 'APPSTORE.md' LATEST = 'LATEST.md' -NOT_ENGLISH = '🌐' ARCHIVE_TAG = 'archive' LATEST_NUM = 30 @@ -87,88 +86,87 @@ def output_apps(apps, appstoreonly) desc = a['description'] tags = a['tags'] stars = a['stars'] - lang = a['lang'] - - date_added = a['date_added'] date_updated = a['updated'] screenshots = a['screenshots'] license = a['license'] - t = "[#{name}](#{link})" + lines = [] - if desc.nil? - t << ' ' - else - t << ": #{desc} " if desc.size>0 + line = [] + line.push "[#{name}](#{link})" + + unless desc.nil? + line.push ": #{desc}" if desc.size>0 end + lines.push line + + line = [] + unless homepage.nil? + line.push "`#{homepage}`" + end + + lines.push line + + line = [] unless itunes.nil? - t << "[` App Store`](#{itunes}) " + line.push "[` App Store`](#{itunes})" end if appstoreonly next if itunes.nil? end - o << "- #{t} \n" - o << "
\n\t" - - details = "" - - unless tags.nil? - details << 'swift ' if tags.include? 'swift' - tags.each do |t| - details << "#{t.downcase} " if t.downcase != 'swift' + unless screenshots.nil? || screenshots.empty? + screenshots.each_with_index do |s, i| + line.push " `Screenshot #{i+1}` " end end - details << "#{NOT_ENGLISH} " unless lang.nil? + lines.push line - unless stars.nil? - details << output_stars(stars) - end + line = [] unless date_updated.nil? date = DateTime.parse(date_updated) formatted_date = date.strftime "%Y" - details << " #{formatted_date} " - end - - o << details - - o << "" - - details_list = [] - unless homepage.nil? - details_list.push homepage - end - - unless date_added.nil? - date = DateTime.parse(date_added) - formatted_date = date.strftime "%B %Y" - details_list.push "Added: `#{formatted_date}`" + line.push " `#{formatted_date}` " end unless license.nil? - license_display = license == 'other' ? "`#{license}`" : "[`#{license}`](http://choosealicense.com/licenses/#{license}/)" - details_list.push "License: #{license_display}" + license_display = license == 'other' ? "" : "[`#{license}`](http://choosealicense.com/licenses/#{license}/)" + line.push << " #{license_display} " end - details = "\n\n\t" - details << details_list[0] - details_list[1..-1].each { |x| details << "
#{x}" } - - unless screenshots.nil? || screenshots.empty? - details << "
" - details << "\n\t" - screenshots.each_with_index do |s, i| - details << "Screenshot #{i+1} " + unless tags.nil? + line.push '`swift` ' if tags.include? 'swift' + tags.each do |t| + line.push "`#{t.downcase}` " if t.downcase != 'swift' end end - details << "\n " - details << "
\n\n" - o << details + lines.push line + + line = [] + unless stars.nil? + line.push " ☆`#{stars}` " if stars > 0 + end + + lines.push line + + lines.each_with_index do |item, i| + temp = '' + item.each { |x| temp << "#{x}" } + unless temp.empty? + if i == 0 + o << "\n- #{temp}" + else + o << "\n - #{temp}" + end + end + end + + # o << "\n" end o end @@ -188,23 +186,6 @@ def output_badges(count, twitter) return b end -def output_stars(number) - case number - when 100...200 - '⭐' - when 200...500 - '⭐⭐' - when 500...1000 - '⭐⭐⭐' - when 1000...2000 - '⭐⭐⭐⭐' - when 2000...100000 - '⭐⭐⭐⭐⭐' - else - '' - end -end - def write_archive(j, subtitle) t = j['title'] apps = j['projects'] diff --git a/contents.json b/contents.json index b98f83f5..c3b28dbe 100644 --- a/contents.json +++ b/contents.json @@ -2,7 +2,7 @@ "title": "Open-Source iOS Apps", "subtitle": "A collaborative list of open-source `iOS`, `iPadOS`, `watchOS` and `tvOS` apps, your [contribution](https://github.com/dkhamsing/open-source-ios-apps/blob/master/.github/CONTRIBUTING.md) is welcome (project [website](https://open-source-ios-apps.netlify.app)) :smile:", "description": "", - "header": "```\n 100+ Stars: ⭐\n 200+ Stars: ⭐⭐\n 500+ Stars: ⭐⭐⭐\n1000+ Stars: ⭐⭐⭐⭐\n2000+ Stars: ⭐⭐⭐⭐⭐ \n\n🌐 Project is not in English \n\nClick ► to show more details\n```", + "header": "", "footer": "## Thanks\n\nThis list was inspired by [awesome-ios](https://github.com/vsouza/awesome-ios) and [awesome-swift](https://github.com/matteocrippa/awesome-swift). Thanks to all the [contributors](https://github.com/dkhamsing/open-source-ios-apps/graphs/contributors) 🎉 \n\n## Contact\n\n- [github.com/dkhamsing](https://github.com/dkhamsing)\n- [twitter.com/dkhamsing](https://twitter.com/dkhamsing)\n", "sponsor": "", "categories": [