From 340e389a5d2578f1baff45f07706dd4ca019ff9a Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Mon, 16 Apr 2012 17:14:11 +0100 Subject: [PATCH] Add a "Source" column to the html package list, and link contents to the recipe files --- html/index.erb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/html/index.erb b/html/index.erb index 8b8d36e3..22f218f0 100644 --- a/html/index.erb +++ b/html/index.erb @@ -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|