1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
|
Author: Apollon Oikonomopoulos <apoikos@debian.org>
Date: Sun Apr 27 11:56:44 2014 +0300
dconv: debianize
- Use Debian bootstrap and jquery packages
- Add Debian-related resources to the template
- Use the package's version instead of HAProxy's git version
- Move all assets under static/
diff --git a/debian/dconv/haproxy-dconv.py b/debian/dconv/haproxy-dconv.py
index a43907c..3185b94 100755
--- a/debian/dconv/haproxy-dconv.py
+++ b/debian/dconv/haproxy-dconv.py
@@ -44,16 +44,11 @@ VERSION = ""
HAPROXY_GIT_VERSION = False
def main():
- global VERSION, HAPROXY_GIT_VERSION
-
- VERSION = get_git_version()
- if not VERSION:
- sys.exit(1)
+ global HAPROXY_GIT_VERSION
usage="Usage: %prog --infile <infile> --outfile <outfile>"
optparser = OptionParser(description='Generate HTML Document from HAProxy configuation.txt',
- version=VERSION,
usage=usage)
optparser.add_option('--infile', '-i', help='Input file mostly the configuration.txt')
optparser.add_option('--outfile','-o', help='Output file')
@@ -63,7 +58,7 @@ def main():
optparser.print_help()
exit(1)
- HAPROXY_GIT_VERSION = get_haproxy_git_version(os.path.dirname(option.infile))
+ HAPROXY_GIT_VERSION = get_haproxy_debian_version(os.path.dirname(option.infile))
convert(option.infile, option.outfile)
@@ -108,6 +103,15 @@ def get_haproxy_git_version(path):
version = re.sub(r'-g.*', '', version)
return version
+def get_haproxy_debian_version(path):
+ try:
+ version = subprocess.check_output(["dpkg-parsechangelog", "-Sversion"],
+ cwd=os.path.join(path, ".."))
+ except subprocess.CalledProcessError:
+ return False
+
+ return version.strip()
+
def getTitleDetails(string):
array = string.split(".")
@@ -447,7 +451,6 @@ def convert(infile, outfile):
keywords = keywords,
keywordsCount = keywordsCount,
keyword_conflicts = keyword_conflicts,
- version = VERSION,
date = datetime.datetime.now().strftime("%Y/%m/%d"),
)
except TopLevelLookupException:
@@ -463,7 +466,6 @@ def convert(infile, outfile):
keywords = keywords,
keywordsCount = keywordsCount,
keyword_conflicts = keyword_conflicts,
- version = VERSION,
date = datetime.datetime.now().strftime("%Y/%m/%d"),
footer = footer
)
diff --git a/debian/dconv/templates/parser/table/row.tpl b/debian/dconv/templates/parser/table/row.tpl
index 16f4d7b..d92bd18 100644
--- a/debian/dconv/templates/parser/table/row.tpl
+++ b/debian/dconv/templates/parser/table/row.tpl
@@ -5,13 +5,13 @@
<%
if data in ['yes']:
style = "class=\"alert-success pagination-centered\""
- data = 'yes<br /><img src="css/check.png" alt="yes" title="yes" />'
+ data = 'yes<br /><img src="static/check.png" alt="yes" title="yes" />'
elif data in ['no']:
style = "class=\"alert-error pagination-centered\""
- data = 'no<br /><img src="css/cross.png" alt="no" title="no" />'
+ data = 'no<br /><img src="static/cross.png" alt="no" title="no" />'
elif data in ['X']:
style = "class=\"pagination-centered\""
- data = '<img src="css/check.png" alt="X" title="yes" />'
+ data = '<img src="static/check.png" alt="X" title="yes" />'
elif data in ['-']:
style = "class=\"pagination-centered\""
data = ' '
diff --git a/debian/dconv/templates/template.html b/debian/dconv/templates/template.html
index 21e6ff2..abf5488 100644
--- a/debian/dconv/templates/template.html
+++ b/debian/dconv/templates/template.html
@@ -3,44 +3,27 @@
<head>
<meta charset="utf-8" />
<title>${headers['title']} ${headers['version']} - ${headers['subtitle']}</title>
- <link href="bootstrap/css/bootstrap.min.css?${version}" rel="stylesheet" />
- <link href="css/page.css?${version}" rel="stylesheet" />
+ <link href="static/bootstrap.min.css" rel="stylesheet" />
+ <link href="static/page.css" rel="stylesheet" />
</head>
<body>
- <div class="navbar navbar-fixed-top navbar-inverse">
+ <div class="navbar navbar-fixed-top navbar-inverse navbar-top">
<div class="navbar-inner">
<div class="_container">
<a class="brand" href="#">${headers['title']} ${headers['subtitle']} <small>${headers['version'].replace("version ", "")}</small></a>
<ul class="nav">
- <li class="divider-vertical"></li>
<li><a href="http://haproxy.1wt.eu/">HAProxy home page</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
- Versions
+ Debian resources
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
- ## TODO : provide a structure to dynamically generate per version links
- <li class="dropdown-submenu">
- <a tabindex="-1" href="#">HAProxy 1.4</a>
- <ul class="dropdown-menu">
- <li><a href="configuration-1.4.html">Configuration Manual</a></li>
- <li class="divider"></li>
- <li><a href="http://git.1wt.eu/git/haproxy-1.4.git/">GIT Repository</a></li>
- <li><a href="http://haproxy.1wt.eu/git/?p=haproxy-1.4.git">Browse repository</a></li>
- <li><a href="http://haproxy.1wt.eu/download/1.4/">Browse directory</a></li>
- </ul>
- </li>
- <li class="dropdown-submenu">
- <a tabindex="-1" href="#">HAProxy 1.5</a>
- <ul class="dropdown-menu">
- <li><a href="configuration-1.5.html">Configuration Manual</a></li>
- <li class="divider"></li>
- <li><a href="http://git.1wt.eu/git/haproxy.git/">GIT Repository</a></li>
- <li><a href="http://haproxy.1wt.eu/git/?p=haproxy.git">Browse repository</a></li>
- <li><a href="http://haproxy.1wt.eu/download/1.5/">Browse directory</a></li>
- </ul>
- </li>
+ <li><a href="https://bugs.debian.org/src:haproxy">Bug Tracking System</a></li>
+ <li><a href="https://packages.debian.org/haproxy">Package page</a></li>
+ <li><a href="http://tracker.debian.org/pkg/haproxy">Package Tracking System</a></li>
+ <li class="divider"></li>
+ <li><a href="http://anonscm.debian.org/gitweb/?p=pkg-haproxy/haproxy.git">Package Git Repository</a></li>
</ul>
</li>
</ul>
@@ -71,7 +54,7 @@
The feature is automatically disabled when the search field is focused.
</p>
<p class="text-right">
- <small>Converted with <a href="http://github.com/cbonte/haproxy-dconv">haproxy-dconv</a> v<b>${version}</b> on <b>${date}</b></small>
+ <small>Converted with <a href="http://github.com/cbonte/haproxy-dconv">haproxy-dconv</a> on <b>${date}</b></small>
</p>
</div>
</div>
@@ -81,9 +64,8 @@
<div class="well pagination-centered">
<h1>${headers['title']}</h1>
<h2>${headers['subtitle']}</h2>
- <p><strong>${headers['version']}</strong></p>
+ <p><strong>${headers['version']} (Debian)</strong></p>
<p>
- <a href="http://haproxy.1wt.eu/" title="HAProxy Home Page"><img src="http://haproxy.1wt.eu/img/logo-med.png" /></a><br>
${headers['author']}<br>
${headers['date']}
</p>
@@ -94,8 +76,8 @@
</div>
</div>
- <script src="js/jquery.min.js?${version}"></script>
- <script src="bootstrap/js/bootstrap.min.js?${version}"></script>
+ <script src="static/jquery.min.js"></script>
+ <script src="static/bootstrap.min.js"></script>
<script>
/* Keyword search */
|