Docs amends

This commit is contained in:
Anatoliy Chakkaev 2013-03-26 04:40:16 +04:00
parent f76b56d2fe
commit 6981824d28
3 changed files with 50 additions and 4 deletions

View File

@ -25,7 +25,7 @@ HTML_DOCS = $(shell find docs -name '*.md' \
docs/man/%.3: docs/%.md scripts/doc.sh docs/man/%.3: docs/%.md scripts/doc.sh
scripts/doc.sh $< $@ scripts/doc.sh $< $@
docs/html/%.3.html: docs/%.md scripts/doc.sh docs/html/%.3.html: docs/%.md scripts/doc.sh docs/footer.html
scripts/doc.sh $< $@ scripts/doc.sh $< $@
docs/html/index.html: docs/jugglingdb.md scripts/doc.sh docs/html/index.html: docs/jugglingdb.md scripts/doc.sh

View File

@ -1,5 +1,5 @@
<script> <script>
var filename = location.href.match(/([^\/]+)?\.3.html$/)[1]; var filename = location.href.match(/([^\/]+)?\.3.html(#.*?)?$/)[1];
var div = document.createElement('div'); var div = document.createElement('div');
div.innerHTML = 'Found a typo? ' + div.innerHTML = 'Found a typo? ' +
linkTo('View', 'blob') + ' and ' + linkTo('View', 'blob') + ' and ' +
@ -11,4 +11,50 @@
return '<a href="https://github.com/1602/jugglingdb/' + return '<a href="https://github.com/1602/jugglingdb/' +
dir + '/master/docs/' + filename + '.md">' + text + '</a>'; dir + '/master/docs/' + filename + '.md">' + text + '</a>';
} }
addLink('h3', '&para;');
addLink('h2', '&sect;');
function addLink(tag, sign) {
var els = document.getElementsByTagName(tag);
for (var i = 0; i < els.length; i += 1) {
var el = els[i];
el.innerHTML = '<a class="section-link" href="#' + el.id +
'">' + sign + '</a>' + el.innerHTML;
// el.style = 'margin-left: -1em';
}
}
</script> </script>
<style>
.section-link {
visibility: hidden;
}
.mp h1, .mp h2, .mp h3 {
position: relative;
left: -1em;
}
a.section-link:hover,
a.section-link:link,
a.section-link {
color: #999;
text-decoration: none;
}
h1:hover .section-link,
h2:hover .section-link,
h3:hover .section-link {
visibility: visible;
}
.mp pre code {
color: #565758;
}
/*
pre {
background: #eee;
}
*/
</style>