add sphinx-like links to headings with ids
This commit is contained in:
Родитель
aef8aca32d
Коммит
cff8b1f412
|
@ -16,6 +16,7 @@
|
|||
|
||||
{% block js %}
|
||||
<script src="{{ media('js/zamboni/tabs.js') }}"></script>
|
||||
<script src="{{ media('js/zamboni/admin.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block navbar %}
|
||||
|
|
|
@ -126,3 +126,21 @@ div.popup input[type="text"] {
|
|||
width: 0%;
|
||||
height: 13px;
|
||||
}
|
||||
|
||||
a.headerlink {
|
||||
color: #ccc;
|
||||
font-size: 1.1em;
|
||||
margin-left: 6px;
|
||||
padding: 0 4px 0 4px;
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
visibility: hidden;
|
||||
font-style: none;
|
||||
}
|
||||
a.headerlink:hover {
|
||||
color: #c60f0f;
|
||||
border: none;
|
||||
}
|
||||
:-moz-any(h1,h2,h3,h4,h5,h6):hover a.headerlink {
|
||||
visibility: visible;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
(function(){
|
||||
"use strict";
|
||||
|
||||
// Add sphinx-like links to headings with ids.
|
||||
$(function(){
|
||||
var html = '<a class="headerlink" href="#{0}">¶</a>';
|
||||
$(':-moz-any(h1,h2,h3,h4,h5,h6)[id]').each(function() {
|
||||
console.log(format(html, $(this).attr('id')));
|
||||
$(this).append(format(html, $(this).attr('id')));
|
||||
});
|
||||
});
|
||||
})()
|
Загрузка…
Ссылка в новой задаче