From cebf887382f1afcc776f5b3fbdf997d7757e82bb Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Wed, 13 Mar 2013 14:50:22 +0000 Subject: [PATCH] Use bootstrap for the MELPA index page --- .gitignore | 1 - html/Makefile | 11 +-- html/index.html.erb | 235 ++++++++++++++++++++++++++++++++++++++++++++ html/style.css | 95 ------------------ 4 files changed, 239 insertions(+), 103 deletions(-) create mode 100644 html/index.html.erb delete mode 100644 html/style.css diff --git a/.gitignore b/.gitignore index 639fc9f1..ed2319b0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ /packages/archive-contents /working/*/ /html/index.html -/html/index.md /epkgs **.elc .#* diff --git a/html/Makefile b/html/Makefile index 2e012203..407702d8 100644 --- a/html/Makefile +++ b/html/Makefile @@ -1,16 +1,13 @@ SHELL := /bin/bash -.PHONY: all clean index.md updates.rss +.PHONY: all clean updates.rss all: index.html updates.rss -index.md: index.erb - erb index.erb > index.md - -index.html: index.md - pandoc --template=template.html --css=style.css -s --mathml -t html --smart index.md > index.html +index.html: index.html.erb + erb index.html.erb > index.html updates.rss: updates.rss.erb erb updates.rss.erb > updates.rss clean: - -rm -v index.md index.html updates.rss + -rm -v index.html updates.rss diff --git a/html/index.html.erb b/html/index.html.erb new file mode 100644 index 00000000..d305f413 --- /dev/null +++ b/html/index.html.erb @@ -0,0 +1,235 @@ +<% + 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) + + packages = archive_json.keys.sort.map do |pkgname| + package = OpenStruct.new + package.name = pkgname + 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 = 'unknown' + if package.descr =~ /(.*?)(\s*-\*-.*?)?\s*\[source:\s*(\w+)\]\s*/ + package.descr, package.source = $1, $3 + 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" + end + package + end +%> + + + + + MELPA + + + + + + + + + + + + +
+ +
+
    +
  • 100s of elisp packages built directly from developers' repositories
  • +
  • Install packages in any recent Emacs using "package.el" - no need to install svn/cvs/hg/bzr/git/darcs etc.
  • +
  • Curated - no obsolete, renamed or randomly hacked packages +
  • Automatic updates - from commit to package without intervention +
  • Extensible - contribute recipes via github, and we'll build the packages +
+
+
+

Current List of <%=h packages.size %> Packages

+ + + + + + + + + + + + <% packages.each do |package| %> + + + + + + + + <% end %> + +
PackageVersionDescriptionRecipeSource
<%=h package.name %><%=h package.version %><%=h package.descr %>recipe<% if package.source_url %> + <%=h package.source %> + <% else %> + <%=h package.source %> + <% end %> +
+
+
+

Installing

+

To add the repository put this before the call to package-initialize in your init.el file.

+ + +
(add-to-list 'package-archives
+  '("melpa" . "http://melpa.milkbox.net/packages/") t)
+

+ Please read about known issues + below before attempting to install multiple packages at once. +

+

Customizations

+

+ There is currently no way in package.el to + exclude or include versions. So to remedy this there is + a melpa.el 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 *scratch* buffer and evaluating it. +

+
(progn
+  (switch-to-buffer
+    (url-retrieve-synchronously
+      "https://raw.github.com/milkypostman/melpa/master/melpa.el"))
+  (package-install-from-buffer  (package-buffer-info) 'single))
+

You can then customize two variables:

+
+
package-archive-enable-alist
+
+

+ Optional Alist of enabled packages used + by package-filter. The format + is (ARCHIVE . PACKAGE ...), + where ARCHIVE is a string matching an archive + name inpackage-archives, PACKAGE + is a symbol of a package in ARCHIVE to + enable. +

+

+ If no ARCHIVE exists in the alist, all + packages are enabled. +

+
+
package-archive-exclude-alist
+
+

+ Alist of packages excluded by package-filter + . The format is (ARCHIVE . PACKAGE + ...), where ARCHIVE is a string + matching an archive name + inpackage-archives, PACKAGE is + a symbol of a package in that archive to exclude.

+

+ Any specified package is excluded regardless of the value + of package-archive-enable-alist +

+
+
+
+
+

Known Issues

+

+ Note: These fixes are included in + the melpa.el package. +

+

+ There is a small bug in Emacs24’s package.el such + that the dependency order comes out backwards. The problem is + patched by some advice. +

+ +
 (defadvice package-compute-transaction
+  (before package-compute-transaction-reverse (package-list requirements) activate compile)
+    "reverse the requirements"
+    (setq requirements (reverse requirements))
+    (print requirements))
+
+
+

Updating Packages

+

+ package.el now includes a mechanism to upgrade + packages. After running package-list-packages, + type U (mark Upgradable packages) and then x + (eXecute the installs and deletions). When it’s done + installing all the packages it will ask if you want to delete + the obsolete packages and so you can hit y (Yes). +

+

+ If you run into a problem installing or upgrading, you may + need to go into your ~/.emacs.d/elpa/ directory + and delete packages that are installed multiple times. This + can happen when the install times out + (see Known Issues). +

+

Development

+

https://github.com/milkypostman/melpa

+

+ Contributions are welcome. Currently, the builder supports + packages using git, subversion, mercurial, bzr, cvs, darcs and + emacswiki. +

+
+
+ + + + + diff --git a/html/style.css b/html/style.css deleted file mode 100644 index 14d78945..00000000 --- a/html/style.css +++ /dev/null @@ -1,95 +0,0 @@ -body { - margin-top: 1.0em; - background-color: #922793; - font-family: Verdana, Helvetica, Arial, FreeSans, san-serif; - font-size: 13px; - line-height: 22px; - color: #ffffff; -} - -#container { - margin: 0 auto; - width: 730px; -} - -h1 { - font-size: 3.8em; - color: #ff6622; - margin-bottom: 3px; -} - -h1 .small { - font-size: 0.4em; -} - -h1 a { - text-decoration: none } - -h2 { - font-size: 1.5em; - color: #6dd86c; -} - -h3 { - color: #6dd86c; -} - -a { - color: #ff6622; - text-decoration: none; -} - -pre code { - padding: 0px; -} - -pre { - background: #000; - color: #fff; - padding: 15px; -} - -hr { - border: 0; - width: 80%; - border-bottom: 1px solid #aaa; -} - -.footer { - text-align:center; - padding-top:30px; - font-style: italic; -} - -table { - width: 730px; - border-spacing: 0px; - border-top: 1px solid #ccc; - border-top: 1px solid #777; -/* border-bottom: 1px solid #ccc; */ -} - -td, th { - padding: 2px 7px 2px 7px; -} - -tr { - color: #ddd; -} - -td:first-child a { - color: #fff; -} - -tr.header { - color: #000; - background-color: #fad; - text-align: left; - font-size: 110%; -} - -tr.odd { - background-color: #ccc; - background-color: #800083; -} -