melpa/html/index.html.erb
Steve Purcell b59fe506d4 Revert "Darken navbar slightly"
This reverts commit 2792d4bc33.
2013-08-22 10:48:31 +01:00

309 lines
13 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%#-*- coding: utf-8 -*-%>
<%
require 'json'
require 'ostruct'
include ERB::Util
archive_json = JSON.parse(File.open("../archive.json").read)
recipe_json = JSON.parse(File.open("../recipes.json").read)
downloads_json = JSON.parse(File.open("../download_counts.json").read) rescue {}
packages = (archive_json.keys & recipe_json.keys).sort.map do |pkgname|
package = OpenStruct.new
package.name = pkgname
package.downloads = downloads_json[package.name]
versions, deps, package.descr, package.pkgtype = archive_json[package.name]
recipe = recipe_json[package.name]
package.version = versions.join('.')
package.url = "packages/#{package.name}-#{package.version}." + (package.pkgtype == "single" ? "el" : "tar")
package.recipe_url = "https://github.com/milkypostman/melpa/blob/master/recipes/#{package.name}"
package.source = recipe["fetcher"]
if package.descr =~ /(.*?)(\s*-\*-.*?)?\s*\[(\w+)\]\s*/
package.descr = $1
end
package.source_url =
case package.source
when 'github' then recipe['repo'].include?('/') ? "https://github.com/#{recipe['repo']}" : "https://gist.github.com/#{recipe['repo']}"
when 'wiki' then recipe.key?('files') ? nil : "http://www.emacswiki.org/emacs/#{package.name}.el"
else
case recipe['url']
when /(bitbucket\.org\/[^\/]+\/[^\/\?]+)/ then "https://" + $1
when /(gitorious\.org\/[^\/]+\/[^.]+)/ then "https://" + $1
when /\A(https?:\/\/code\.google\.com\/p\/[^\/]+\/)/ then $1
when /\A(https?:\/\/[^.]+\.googlecode\.com\/)/ then $1
when /\Alp:(.*)/ then "https://launchpad.net/" + $1
end
end
package
end
%><!DOCTYPE html>
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MELPA</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="styles/default.css" type="text/css" />
<style type="text/css">
body {
padding-top: 60px;
}
h1 {
color: #922793;
}
.dataTables_empty {
background-color: #FCF8E3;
color: #C09853;
}
.table .text-right {
text-align: right;
}
header.navbar {
background-color: #fafafa;
}
pre code { /* Match highlight.js styles to bootstrap */
padding: 0;
background: transparent;
}
#package-list th {
white-space: nowrap;
}
.sort-ind {
float: right;
margin-left: 1em;
}
.jumbotron {
font-size: 18px;
line-height: 30px;
}
.navbar, .navbar .brand, .navbar a, .navbar .nav>li>a {
color: #922793;
}
a[name] { /* Stop navbar from hiding anchors */
padding-top: 60px;
margin-top: -60px;
display: inline-block; /* required for webkit browsers */
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.0.0/moment.min.js"></script>
<script src="highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>
<body>
<header class="navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="/" class="navbar-brand">MELPA</a>
</div>
<nav class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="#packages">Packages</a></li>
<li><a href="#installing">Installing</a></li>
<li><a href="#known-issues">Known issues</a></li>
<li><a href="#updating">Updating</a></li>
<li><a href="#development">Development</a></li>
<li><a href="https://github.com/milkypostman/melpa">Github</a></li>
<li><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=UCKDWNVGK8MFA&lc=US&item_name=MELPA&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted">Donate</a></li>
</ul>
</nav>
</div>
</header>
<div class="container">
<section class="page-header">
<h1>MELPA <small>(Milkypostmans Emacs Lisp Package Archive)</small></h1>
</section>
<div class="row">
<div class="col-md-8">
<section class="jumbotron">
<ul>
<li><strong>Up-to-date packages built on our servers from upstream source</strong></li>
<li><strong>Installable in any recent Emacs using "package.el"</strong> - no need to install svn/cvs/hg/bzr/git/darcs etc.</li>
<li><strong>Curated</strong> - no obsolete, renamed, forked or randomly hacked packages</li>
<li><strong>Comprehensive</strong> - more packages than any other archive</li>
<li><strong>Automatic updates</strong> - new commits result in new packages</li>
<li><strong>Extensible</strong> - contribute recipes via github, and we'll build the packages</li>
</ul>
</section>
</div>
<div class="col-md-4">
<div class="alert alert-success">
<strong>Latest build:</strong> <em><script language="javascript">document.write(moment(new Date(<%= Time.now.to_i * 1000 %>)).fromNow());</script></em>
</div>
<a class="twitter-timeline" data-dnt="true" data-related="milkypostman,sanityinc" href="https://twitter.com/melpa_emacs" data-widget-id="311867756586864640">Tweets by @melpa_emacs</a>
</div>
</div>
<section>
<a name="packages"></a>
<h2>Current List of <%=h packages.size %> Packages
<small>(<%= packages.map(&:downloads).compact.inject(0) { |a,b| a+b } %> downloads to date)</small>
</h2>
<table id="package-list" class="table table-bordered table-responsive table-hover">
<thead>
<tr class="header">
<th>Package</th>
<th>Version</th>
<th>Description</th>
<th>Recipe</th>
<th>Source</th>
<th>DLs</th>
</tr>
</thead>
<tbody>
<% packages.each do |package| %>
<tr>
<td><a name="<%=h package.name %>"></a><%=h package.name %></td>
<td><a href="<%=h package.url %>"><%=h package.version %></a></td>
<td><%=h package.descr %></td>
<td><a href="<%=h package.recipe_url %>">recipe</a></td>
<td><% if package.source_url %>
<a href="<%=h package.source_url %>"><%=h package.source %></a>
<% else %>
<%=h package.source %>
<% end %>
</td>
<td class="text-right"><%=h package.downloads %></td>
</tr>
<% end %>
</tbody>
</table>
</section>
<section>
<a name="installing"></a>
<h2>Installing</h2>
<p>To add the repository put this before the call to <code>package-initialize</code> in your <code>init.el</code> file.</p>
<!-- <script src="https://gist.github.com/1679158.js"> </script> -->
<pre><code>(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)</code></pre>
<p>In Emacs &lt; 24, you'll also need to explicitly include the GNU
ELPA archive, which provides important compatibility libraries like <code>cl-lib</code>:</p>
<pre><code>(when (< emacs-major-version 24)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))</code></pre>
<p>
Please read about <a href="#known-issues">known issues</a>
below before attempting to install multiple packages at once.
</p>
<h3>Customizations</h3>
<p>
There is currently no way in <code>package.el</code> to
exclude or include versions. So to remedy this there is
a <code>melpa.el</code> package (available in MELPA) that will
allow you to enable only certain packages or exclude certain
packages. You can install the package manually by pasting this
into your <code>*scratch*</code> buffer and evaluating it.
</p>
<pre><code>(progn
(switch-to-buffer
(url-retrieve-synchronously
"https://raw.github.com/milkypostman/melpa/master/melpa.el"))
(package-install-from-buffer (package-buffer-info) 'single))</code></pre>
<p>You can then customize two variables:</p>
<dl>
<dt><code>package-archive-enable-alist</code></dt>
<dd>
<p>
Optional Alist of enabled packages used
by <code>package-filter</code>. The format
is <code>(ARCHIVE . PACKAGE ...)</code>,
where <code>ARCHIVE</code> is a string matching an archive
name in<code>package-archives</code>, <code>PACKAGE</code>
is a symbol of a package in <code>ARCHIVE</code> to
enable.
</p>
<p>
If no <code>ARCHIVE</code> exists in the alist, all
packages are enabled.
</p>
</dd>
<dt><code>package-archive-exclude-alist</code></dt>
<dd>
<p>
Alist of packages excluded by <code> package-filter
</code>. The format is <code>(ARCHIVE . PACKAGE
...)</code>, where <code>ARCHIVE</code> is a string
matching an archive name
in</code>package-archives</code>, <code>PACKAGE</code> is
a symbol of a package in that archive to exclude.</p>
<p>
Any specified package is excluded regardless of the value
of <code>package-archive-enable-alist</code>
</p>
</dd>
</dl>
</section>
<section>
<a name="known-issues"></a>
<h2>Known Issues</h2>
<p>
<strong>Note:</strong> <em>These fixes are included in
the <code>melpa.el</code> package.</em>
</p>
<p>
There is a small bug in Emacs24s <code>package.el</code> such
that the dependency order comes out backwards. The problem is
patched by some <em>advice</em>.
</p>
<pre><code> (defadvice package-compute-transaction
(before package-compute-transaction-reverse (package-list requirements) activate compile)
"reverse the requirements"
(setq requirements (reverse requirements))
(print requirements))</code></pre>
</section>
<section>
<a name="updating"></a>
<h2>Updating Packages</h2>
<p>
<code>package.el</code> now includes a mechanism to upgrade
packages. After running <code>package-list-packages</code>,
type <em>U</em> (mark Upgradable packages) and then <em>x</em>
(eXecute the installs and deletions). When its done
installing all the packages it will ask if you want to delete
the obsolete packages and so you can hit <em>y</em> (Yes).
</p>
<p>
If you run into a problem installing or upgrading, you may
need to go into your <code>~/.emacs.d/elpa/</code> directory
and delete packages that are installed multiple times. This
can happen when the install times out.
</p>
<a name="development"></a>
<h2>Development</h2>
<p><a href="https://github.com/milkypostman/melpa">https://github.com/milkypostman/melpa</a></p>
<p>
Contributions are welcome. Currently, the builder supports
packages using git, subversion, mercurial, bzr, cvs, darcs and
emacswiki.
</p>
</section>
</div>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/datatables/1.9.4/jquery.dataTables.min.js" type="text/javascript"></script>
<script language="javascript">
function updateSortIndicators() {
$("#package-list th.sorting .sort-ind").html('<span class="glyphicon glyphicon-minus"></span>');
$("#package-list th.sorting_asc .sort-ind").html('<span class="glyphicon glyphicon-chevron-down"></span>');
$("#package-list th.sorting_desc .sort-ind").html('<span class="glyphicon glyphicon-chevron-up"></span>');
}
var table = $("#package-list");
table.find("th").append('&nbsp;<span class="sort-ind"></span>');
table .dataTable({bPaginate: false, bLengthChange: false, fnDrawCallback: updateSortIndicators});
$('div.dataTables_filter input').focus().attr("placeholder", "Enter filter terms");
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-39278673-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>