[script] Move screenshots below the license (#728)

This commit is contained in:
Victor Peschenkov 2019-04-17 06:53:05 +03:00 committed by dkhamsing
parent c31a39112d
commit 52a2165ccc

View File

@ -2,16 +2,14 @@ require_relative 'osia_helper'
require 'date' require 'date'
README = 'README.md' README = 'README.md'
ARCHIVE = 'ARCHIVE.md' ARCHIVE = 'ARCHIVE.md'
ARCHIVE_TAG = 'archive'
APPSTORE = 'APPSTORE.md' APPSTORE = 'APPSTORE.md'
NOT_ENGLISH = '🌐' NOT_ENGLISH = '🌐'
ARCHIVE_TAG = 'archive'
def apps_archived(apps) def apps_archived(apps)
a = apps.select {|a| a['tags'] != nil }.select {|b| b['tags'].include?ARCHIVE_TAG} a = apps.select { |a| a['tags'] != nil }.select { |b| b['tags'].include?(ARCHIVE_TAG) }
a.sort_by { |k, v| k['title'].downcase } a.sort_by { |k, v| k['title'].downcase }
end end
@ -22,7 +20,7 @@ def apps_for_cat(apps, id)
if tags.nil? if tags.nil?
true true
else else
!(tags.include? ARCHIVE_TAG) !(tags.include?(ARCHIVE_TAG))
end end
end end
@ -44,7 +42,7 @@ def app_store_total(j)
t = "#{count} " t = "#{count} "
count = count + 1 count = count + 1
else else
unless tags.include? 'archive' unless tags.include?(ARCHIVE_TAG)
t = "#{count} #{tags}" t = "#{count} #{tags}"
count = count + 1 count = count + 1
end end
@ -87,14 +85,12 @@ def output_apps(apps, appstoreonly)
end end
o << "- #{t} \n" o << "- #{t} \n"
o << " <details><summary>" o << " <details><summary>"
details = '' details = ""
unless tags.nil? unless tags.nil?
details << '<code>swift</code> ' if tags.include? 'swift' details << '<code>swift</code> ' if tags.include? 'swift'
tags.each do |t| tags.each do |t|
details << "<code>#{t.downcase}</code> " if t.downcase != 'swift' details << "<code>#{t.downcase}</code> " if t.downcase != 'swift'
end end
@ -133,6 +129,7 @@ def output_apps(apps, appstoreonly)
details_list[1..-1].each { |x| details << "<br> #{x}" } details_list[1..-1].each { |x| details << "<br> #{x}" }
unless screenshots.nil? || screenshots.empty? unless screenshots.nil? || screenshots.empty?
details << "<br>"
details << "\n" details << "\n"
screenshots.each_with_index do |s, i| screenshots.each_with_index do |s, i|
details << "<a href='#{screenshots[i]}'><code>Screenshot #{i+1}</code></a> " details << "<a href='#{screenshots[i]}'><code>Screenshot #{i+1}</code></a> "