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,11 +4,11 @@
|
||||||
|
|
||||||
> 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\-\_]+/)
|
||||||
|
@ -28,11 +28,39 @@ def parse str
|
||||||
|
|
||||||
return stack[-1][-1]
|
return stack[-1][-1]
|
||||||
end
|
end
|
||||||
parse(File.open("../packages/archive-contents").read)[1..-1].map{ |x|
|
|
||||||
"* #{x[0]}-#{x[1]} :: #{x[3..-2].join(" ")}"
|
|
||||||
|
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")
|
}.join("\n")
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
To add the repository put this before the call to `package-initialize`
|
To add the repository put this before the call to `package-initialize`
|
||||||
|
|
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
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue