Skip to content

Commit

Permalink
Add a "Source" column to the html package list, and link contents to …
Browse files Browse the repository at this point in the history
…the recipe files
  • Loading branch information
purcell authored and Donald Curtis committed Apr 18, 2012
1 parent d575897 commit 340e389
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions html/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,23 @@
end


headers = ["Package", "Version", "Description"]
headers = ["Package", "Version", "Description", "Source"]

data = parse(File.open("../packages/archive-contents").read)[1..-1]


data.map! do |row|
[row[0], row[1][0], row[3..-2].join(" ")]
pkgname = row[0]
recipe_url = "https://github.com/milkypostman/melpa/blob/master/recipes/#{pkgname}"
descr, source = row[3..-2].join(" "), "other"
if descr =~ /(.*?)\s*\[source:\s*(\w+)\]\s*/
descr, source = $1, $2
end
[pkgname, row[1][0], descr, "[#{source}](#{recipe_url})"]
end
data.sort!

colwidth = [0,0,0]
colwidth = [0,0,0, 9]

data.map do |row|
row.to_enum(:each_with_index).map do |e,i|
Expand Down

0 comments on commit 340e389

Please sign in to comment.