diff options
Diffstat (limited to 'debian/dconv/templates')
-rw-r--r-- | debian/dconv/templates/parser/arguments.tpl | 9 | ||||
-rw-r--r-- | debian/dconv/templates/parser/example.tpl | 12 | ||||
-rw-r--r-- | debian/dconv/templates/parser/example/comment.tpl | 1 | ||||
-rw-r--r-- | debian/dconv/templates/parser/seealso.tpl | 1 | ||||
-rw-r--r-- | debian/dconv/templates/parser/table.tpl | 11 | ||||
-rw-r--r-- | debian/dconv/templates/parser/table/header.tpl | 6 | ||||
-rw-r--r-- | debian/dconv/templates/parser/table/row.tpl | 36 | ||||
-rw-r--r-- | debian/dconv/templates/parser/underline.tpl | 1 | ||||
-rw-r--r-- | debian/dconv/templates/summary.html | 43 | ||||
-rw-r--r-- | debian/dconv/templates/template.html | 238 |
10 files changed, 358 insertions, 0 deletions
diff --git a/debian/dconv/templates/parser/arguments.tpl b/debian/dconv/templates/parser/arguments.tpl new file mode 100644 index 0000000..b5f91e9 --- /dev/null +++ b/debian/dconv/templates/parser/arguments.tpl @@ -0,0 +1,9 @@ +<div class="separator"> +<span class="label label-info">${label}</span>\ +% if desc: + ${desc} +% endif +% if content: +<pre class="prettyprint arguments">${"\n".join(content)}</pre> +% endif +</div> diff --git a/debian/dconv/templates/parser/example.tpl b/debian/dconv/templates/parser/example.tpl new file mode 100644 index 0000000..184b6dd --- /dev/null +++ b/debian/dconv/templates/parser/example.tpl @@ -0,0 +1,12 @@ +<div class="separator"> +<span class="label label-success">${label}</span> +<pre class="prettyprint"> +% if desc: +<div class="example-desc">${desc}</div>\ +% endif +<code>\ +% for line in content: +${line} +% endfor +</code></pre> +</div>
\ No newline at end of file diff --git a/debian/dconv/templates/parser/example/comment.tpl b/debian/dconv/templates/parser/example/comment.tpl new file mode 100644 index 0000000..b51ec2d --- /dev/null +++ b/debian/dconv/templates/parser/example/comment.tpl @@ -0,0 +1 @@ +<span class="comment">\1</span>
\ No newline at end of file diff --git a/debian/dconv/templates/parser/seealso.tpl b/debian/dconv/templates/parser/seealso.tpl new file mode 100644 index 0000000..72cf5f9 --- /dev/null +++ b/debian/dconv/templates/parser/seealso.tpl @@ -0,0 +1 @@ +<div class="page-header"><b>${label}</b> ${desc}</div> diff --git a/debian/dconv/templates/parser/table.tpl b/debian/dconv/templates/parser/table.tpl new file mode 100644 index 0000000..0119176 --- /dev/null +++ b/debian/dconv/templates/parser/table.tpl @@ -0,0 +1,11 @@ +% if title: +<div><p>${title} :</p>\ +% endif +<table class="table table-bordered" border="0" cellspacing="0" cellpadding="0"> +% for row in rows: +${row} +% endfor +</table>\ +% if title: +</div> +% endif
\ No newline at end of file diff --git a/debian/dconv/templates/parser/table/header.tpl b/debian/dconv/templates/parser/table/header.tpl new file mode 100644 index 0000000..e84b47f --- /dev/null +++ b/debian/dconv/templates/parser/table/header.tpl @@ -0,0 +1,6 @@ +<thead><tr>\ +% for col in columns: +<% data = col['data'] %>\ +<th>${data}</th>\ +% endfor +</tr></thead> diff --git a/debian/dconv/templates/parser/table/row.tpl b/debian/dconv/templates/parser/table/row.tpl new file mode 100644 index 0000000..e4f2bef --- /dev/null +++ b/debian/dconv/templates/parser/table/row.tpl @@ -0,0 +1,36 @@ +<% from urllib.parse import quote %> +<% base = pctxt.context['base'] %> +<tr>\ +% for col in columns: +<% data = col['data'] %>\ +<% + if data in ['yes']: + style = "class=\"alert-success pagination-centered\"" + data = 'yes<br /><img src="%scss/check.png" alt="yes" title="yes" />' % base + elif data in ['no']: + style = "class=\"alert-error pagination-centered\"" + data = 'no<br /><img src="%scss/cross.png" alt="no" title="no" />' % base + elif data in ['X']: + style = "class=\"pagination-centered\"" + data = '<img src="%scss/check.png" alt="X" title="yes" />' % base + elif data in ['-']: + style = "class=\"pagination-centered\"" + data = ' ' + elif data in ['*']: + style = "class=\"pagination-centered\"" + else: + style = None +%>\ +<td ${style}>\ +% if "keyword" in col: +<a href="#${quote("%s-%s" % (col['toplevel'], col['keyword']))}">\ +% for extra in col['extra']: +<span class="pull-right">${extra}</span>\ +% endfor +${data}</a>\ +% else: +${data}\ +% endif +</td>\ +% endfor +</tr> diff --git a/debian/dconv/templates/parser/underline.tpl b/debian/dconv/templates/parser/underline.tpl new file mode 100644 index 0000000..4f35f7e --- /dev/null +++ b/debian/dconv/templates/parser/underline.tpl @@ -0,0 +1 @@ +<h5>${data}</h5> diff --git a/debian/dconv/templates/summary.html b/debian/dconv/templates/summary.html new file mode 100644 index 0000000..87c6414 --- /dev/null +++ b/debian/dconv/templates/summary.html @@ -0,0 +1,43 @@ +<a class="anchor" id="summary" name="summary"></a> +<div class="page-header"> + <h1 id="chapter-summary" data-target="summary">Summary</h1> +</div> +<div class="row"> + <div class="col-md-6"> + <% previousLevel = None %> + % for k in chapterIndexes: + <% chapter = chapters[k] %> + % if chapter['title']: + <% + if chapter['level'] == 1: + otag = "<b>" + etag = "</b>" + else: + otag = etag = "" + %> + % if chapter['chapter'] == '7': + ## Quick and dirty hack to split the summary in 2 columns + ## TODO : implement a generic way split the summary + </div><div class="col-md-6"> + <% previousLevel = None %> + % endif + % if otag and previousLevel: + <br /> + % endif + <div class="row"> + <div class="col-md-2 pagination-right noheight">${otag}<small>${chapter['chapter']}.</small>${etag}</div> + <div class="col-md-10 noheight"> + % for tab in range(1, chapter['level']): + <div class="tab"> + % endfor + <a href="#${chapter['chapter']}">${otag}${chapter['title']}${etag}</a> + % for tab in range(1, chapter['level']): + </div> + % endfor + </div> + </div> + <% previousLevel = chapter['level'] %> + % endif + % endfor + </div> +</div> diff --git a/debian/dconv/templates/template.html b/debian/dconv/templates/template.html new file mode 100644 index 0000000..c72b355 --- /dev/null +++ b/debian/dconv/templates/template.html @@ -0,0 +1,238 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8" /> + <title>${headers['title']} ${headers['version']} - ${headers['subtitle']}</title> + <link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" /> + <link href="${base}css/page.css?${version}" rel="stylesheet" /> + </head> + <body> + <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#menu"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="${base}index.html">${headers['title']} <small>${headers['subtitle']}</small></a> + </div> + <!-- /.navbar-header --> + + <!-- Collect the nav links, forms, and other content for toggling --> + <div class="collapse navbar-collapse" id="menu"> + <ul class="nav navbar-nav"> + <li><a href="http://www.haproxy.org/">HAProxy home page</a></li> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Versions <b class="caret"></b></a> + <ul class="dropdown-menu"> + ## TODO : provide a structure to dynamically generate per version links + <li class="dropdown-header">HAProxy 1.4</li> + <li><a href="${base}configuration-1.4.html">Configuration Manual <small>(stable)</small></a></li> + <li><a href="${base}snapshot/configuration-1.4.html">Configuration Manual <small>(snapshot)</small></a></li> + <li><a href="http://git.1wt.eu/git/haproxy-1.4.git/">GIT Repository</a></li> + <li><a href="http://www.haproxy.org/git/?p=haproxy-1.4.git">Browse repository</a></li> + <li><a href="http://www.haproxy.org/download/1.4/">Browse directory</a></li> + <li class="divider"></li> + <li class="dropdown-header">HAProxy 1.5</li> + <li><a href="${base}configuration-1.5.html">Configuration Manual <small>(stable)</small></a></li> + <li><a href="${base}snapshot/configuration-1.5.html">Configuration Manual <small>(snapshot)</small></a></li> + <li><a href="http://git.1wt.eu/git/haproxy-1.5.git/">GIT Repository</a></li> + <li><a href="http://www.haproxy.org/git/?p=haproxy-1.5.git">Browse repository</a></li> + <li><a href="http://www.haproxy.org/download/1.5/">Browse directory</a></li> + <li class="divider"></li> + <li class="dropdown-header">HAProxy 1.6</li> + <li><a href="${base}configuration-1.6.html">Configuration Manual <small>(stable)</small></a></li> + <li><a href="${base}snapshot/configuration-1.6.html">Configuration Manual <small>(snapshot)</small></a></li> + <li><a href="${base}intro-1.6.html">Starter Guide <small>(stable)</small></a></li> + <li><a href="${base}snapshot/intro-1.6.html">Starter Guide <small>(snapshot)</small></a></li> + <li><a href="http://git.1wt.eu/git/haproxy.git/">GIT Repository</a></li> + <li><a href="http://www.haproxy.org/git/?p=haproxy.git">Browse repository</a></li> + <li><a href="http://www.haproxy.org/download/1.6/">Browse directory</a></li> + </ul> + </li> + </ul> + </div> + </nav> + <!-- /.navbar-static-side --> + + <div id="wrapper"> + + <div id="sidebar"> + <form onsubmit="search(this.keyword.value); return false" role="form"> + <div id="searchKeyword" class="form-group"> + <input type="text" class="form-control typeahead" id="keyword" name="keyword" placeholder="Search..." autocomplete="off"> + </div> + </form> + <p> + Keyboard navigation : <span id="keyboardNavStatus"></span> + </p> + <p> + When enabled, you can use <strong>left</strong> and <strong>right</strong> arrow keys to navigate between chapters.<br> + The feature is automatically disabled when the search field is focused. + </p> + <p class="text-right"> + <small>Converted with <a href="https://github.com/cbonte/haproxy-dconv">haproxy-dconv</a> v<b>${version}</b> on <b>${date}</b></small> + </p> + </div> + <!-- /.sidebar --> + + <div id="page-wrapper"> + <div class="row"> + <div class="col-lg-12"> + <div class="text-center"> + <h1>${headers['title']}</h1> + <h2>${headers['subtitle']}</h2> + <p><strong>${headers['version']}</strong></p> + <p> + <a href="http://www.haproxy.org/" title="HAProxy Home Page"><img src="${base}img/logo-med.png" /></a><br> + ${headers['author']}<br> + ${headers['date']} + </p> + </div> + + ${document} + <br> + <hr> + <div class="text-right"> + ${headers['title']} ${headers['version'].replace("version ", "")} – ${headers['subtitle']}<br> + <small>${headers['date']}, ${headers['author']}</small> + </div> + </div> + <!-- /.col-lg-12 --> + </div> + <!-- /.row --> + <div style="position: fixed; z-index: 1000; bottom: 0; left: 0; right: 0; padding: 10px"> + <ul class="pager" style="margin: 0"> + <li class="previous"><a id="previous" href="#"></a></li> + <li class="next"><a id="next" href="#"></a></li> + </ul> + </div> + </div> + <!-- /#page-wrapper --> + + </div> + <!-- /#wrapper --> + + <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> + <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.1.1/js/bootstrap.min.js"></script> + <script src="//cdnjs.cloudflare.com/ajax/libs/typeahead.js/0.11.1/typeahead.bundle.min.js"></script> + <script> + /* Keyword search */ + var searchFocus = false + var keywords = [ + "${'",\n\t\t\t\t"'.join(keywords)}" + ] + + function updateKeyboardNavStatus() { + var status = searchFocus ? '<span class="label label-disabled">Disabled</span>' : '<span class="label label-success">Enabled</span>' + $('#keyboardNavStatus').html(status) + } + + function search(keyword) { + if (keyword && !!~$.inArray(keyword, keywords)) { + window.location.hash = keyword + } + } + // constructs the suggestion engine + var kwbh = new Bloodhound({ + datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), + queryTokenizer: Bloodhound.tokenizers.whitespace, + local: $.map(keywords, function(keyword) { return { value: keyword }; }) + }); + kwbh.initialize() + + $('#searchKeyword .typeahead').typeahead({ + hint: true, + highlight: true, + minLength: 1, + autoselect: true + }, + { + name: 'keywords', + displayKey: 'value', + limit: keywords.length, + source: kwbh.ttAdapter() + }).focus(function() { + searchFocus = true + updateKeyboardNavStatus() + }).blur(function() { + searchFocus = false + updateKeyboardNavStatus() + }).bind('typeahead:selected', function ($e, datum) { + search(datum.value) + }) + + /* EXPERIMENTAL - Previous/Next navigation */ + var headings = $(":header") + var previousTarget = false + var nextTarget = false + var $previous = $('#previous') + var $next = $('#next') + function refreshNavigation() { + var previous = false + var next = false + $.each(headings, function(item, value) { + var el = $(value) + + // TODO : avoid target recalculation on each refresh + var target = el.attr('data-target') + if (! target) return true + + var target_el = $('#' + target.replace(/\./, "\\.")) + if (! target_el.attr('id')) return true + + if (target_el.offset().top < $(window).scrollTop()) { + previous = el + } + if (target_el.offset().top - 1 > $(window).scrollTop()) { + next = el + } + if (next) return false + }) + + previousTarget = previous ? previous.attr('data-target') : 'top' + $previous.html( + previous && previousTarget ? + '<span class="glyphicon glyphicon-arrow-left"></span> ' + previous.text() : + '<span class="glyphicon glyphicon-arrow-up"></span> Top' + ).attr('href', '#' + previousTarget) + + nextTarget = next ? next.attr('data-target') : 'bottom' + $next.html( + next && nextTarget ? + next.text() + ' <span class="glyphicon glyphicon-arrow-right"></span>' : + 'Bottom <span class="glyphicon glyphicon-arrow-down"></span>' + ).attr('href', '#' + nextTarget) + } + + $(window).scroll(function () { + refreshNavigation() + }); + $(document).ready(function() { + refreshNavigation() + updateKeyboardNavStatus() + }); + + /* EXPERIMENTAL - Enable keyboard navigation */ + $(document).keydown(function(e){ + if (searchFocus) return + + switch(e.which) { + case 37: // left + window.location.hash = previousTarget ? previousTarget : 'top' + break + + case 39: // right + window.location.hash = nextTarget ? nextTarget : 'bottom' + break + + default: return // exit this handler for other keys + } + e.preventDefault() + }) + </script> + ${footer} + <a class="anchor" name="bottom"></a> + </body> +</html> |