Improve the look of the webpage. Add some CSS!

ON ICE!
This commit is contained in:
Donald Ephraim Curtis 2012-01-22 13:57:48 -06:00
parent 76fd6c24d6
commit c28172d4d3
3 changed files with 68 additions and 17 deletions

View file

@ -4,34 +4,62 @@
> a repository for development versions of Emacs packages (hot from the repo). > a repository for development versions of Emacs packages (hot from the repo).
**Last Updated:** <%= Time.now.strftime("%Y.%m.%d %H:%M") %> **Last Update:** *<%= Time.now.strftime("%Y.%m.%d %H:%M") %>*
## Current List of Packages being Generated Nightly ## Current List of Packages being Generated Nightly
<%= <%
def parse str def parse str
# credit to: http://stackoverflow.com/q/3128406/154508 # credit to: http://stackoverflow.com/q/3128406/154508
tokens = str.scan(/#{Regexp.escape("(")}|#{Regexp.escape(")")}|[a-zA-Z0-9\-\_]+/) tokens = str.scan(/#{Regexp.escape("(")}|#{Regexp.escape(")")}|[a-zA-Z0-9\-\_]+/)
stack = [[]] stack = [[]]
tokens.each do |tok| tokens.each do |tok|
case tok case tok
when "(" when "("
stack << [] stack << []
when ")" when ")"
stack[-2] << stack.pop stack[-2] << stack.pop
else else
stack[-1] << tok stack[-1] << tok
end
end end
return stack[-1][-1]
end end
return stack[-1][-1]
end headers = ["Package", "Version", "Description"]
parse(File.open("../packages/archive-contents").read)[1..-1].map{ |x|
"* #{x[0]}-#{x[1]} :: #{x[3..-2].join(" ")}" data = parse(File.open("../packages/archive-contents").read)[1..-1]
}.join("\n")
data.map! do |row|
[row[0], row[1][0], row[3..-2].join(" ")]
end
colwidth = [0,0,0]
data.map do |row|
row.to_enum(:each_with_index).map do |e,i|
colwidth[i] = [colwidth[i], e.length].max
end
end
%> %>
<%=
headers.to_enum(:each_with_index).map{
|h,i| h + " "*(colwidth[i]-h.length) }.join(" ")
%>
<%= colwidth.map{ |w| "-"*w }.join(" ") %>
<%=
data.map{ |row|
row.to_enum(:each_with_index).map{ |c,i|
c + " "*(colwidth[i]-c.length)
}.join(" ")
}.join("\n")
%>
## Installing ## Installing

22
html/style.css Normal file
View file

@ -0,0 +1,22 @@
table {
border-spacing: 0px;
}
/* td:first-child, th:first-child { */
/* padding-left: 5px; */
/* padding-right: 5px; */
/* } */
td, th {
padding: 3px 7px 3px 7px;
}
tr.header {
background-color: #fad;
}
tr.odd {
background-color: #ccc;
}

3
melpa
View file

@ -4,6 +4,7 @@ BASEDIR=`dirname $0`
cd ${BASEDIR} || exit 1 cd ${BASEDIR} || exit 1
function melpa_clear_packages { function melpa_clear_packages {
echo "*** Clearing the packages folder..." echo "*** Clearing the packages folder..."
rm -r packages/* rm -r packages/*
@ -27,7 +28,7 @@ function melpa_generate_html {
echo "*** Building html" echo "*** Building html"
cd html || return 1 cd html || return 1
erb index.erb > index.md erb index.erb > index.md
pandoc -s --mathml -t html --smart index.md > index.html pandoc --css=style.css -s --mathml -t html --smart index.md > index.html
cd .. cd ..
echo echo
} }