Skip to content

Commit

Permalink
Add repository links to the generated Markdown.
Browse files Browse the repository at this point in the history
  • Loading branch information
artob committed Nov 12, 2024
1 parent 526d310 commit bed1404
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 51 deletions.
16 changes: 13 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,23 @@ end

file 'projects.md': PROJECTS do |t|
File.open(t.name, 'w') do |out|
out.puts "| Name | Description |"
out.puts "| :--- | :---------- |"
out.puts "| Name | Summary | Repository |"
out.puts "| :--- | :------ | :--------- |"
projects(t.prerequisites).each do |project|
project_name = project['name']
project_link = "[#{project_name}](#{project['homepage']})"
project_desc = project['shortdesc']['en']
out.puts "| " + [project_link, project_desc].join(" | ") + " |"
project_repo = project['repository']
project_vcs = case
when project_repo.nil? then 'N/A'
when project_repo['browse'].start_with?('https://github.com')
"[GitHub](#{project_repo['browse']})"
when project_repo['browse'].start_with?('https://bitbucket.org')
"[Bitbucket](#{project_repo['browse']})"
else
"[Other](#{project_repo['browse']})"
end
out.puts "| " + [project_link, project_desc, project_vcs].join(" | ") + " |"
end
end
end
Expand Down
Loading

0 comments on commit bed1404

Please sign in to comment.