mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 19:17:27 +00:00
Improve the look of the webpage. Add some CSS!
ON ICE!
This commit is contained in:
parent
76fd6c24d6
commit
c28172d4d3
3 changed files with 68 additions and 17 deletions
|
@ -4,34 +4,62 @@
|
|||
|
||||
> 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
|
||||
|
||||
<%=
|
||||
def parse str
|
||||
# credit to: http://stackoverflow.com/q/3128406/154508
|
||||
tokens = str.scan(/#{Regexp.escape("(")}|#{Regexp.escape(")")}|[a-zA-Z0-9\-\_]+/)
|
||||
<%
|
||||
def parse str
|
||||
# credit to: http://stackoverflow.com/q/3128406/154508
|
||||
tokens = str.scan(/#{Regexp.escape("(")}|#{Regexp.escape(")")}|[a-zA-Z0-9\-\_]+/)
|
||||
|
||||
stack = [[]]
|
||||
stack = [[]]
|
||||
|
||||
tokens.each do |tok|
|
||||
case tok
|
||||
tokens.each do |tok|
|
||||
case tok
|
||||
when "("
|
||||
stack << []
|
||||
stack << []
|
||||
when ")"
|
||||
stack[-2] << stack.pop
|
||||
stack[-2] << stack.pop
|
||||
else
|
||||
stack[-1] << tok
|
||||
stack[-1] << tok
|
||||
end
|
||||
end
|
||||
|
||||
return stack[-1][-1]
|
||||
end
|
||||
|
||||
return stack[-1][-1]
|
||||
end
|
||||
parse(File.open("../packages/archive-contents").read)[1..-1].map{ |x|
|
||||
"* #{x[0]}-#{x[1]} :: #{x[3..-2].join(" ")}"
|
||||
}.join("\n")
|
||||
|
||||
headers = ["Package", "Version", "Description"]
|
||||
|
||||
data = parse(File.open("../packages/archive-contents").read)[1..-1]
|
||||
|
||||
|
||||
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
|
||||
|
||||
|
|
22
html/style.css
Normal file
22
html/style.css
Normal 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
3
melpa
|
@ -4,6 +4,7 @@ BASEDIR=`dirname $0`
|
|||
|
||||
cd ${BASEDIR} || exit 1
|
||||
|
||||
|
||||
function melpa_clear_packages {
|
||||
echo "*** Clearing the packages folder..."
|
||||
rm -r packages/*
|
||||
|
@ -27,7 +28,7 @@ function melpa_generate_html {
|
|||
echo "*** Building html"
|
||||
cd html || return 1
|
||||
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 ..
|
||||
echo
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue