Skip to content

Commit

Permalink
+doc akka#17669 better section header and TOC navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ktoso committed Jul 7, 2015
1 parent 403369a commit 221605c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion akka-docs/_sphinx/themes/akka/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,17 @@
</style>
{%- endif %}
<script type="text/javascript">
$('#toc').toc();
var $toc = $('#toc');
$toc.toc();

// change hash when TOC link clicked:
$toc.find("a").click(function() { window.location.hash = $(this).attr('href'); });

// show clickable section sign when section header hovered:
$('.section h2,.section h3,.section h4,.section h5').each(function(i, el) {
var $el = $(el);
$el.prepend($("<a class='section-marker' href='#" + $el.attr("id") + "'>&sect;</a>"))
});
</script>
{% block footer %}{% endblock %}
{%- endblock %}
Expand Down
4 changes: 4 additions & 0 deletions akka-docs/_sphinx/themes/akka/static/docs.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,7 @@ strong {color: #0B5567; }
.footer h5 { text-transform: none; }

.footnote .label { background-color: transparent }

.section-marker { position: absolute; width: 1em; margin-left: -1em; display: block; text-decoration: none; visibility: hidden; text-align: center; font-weight: normal; }
.section-marker:hover { text-decoration: none; }
.section h2:hover > a,.section h3:hover > a,.section h4:hover > a,.section h5:hover > a { visibility: visible; }

0 comments on commit 221605c

Please sign in to comment.