mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 19:17:27 +00:00
add download count to the melpa webpage
This commit is contained in:
parent
e77648205e
commit
c100cba4e8
1 changed files with 7 additions and 0 deletions
|
@ -4,10 +4,12 @@
|
||||||
include ERB::Util
|
include ERB::Util
|
||||||
archive_json = JSON.parse(File.open("../archive.json").read)
|
archive_json = JSON.parse(File.open("../archive.json").read)
|
||||||
recipe_json = JSON.parse(File.open("../recipes.json").read)
|
recipe_json = JSON.parse(File.open("../recipes.json").read)
|
||||||
|
downloads_json = JSON.parse(File.open("../download_counts.json").read)
|
||||||
|
|
||||||
packages = (archive_json.keys & recipe_json.keys).sort.map do |pkgname|
|
packages = (archive_json.keys & recipe_json.keys).sort.map do |pkgname|
|
||||||
package = OpenStruct.new
|
package = OpenStruct.new
|
||||||
package.name = pkgname
|
package.name = pkgname
|
||||||
|
package.downloads = downloads_json[package.name]
|
||||||
versions, deps, package.descr, package.pkgtype = archive_json[package.name]
|
versions, deps, package.descr, package.pkgtype = archive_json[package.name]
|
||||||
recipe = recipe_json[package.name]
|
recipe = recipe_json[package.name]
|
||||||
package.version = versions.join('.')
|
package.version = versions.join('.')
|
||||||
|
@ -52,6 +54,9 @@
|
||||||
background-color: #FCF8E3;
|
background-color: #FCF8E3;
|
||||||
color: #C09853;
|
color: #C09853;
|
||||||
}
|
}
|
||||||
|
.table .text-right {
|
||||||
|
text-align: right !important;
|
||||||
|
}
|
||||||
pre code { /* Match highlight.js styles to bootstrap */
|
pre code { /* Match highlight.js styles to bootstrap */
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
@ -123,6 +128,7 @@
|
||||||
<th align="left">Description</th>
|
<th align="left">Description</th>
|
||||||
<th align="left">Recipe</th>
|
<th align="left">Recipe</th>
|
||||||
<th align="left">Source</th>
|
<th align="left">Source</th>
|
||||||
|
<th class="text-right" align="right"># DLs</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -138,6 +144,7 @@
|
||||||
<%=h package.source %>
|
<%=h package.source %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</td>
|
</td>
|
||||||
|
<td class="text-right"><%=h package.downloads %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in a new issue