mirror of
https://github.com/jlengrand/picocli.git
synced 2026-03-10 08:41:17 +00:00
[#1242] DOC: Foldable TOC for User Manual and Quick Guide (adds missing parts)
This commit is contained in:
@@ -16237,5 +16237,39 @@ pre.rouge {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/3.0.7/tocbot.min.js"></script>
|
||||
<script>
|
||||
/* Tocbot dynamic TOC, works with tocbot 3.0.7 */
|
||||
var oldtoc = document.getElementById('toctitle').nextElementSibling;
|
||||
var newtoc = document.createElement('div');
|
||||
newtoc.setAttribute('id', 'tocbot');
|
||||
newtoc.setAttribute('class', 'js-toc');
|
||||
oldtoc.parentNode.replaceChild(newtoc, oldtoc);
|
||||
tocbot.init({ contentSelector: '#content',
|
||||
headingSelector: 'h1, h2, h3, h4',
|
||||
smoothScroll: false,
|
||||
collapseDepth: 3 });
|
||||
var handleTocOnResize = function() {
|
||||
var width = window.innerWidth
|
||||
|| document.documentElement.clientWidth
|
||||
|| document.body.clientWidth;
|
||||
if (width < 768) {
|
||||
tocbot.refresh({ contentSelector: '#content',
|
||||
headingSelector: 'h1, h2, h3, h4',
|
||||
collapseDepth: 6,
|
||||
activeLinkClass: 'ignoreactive',
|
||||
throttleTimeout: 1000,
|
||||
smoothScroll: false });
|
||||
}
|
||||
else {
|
||||
tocbot.refresh({ contentSelector: '#content',
|
||||
headingSelector: 'h1, h2, h3, h4',
|
||||
smoothScroll: false,
|
||||
collapseDepth: 3 });
|
||||
}
|
||||
};
|
||||
window.addEventListener('resize', handleTocOnResize);
|
||||
handleTocOnResize();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3669,5 +3669,39 @@ table.CodeRay td.code{padding:0 0 0 .75em}
|
||||
.CodeRay .change .change{color:#66f}
|
||||
.CodeRay .head .head{color:#f4f}
|
||||
</style>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/3.0.7/tocbot.min.js"></script>
|
||||
<script>
|
||||
/* Tocbot dynamic TOC, works with tocbot 3.0.7 */
|
||||
var oldtoc = document.getElementById('toctitle').nextElementSibling;
|
||||
var newtoc = document.createElement('div');
|
||||
newtoc.setAttribute('id', 'tocbot');
|
||||
newtoc.setAttribute('class', 'js-toc');
|
||||
oldtoc.parentNode.replaceChild(newtoc, oldtoc);
|
||||
tocbot.init({ contentSelector: '#content',
|
||||
headingSelector: 'h1, h2, h3, h4',
|
||||
smoothScroll: false,
|
||||
collapseDepth: 2 });
|
||||
var handleTocOnResize = function() {
|
||||
var width = window.innerWidth
|
||||
|| document.documentElement.clientWidth
|
||||
|| document.body.clientWidth;
|
||||
if (width < 768) {
|
||||
tocbot.refresh({ contentSelector: '#content',
|
||||
headingSelector: 'h1, h2, h3, h4',
|
||||
collapseDepth: 6,
|
||||
activeLinkClass: 'ignoreactive',
|
||||
throttleTimeout: 1000,
|
||||
smoothScroll: false });
|
||||
}
|
||||
else {
|
||||
tocbot.refresh({ contentSelector: '#content',
|
||||
headingSelector: 'h1, h2, h3, h4',
|
||||
smoothScroll: false,
|
||||
collapseDepth: 2 });
|
||||
}
|
||||
};
|
||||
window.addEventListener('resize', handleTocOnResize);
|
||||
handleTocOnResize();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user