[Script] Make the title clickable (#729)

Add badges to Archive
This commit is contained in:
Victor Peschenkov 2019-04-19 05:52:08 +03:00 committed by dkhamsing
parent e40a70011e
commit d86f80794c

View File

@ -68,7 +68,7 @@ def output_apps(apps, appstoreonly)
screenshots = a['screenshots']
license = a['license']
t = "#{name}"
t = "[#{name}](#{link})"
if desc.nil?
t << ' '
@ -85,7 +85,7 @@ def output_apps(apps, appstoreonly)
end
o << "- #{t} \n"
o << " <details><summary>"
o << " <details>\n\t<summary>"
details = ""
@ -106,9 +106,6 @@ def output_apps(apps, appstoreonly)
o << "</summary>"
details_list = []
details_list.push link
unless homepage.nil?
details_list.push homepage
end
@ -124,19 +121,19 @@ def output_apps(apps, appstoreonly)
details_list.push "License: #{license_display}"
end
details = "\n\n "
details = "\n\n\t"
details << details_list[0]
details_list[1..-1].each { |x| details << "<br> #{x}" }
unless screenshots.nil? || screenshots.empty?
details << "<br>"
details << "\n"
details << "\n\t"
screenshots.each_with_index do |s, i|
details << "<a href='#{screenshots[i]}'><code>Screenshot #{i+1}</code></a> "
end
end
details << "<br>"
details << "\n "
details << "</details>\n\n"
o << details
end
@ -149,7 +146,6 @@ def output_badges(count)
date_display = date_display.gsub ' ', '%20'
b = "![](https://img.shields.io/badge/Projects-#{count}-green.svg) [![](https://img.shields.io/badge/Twitter-@opensourceios-blue.svg)](https://twitter.com/opensourceios) ![](https://img.shields.io/badge/Updated-#{date_display}-lightgrey.svg)"
b
end
def output_stars(number)
@ -248,11 +244,13 @@ def write_archive(j)
output = "\# #{t} Archive\n\n"
output << desc
output << output_badges(archived.count)
output << "\n"
archived.each do |a|
t = a['title']
s = a['source']
output << "- #{t} #{s}\n"
output << "- [#{t}](#{s})\n"
end
output << "\n"