Skip to content

Commit

Permalink
Add markdown output task to lists.rake
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew committed Jan 11, 2024
1 parent 583c593 commit fb6a9ec
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/tasks/lists.rake
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@ namespace :lists do
List.import_lists_from_topic('awesome-list')
List.import_lists_from_topic('awesome')
end

desc 'output markdown'
task :markdown => :environment do
List.displayable.order(Arel.sql("(repository ->> 'stargazers_count')::text::integer").desc.nulls_last).all.each do |list|
next if list.description.blank?
next if list.name.include?('?')
puts "- [#{list.name}](#{list.url}) - #{list.description}#{list.description[-1] == '.' ? '' : '.'}"
end
end
end

0 comments on commit fb6a9ec

Please sign in to comment.