Alien-uv
view release on metacpan or search on metacpan
libuv/tools/make_dist_html.py view on Meta::CPAN
#!/usr/bin/python
from __future__ import print_function
import itertools
import os
import re
import subprocess
HTML = r'''
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://libuv.org/styles/vendor.css">
<link rel="stylesheet" href="http://libuv.org/styles/main.css">
<style>
table {{
border-spacing: 0;
}}
body table {{
margin: 0 0 0 12pt;
}}
th, td {{
padding: 2pt;
text-align: left;
vertical-align: top;
}}
table table {{
border-collapse: initial;
padding: 0 0 16pt 0;
}}
table table tr:nth-child(even) {{
background-color: #777;
}}
</style>
</head>
<body>
<table>{groups}</table>
</body>
</html>
'''
GROUPS = r'''
<tr>
<td>{groups[0]}</td>
<td>{groups[1]}</td>
<td>{groups[2]}</td>
<td>{groups[3]}</td>
</tr>
'''
GROUP = r'''
<table>
<tr>
<th>version</th>
<th>tarball</th>
<th>gpg</th>
<th>windows</th>
</tr>
{rows}
</table>
'''
ROW = r'''
<tr>
<td>
<a href="http://dist.libuv.org/dist/{tag}/">{tag}</a>
</td>
<td>
<a href="http://dist.libuv.org/dist/{tag}/libuv-{tag}.tar.gz">tarball</a>
</td>
<td>{maybe_gpg}</td>
<td>{maybe_exe}</td>
</tr>
'''
GPG = r'''
<a href="http://dist.libuv.org/dist/{tag}/libuv-{tag}.tar.gz.sign">gpg</a>
'''
# The binaries don't have a predictable name, link to the directory instead.
EXE = r'''
<a href="http://dist.libuv.org/dist/{tag}/">exe</a>
'''
def version(tag):
return map(int, re.match('^v(\d+)\.(\d+)\.(\d+)', tag).groups())
def major_minor(tag):
return version(tag)[:2]
def row_for(tag):
maybe_gpg = ''
( run in 0.729 second using v1.01-cache-2.11-cpan-0d23b851a93 )