Update document appearance

Use Spring's standard styles for the ToC. Also added epub generation.
This commit is contained in:
Jay Bryant
2021-12-18 09:28:38 +00:00
committed by Janne Valkealahti
parent 7473c9ec5c
commit 012481ef63
4 changed files with 94 additions and 91 deletions

View File

@@ -8,12 +8,14 @@
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.directory}/site/reference/html</directory>
<directory>${project.build.directory}/generated-docs</directory>
<outputDirectory>site/reference/htmlsingle</outputDirectory>
<includes>
<include>index.html</include>
<include>**/*</include>
</includes>
<excludes>
<exclude>index.epub</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/site/reference/pdf</directory>
@@ -22,6 +24,13 @@
<include>index.pdf</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/generated-docs</directory>
<outputDirectory>site/reference/epub</outputDirectory>
<includes>
<include>index.epub</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.build.directory}/apidocs</directory>
<outputDirectory>api</outputDirectory>

View File

@@ -1,74 +0,0 @@
<!-- Generate a nice TOC -->
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tocify/1.9.0/javascripts/jquery.tocify.min.js"></script>
<!-- We do not need the tocify CSS because the asciidoc CSS already provides most of what we neeed -->
<style>
.tocify-header {
font-style: italic;
}
.tocify-subheader {
font-style: normal;
}
.tocify ul {
margin: 0;
}
.tocify-focus {
color: #7a2518;
background-color: rgba(0, 0, 0, 0.1);
}
.tocify-focus > a {
color: #7a2518;
}
</style>
<script type="text/javascript">
$(function () {
// Add a new container for the tocify toc into the existing toc so we can re-use its
// styling
$("#toc").append("<div id='generated-toc'></div>");
$("#generated-toc").tocify({
extendPage: false,
context: "#content",
highlightOnScroll: false,
hideEffect: "slideUp",
// Use the IDs that asciidoc already provides so that TOC links and intra-document
// links are the same. Anything else might confuse users when they create bookmarks.
hashGenerator: function(text, element) {
return $(element).attr("id");
},
// Smooth scrolling doesn't work properly if we use the asciidoc IDs
smoothScroll: false,
// Set to 'none' to use the tocify classes
theme: "none",
// Handle book (may contain h1) and article (only h2 deeper)
selectors: $( "#content" ).has( "h1" ).size() > 0 ? "h1,h2,h3,h4,h5" : "h2,h3,h4,h5",
ignoreSelector: ".discrete"
});
// Switch between static asciidoc toc and dynamic tocify toc based on browser size
// This is set to match the media selectors in the asciidoc CSS
// Without this, we keep the dynamic toc even if it is moved from the side to preamble
// position which will cause odd scrolling behavior
var handleTocOnResize = function() {
if ($(document).width() < 768) {
$("#generated-toc").hide();
$(".sectlevel0").show();
$(".sectlevel1").show();
}
else {
$("#generated-toc").show();
$(".sectlevel0").hide();
$(".sectlevel1").hide();
}
}
$(window).resize(handleTocOnResize);
handleTocOnResize();
});
</script>

View File

@@ -8,14 +8,7 @@ Eric Bottard;
ifdef::backend-html5[]
*{projectVersion}*
NOTE: This documentation is also available as https://docs.spring.io/spring-shell/docs/{projectVersion}/reference/pdf/index.pdf[PDF].
endif::[]
ifdef::backend-pdf[]
NOTE: This documentation is also available as https://docs.spring.io/spring-shell/docs/{projectVersion}/reference/htmlsingle/index.html[HTML].
endif::[]
(C) 2017 - 2020 Pivotal Software, Inc.
(C) 2017 - 2021 VMware, Inc.
_Copies of this document may be made for your own use and for distribution to
others, provided that you do not charge any fee for such copies and further