Use Tocbot for Table of Contents
This commit is contained in:
@@ -83,6 +83,11 @@ asciidoctor {
|
||||
sources {
|
||||
include '*.adoc'
|
||||
}
|
||||
resources {
|
||||
from(sourceDir) {
|
||||
include 'images/**', 'tocbot-3.0.2/**'
|
||||
}
|
||||
}
|
||||
logDocuments = true
|
||||
backends = ["html5"]
|
||||
// only ouput PDF documentation for non-SNAPSHOT builds
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
:doc-root: https://docs.spring.io
|
||||
:api-spring-framework: {doc-root}/spring-framework/docs/{spring-version}/javadoc-api/org/springframework
|
||||
:toc: left
|
||||
:toclevels: 2
|
||||
:toclevels: 4
|
||||
:docinfo1:
|
||||
|
||||
This part of the reference documentation covers all of those technologies that are
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
:doc-root: https://docs.spring.io
|
||||
:api-spring-framework: {doc-root}/spring-framework/docs/{spring-version}/javadoc-api/org/springframework
|
||||
:toc: left
|
||||
:toclevels: 2
|
||||
:toclevels: 4
|
||||
:docinfo1:
|
||||
|
||||
This part of the reference documentation is concerned with data access and the
|
||||
|
||||
@@ -1,10 +1,46 @@
|
||||
<script src="tocbot-3.0.2/tocbot.js"></script>
|
||||
<script>
|
||||
var rootLink = document.createElement("a");
|
||||
rootLink.setAttribute("href", "index.html");
|
||||
rootLink.innerHTML = "<i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i> Back to index";
|
||||
|
||||
// Tocbot dynamic TOC, works with tocbot 3.0.2
|
||||
// Source: https://github.com/asciidoctor/asciidoctor/issues/699#issuecomment-321066006
|
||||
|
||||
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, h5',
|
||||
smoothScroll: false });
|
||||
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, h5',
|
||||
collapseDepth: 6,
|
||||
activeLinkClass: 'ignoreactive',
|
||||
throttleTimeout: 1000,
|
||||
smoothScroll: false });
|
||||
}
|
||||
else {
|
||||
tocbot.refresh({ contentSelector: '#content',
|
||||
headingSelector: 'h1, h2, h3, h4, h5',
|
||||
smoothScroll: false });
|
||||
}
|
||||
};
|
||||
window.addEventListener('resize', handleTocOnResize);
|
||||
handleTocOnResize();
|
||||
|
||||
|
||||
var link = document.createElement("a");
|
||||
link.setAttribute("href", "index.html");
|
||||
link.innerHTML = "<i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i> Back to index";
|
||||
var p = document.createElement("p");
|
||||
p.appendChild(rootLink);
|
||||
p.appendChild(link);
|
||||
var toc = document.getElementById('toc')
|
||||
var sectlevel1 = toc.getElementsByClassName("sectlevel1")[0]
|
||||
toc.insertBefore(p, sectlevel1);
|
||||
var next = document.getElementById('toctitle').nextElementSibling;
|
||||
toc.insertBefore(p, next);
|
||||
|
||||
</script>
|
||||
@@ -5,7 +5,7 @@
|
||||
:doc-spring-amqp: {doc-root}/spring-amqp/docs/current/reference
|
||||
:doc-spring-gemfire: {doc-root}/spring-gemfire/docs/current/reference
|
||||
:toc: left
|
||||
:toclevels: 2
|
||||
:toclevels: 4
|
||||
:docinfo1:
|
||||
|
||||
This part of the reference documentation covers the Spring Framework's integration with
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
:doc-root: https://docs.spring.io
|
||||
:api-spring-framework: {doc-root}/spring-framework/docs/{spring-version}/javadoc-api/org/springframework
|
||||
:toc: left
|
||||
:toclevels: 2
|
||||
:toclevels: 4
|
||||
:docinfo1:
|
||||
|
||||
[[introduction]]
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
@import url(https://fonts.googleapis.com/css?family=Varela+Round|Montserrat:400,700);
|
||||
@import url('../tocbot-3.0.2/tocbot.css');
|
||||
|
||||
/* See https://github.com/asciidoctor/asciidoctor/issues/699#issuecomment-321066006 */
|
||||
/* ================================================================================ */
|
||||
#tocbot a.toc-link.node-name--H1{ font-style: italic }
|
||||
@media screen{
|
||||
#tocbot > ul.toc-list{ margin-bottom: 0.5em; margin-left: 0.125em }
|
||||
#tocbot ul.sectlevel0, #tocbot a.toc-link.node-name--H1 + ul{
|
||||
padding-left: 0 }
|
||||
#tocbot a.toc-link{ height:100% }
|
||||
.is-collapsible{ max-height:3000px; overflow:hidden; }
|
||||
.is-collapsed{ max-height:0 }
|
||||
.is-active-link{ font-weight:700 }
|
||||
}
|
||||
@media print{
|
||||
#tocbot a.toc-link.node-name--H4{ display:none }
|
||||
}
|
||||
/* ================================================================================ */
|
||||
|
||||
/*! normalize.css v2.1.2 | MIT License | git.io/normalize */
|
||||
/* ========================================================================== HTML5 display definitions ========================================================================== */
|
||||
/** Correct `block` display not defined in IE 8/9. */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
:api-spring-framework: {doc-root}/spring-framework/docs/{spring-version}/javadoc-api/org/springframework
|
||||
:doc-spring-boot: {doc-root}/spring-boot/docs/current/reference
|
||||
:toc: left
|
||||
:toclevels: 2
|
||||
:toclevels: 4
|
||||
:docinfo1:
|
||||
|
||||
The adoption of the test-driven-development (TDD) approach to software
|
||||
|
||||
1
src/docs/asciidoc/tocbot-3.0.2/styles.css
Normal file
1
src/docs/asciidoc/tocbot-3.0.2/styles.css
Normal file
@@ -0,0 +1 @@
|
||||
.transition--300{transition:all 300ms ease-in-out}.toc{height:100%;width:280px;transform:translateX(0)}.content h1:first-child,.content h2:first-child{padding-top:0;margin-top:0}.title{font-size:3em}.content{margin-bottom:95vh}.content ul,.content ol{list-style:inherit}.content a{color:#0977c3;text-decoration:none;border-bottom:1px solid #EEE;transition:all 300ms ease}.content a.no-decoration{border-bottom:0}.content a:hover{border-bottom:1px solid #0977c3}.content a:hover.no-decoration{border-bottom:0}a.toc-link{text-decoration:none}.try-it-container{transform:translateY(84%)}.try-it-container.is-open{transform:translateY(0%)}.page-content{display:block !important}.hljs{display:block;background:white;padding:0.5em;color:#333333;overflow-x:auto}.hljs-comment,.hljs-meta{color:#969896}.hljs-string,.hljs-variable,.hljs-template-variable,.hljs-strong,.hljs-emphasis,.hljs-quote{color:#df5000}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#a71d5d}.hljs-literal,.hljs-symbol,.hljs-bullet,.hljs-attribute{color:#0086b3}.hljs-section,.hljs-name{color:#63a35c}.hljs-tag{color:#333333}.hljs-title,.hljs-attr,.hljs-selector-id,.hljs-selector-class,.hljs-selector-attr,.hljs-selector-pseudo{color:#795da3}.hljs-addition{color:#55a532;background-color:#eaffea}.hljs-deletion{color:#bd2c00;background-color:#ffecec}.hljs-link{text-decoration:underline}.toc-icon{position:fixed;top:0;right:0}#toc:checked ~ .toc{box-shadow:0 0 5px #c8c8c8;transform:translateX(0)}.toc{background-color:rgba(255,255,255,0.9);transform:translateX(-100%)}.toc.toc-right{transform:translateX(100%);right:0}@media (min-width: 52em){.toc{transform:translateX(0)}.toc.toc-right{transform:translateX(0);right:calc((100% - 48rem - 4rem) / 2)}.toc-icon{display:none}.try-it-container{display:block}.content{margin-left:280px}.toc-right ~ .content{margin-left:0;margin-right:280px}}*{box-sizing:border-box}body{font-size:1.2rem;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif}h1,h2,h3,h4,h5,h6{padding-top:0.5em}p{margin-top:0.25rem}pre{display:block;background:#f7f7f7;border-radius:2px;border:1px solid #e0e0e0;padding:2px;line-height:1.2;margin-bottom:10px;overflow:auto;white-space:pre-wrap}code{display:inline;font-size:.8em;max-width:100%}
|
||||
1
src/docs/asciidoc/tocbot-3.0.2/tocbot.css
Normal file
1
src/docs/asciidoc/tocbot-3.0.2/tocbot.css
Normal file
@@ -0,0 +1 @@
|
||||
.toc{overflow-y:auto}.toc>ul{overflow:hidden;position:relative}.toc>ul li{list-style:none}.toc-list{margin:0;padding-left:10px}a.toc-link{color:currentColor;height:100%}.is-collapsible{max-height:1000px;overflow:hidden;transition:all 300ms ease-in-out}.is-collapsed{max-height:0}.is-position-fixed{position:fixed !important;top:0}.is-active-link{font-weight:700}.toc-link::before{background-color:#EEE;content:' ';display:inline-block;height:inherit;left:0;margin-top:-1px;position:absolute;width:2px}.is-active-link::before{background-color:#54BC4B}
|
||||
136
src/docs/asciidoc/tocbot-3.0.2/tocbot.js
Normal file
136
src/docs/asciidoc/tocbot-3.0.2/tocbot.js
Normal file
File diff suppressed because one or more lines are too long
1
src/docs/asciidoc/tocbot-3.0.2/tocbot.min.js
vendored
Normal file
1
src/docs/asciidoc/tocbot-3.0.2/tocbot.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -3,7 +3,7 @@
|
||||
:doc-root: https://docs.spring.io
|
||||
:api-spring-framework: {doc-root}/spring-framework/docs/{spring-version}/javadoc-api/org/springframework
|
||||
:toc: left
|
||||
:toclevels: 2
|
||||
:toclevels: 4
|
||||
:docinfo1:
|
||||
|
||||
This part of the documentation covers support for Servlet stack, web applications built on the
|
||||
|
||||
Reference in New Issue
Block a user