site: show version links on manuals

This commit is contained in:
Simon Michael 2016-04-16 04:44:33 -07:00
parent 6a97a246dd
commit 130d259cb1
12 changed files with 49 additions and 1 deletions

View File

@ -20,3 +20,10 @@ m4_define({{_col3_}},
m4_define({{_shell_}}, {{```{.shell .clear}$1```}})m4_dnl
m4_define({{_shellbold_}}, {{```{.shell .bold .clear}$1```}})m4_dnl
m4_define({{_journal_}}, {{```{.journal .clear}$1```}})m4_dnl
m4_define({{_currentrelease_}}, {{0.27}})m4_dnl
m4_define({{_versions_}},
{{<div class="versions">
version:
<a href="$1.html">dev</a>
| <a href="_currentrelease_()/$1.html">_currentrelease_()</a>
</div>}})m4_dnl

View File

@ -3,6 +3,8 @@
% January 2016
<div class="web">
_versions_({{hledger-api}})
* toc
</div>
<div class="man">

View File

@ -3,6 +3,8 @@
% April 2016
<div class="web">
_versions_({{csv}})
* toc
</div>
<div class="man">

View File

@ -3,6 +3,8 @@
% April 2016
<div class="web">
_versions_({{journal}})
* toc
</div>
<div class="man">

View File

@ -3,6 +3,8 @@
% April 2016
<div class="web">
_versions_({{timeclock}})
* toc
</div>
<div class="man">

View File

@ -3,6 +3,8 @@
% April 2016
<div class="web">
_versions_({{timedot}})
* toc
</div>
<div class="man">

View File

@ -3,6 +3,8 @@
% October 2015
<div class="web">
_versions_({{hledger-ui}})
* toc
<style>

View File

@ -3,6 +3,8 @@
% October 2015
<div class="web">
_versions_({{hledger-web}})
* toc
</div>
<div class="man">

View File

@ -3,6 +3,8 @@
% April 2016
<div class="web">
_versions_({{hledger}})
* toc
</div>
<div class="man">

View File

@ -78,7 +78,8 @@ h4, h5, h6 {
.navbar { font-size:x-large; }
.navbar-brand { font-weight:bold; font-size:xx-large; }
.navbar-nav { margin-left:1em; }
/* table of contents styling */
/* table of contents */
/* based on https://github.com/blaenk/blaenk.github.io/blob/source/provider/scss/_article.scss */
#toc {
max-width:40%;
@ -146,6 +147,10 @@ h4, h5, h6 {
/* */
/* documentation version selector */
#versions {
}
h2 {
margin-top:1.5em;
}

19
site/js/site.js Normal file
View File

@ -0,0 +1,19 @@
$(document).ready( function() {
highlightDocVersion();
});
function highlightDocVersion() {
$('.versions').each( function() {
var parts = window.location.pathname.split('/');
var dir = parts.length > 1 ? parts[parts.length-2] : '';
var ver = $.isNumeric(dir) ? dir : 'dev';
$(this).find('a').each( function() {
if ($(this).html() == ver)
$(this)
.removeAttr('href')
.css('text-decoration', 'none')
.css('color', 'initial')
// .css('font-weight','bold');
});
});
}

View File

@ -12,6 +12,7 @@
<link href="http://maxcdn.bootstrapcdn.com/bootswatch/3.3.0/readable/bootstrap.min.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="/js/site.js"></script>
<script src="/js/highslide/highslide.js"></script>
<script type="text/javascript">
hs.graphicsDir = 'js/highslide/graphics/';