+doc #17669 better section header and TOC navigation
This commit is contained in:
parent
0e76437bf7
commit
7fecf8273c
2 changed files with 16 additions and 1 deletions
|
|
@ -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") + "'>§</a>"))
|
||||
});
|
||||
</script>
|
||||
{% block footer %}{% endblock %}
|
||||
{%- endblock %}
|
||||
|
|
|
|||
|
|
@ -173,3 +173,8 @@ strong {color: #0B5567; }
|
|||
.pre { padding: 1px 2px; color: #0B5567; background-color: #EFF2F5; border: 1px solid #dee1e2; font-family: Menlo, Monaco, "Courier New", monospace; font-size: 12px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }
|
||||
.footer h5 { text-transform: none; }
|
||||
|
||||
|
||||
.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; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue