diff --git a/build.gradle b/build.gradle index 3e967efed..087a3cdd1 100644 --- a/build.gradle +++ b/build.gradle @@ -27,8 +27,8 @@ buildscript { plugins { id "groovy" - id "de.undercouch.download" version "4.0.4" - id 'com.nwalsh.gradle.saxon.saxon-gradle' version '0.9.3' + id "de.undercouch.download" version "5.3.1" + id 'com.nwalsh.gradle.saxon.saxon-gradle' version '0.10.0' } repositories { @@ -137,6 +137,14 @@ task helloWorld() { // ====================================================================== +task downloadXslTNG(type: Download) { + src "https://github.com/docbook/xslTNG/releases/download/${docbookXsltVersion}/docbook-xslTNG-${docbookXsltVersion}.zip" + dest file("${buildDir}/docbook-xslTNG-${docbookXsltVersion}.zip") + onlyIf { !file("${buildDir}/docbook-xslTNG-${docbookXsltVersion}.zip").exists() } +} + +// ====================================================================== + task gitLogSummary(type: Exec) { inputs.file "${projectDir}/tools/bin/git-log-summary" outputs.file "${buildDir}/gitlog.xml" @@ -306,15 +314,15 @@ books.each { vocab -> } task "${vocab}"(type: SaxonXsltTask, - dependsOn: ["${vocab}_xml", + dependsOn: ["downloadXslTNG", + "${vocab}_xml", "${vocab}_copyresources"]) { - input "${buildDir}/${vocab}/book.xml" - stylesheet "${projectDir}/tools/xsl/book.xsl" - output "${buildDir}/${vocab}/html/index.html" - initializer "org.docbook.xsltng.extensions.Register" - entityResolverClass "org.xmlresolver.Resolver" - sourceParserClass "org.xmlresolver.tools.ResolvingXMLReader" - styleParserClass "org.xmlresolver.tools.ResolvingXMLReader" + input "file://${buildDir}/${vocab}/book.xml" + stylesheet "file://${projectDir}/tools/xsl/book.xsl" + output "file://${buildDir}/${vocab}/html/index.html" + arg '-init:org.docbook.xsltng.extensions.Register' + arg '-u' + arg "-catalog:jar:file:${buildDir}/docbook-xslTNG-${docbookXsltVersion}.zip!/docbook-xslTNG-${docbookXsltVersion}/xslt/catalog.xml" parameters ( 'rngfile': rndFile, 'docbookXsltVersion': docbookXsltVersion, diff --git a/gradle.properties b/gradle.properties index 2a1eae878..456569737 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,28 +1,29 @@ org.gradle.jvmargs=-Xmx16g -Dfile.encoding=UTF-8 -#systemProp.xml.catalog.logging=cache:warn +systemProp.xml.catalog.additions=jar:file:build/docbook-xslTNG-2.0.10.zip!/docbook-xslTNG-2.0.10/xslt/catalog.xml +systemProp.test.this=myuser -docbookXsltVersion=2.0.10 +docbookXsltVersion=2.0.16 -xmlresolverVersion=5.1.0 +xmlresolverVersion=5.2.2 xmlCalabashVersion=1.5.3-110 docbookBaseVersion=5.2 -docbookVersion=5.2CR5 +docbookVersion=5.2CS01 -saxonVersion=11.5 +saxonVersion=12.4 saxonEE=true -defguideBookVersion=5.2.16 +defguideBookVersion=5.2.18 defguideRnd=src/lib/defguide.rnd -publishersBookVersion=1.3.10 +publishersBookVersion=1.3.12 publishersRnd=src/lib/publishers.rnd -sdocbookBookVersion=0.9.7 +sdocbookBookVersion=0.9.9 sdocbookRnd=src/lib/sdocbook.rnd -slidesBookVersion=0.9.7 +slidesBookVersion=0.9.9 slidesRnd=src/lib/slides.rnd -websiteBookVersion=0.9.7 +websiteBookVersion=0.9.9 websiteRnd=src/lib/website.rnd diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f371643ee..a59520664 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/defguide/ch00-online.xml b/src/defguide/ch00-online.xml index 2acbb52cc..4b547ff54 100644 --- a/src/defguide/ch00-online.xml +++ b/src/defguide/ch00-online.xml @@ -11,6 +11,10 @@ DocBook 5: The Definitive Guide. It describes the DocBook V5.2 schema, currently version . +You can get the latest version of the DocBook reference books +and the DocBook sources for them from +. + The current O'Reilly edition covers DocBook V5.0, the OASIS Standard. @@ -524,6 +528,11 @@ that points to it. The arc and locator elements will be dropped; instead link will be allowed in extendedlink. + +The indexterm elements will be removed from primary, +secondary, and tertiary. Nested index terms are not supported. + + diff --git a/src/defguide/ch00.xml b/src/defguide/ch00.xml index 0aefec53d..8583be2a1 100644 --- a/src/defguide/ch00.xml +++ b/src/defguide/ch00.xml @@ -299,55 +299,19 @@ is a complete reference to every element in the DocBook Safari offers a solution that’s better than e-books. It’s a virtual library that lets you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when you - need the most accurate, current information. Try it for free at http://my.safaribooksonline.com. + need the most accurate, current information. Try it for free at + https://safaribooksonline.com/.
How to Contact Us Please address comments and questions concerning this book to the - publisher: - - - O’Reilly Media, Inc. - - 1005 Gravenstein Highway North - - Sebastopol, CA 95472 - - 800-998-9938 (in the United States or Canada) - - 707-829-0515 (international or local) - - 707 829-0104 (fax) - - - We have a web page for this book, where we list errata, examples, - and any additional information. You can access this page at: - - - - - - Don’t forget to update the <url> attribute, too. - - To comment or ask technical questions about this book, send email - to: - - - bookquestions@oreilly.com - - - For more information about our books, conferences, Resource Centers, - and the O’Reilly Network, see our web site at: - - - - + author. If you believe you’ve found an error or ommission, please consider + opening an issue. +
+
Acknowledgments diff --git a/src/refpages/elements/primary.xml b/src/refpages/elements/primary.xml index d87d5c868..d424066a6 100644 --- a/src/refpages/elements/primary.xml +++ b/src/refpages/elements/primary.xml @@ -15,16 +15,24 @@ -DescriptionIn an indexterm, primary - identifies the most significant word or words in the entry. All - indexterms must have a - primary. +Description - Processing expectations - +In an indexterm, primary identifies the +most significant word or words in the entry. All indexterms +must have a primary. + + +In DocBook 5.x, a primary may contain nested +indexterm elements. This is unsupported and will be removed +in DocBook V6.0. + + + +Processing expectations + +Suppressed. This element provides data for processing but it is +not rendered in the primary flow of text. - Suppressed. This element provides data for processing but it is - not rendered in the primary flow of text. diff --git a/src/refpages/elements/secondary.xml b/src/refpages/elements/secondary.xml index 916705695..82f59ff42 100644 --- a/src/refpages/elements/secondary.xml +++ b/src/refpages/elements/secondary.xml @@ -15,23 +15,33 @@ -DescriptionA secondary contains a secondary word or phrase - in an indexterm. The text of a secondary term is less significant than - the primary term, but more significant than the - tertiary term for sorting and - display purposes. - - In indexterms, you can only have one primary, - secondary, and tertiary term. If you want to index multiple secondary - terms for the same primary, you must repeat the primary in another - indexterm. You cannot place several - secondarys in the same primary. - - Processing expectations - - - Suppressed. This element provides data for processing but is not - rendered in the primary flow of text. +Description + +A secondary contains a secondary word or phrase in an +indexterm. The text of a secondary term is less significant than the +primary term, but more significant than the tertiary term for sorting and display +purposes. + +In indexterms, you can only have one primary, +secondary, and tertiary term. If you want to index multiple secondary +terms for the same primary, you must repeat the primary in another +indexterm. You cannot place several +secondarys in the same primary. + + +In DocBook 5.x, a secondary may contain nested +indexterm elements. This is unsupported and will be removed +in DocBook V6.0. + + + +Processing expectations + +Suppressed. This element provides data for processing but is not +rendered in the primary flow of text. + diff --git a/src/refpages/elements/tertiary.xml b/src/refpages/elements/tertiary.xml index 9181b3239..96fc454ad 100644 --- a/src/refpages/elements/tertiary.xml +++ b/src/refpages/elements/tertiary.xml @@ -15,28 +15,36 @@ -DescriptionA tertiary element contains a third-level word - or phrase in an indexterm. The text of a - tertiary term is less significant than the - primary and secondary terms for - sorting and display purposes. - - DocBook does not define any additional levels. You cannot use - indexterms to construct indexes with more than three - levels without extending the schema. - - In indexterms, you can only have one primary, - secondary, and tertiary term. If you want to index multiple tertiary - terms for the same primary and secondary, you must repeat the primary - and secondary in another indexterm. You cannot place - several tertiarys in the same primary. - - Processing expectations - - - Suppressed. This element provides data for processing but is not - rendered in the primary flow of - text. +Description + +A tertiary element contains a third-level word or +phrase in an indexterm. The text of a tertiary +term is less significant than the primary and +secondary terms for sorting and display purposes. + +DocBook does not define any additional levels. You cannot use +indexterms to construct indexes with more than three +levels without extending the schema. + +In indexterms, you can only have one primary, +secondary, and tertiary term. If you want to index multiple tertiary +terms for the same primary and secondary, you must repeat the primary +and secondary in another indexterm. You cannot place +several tertiarys in the same primary. + + +In DocBook 5.x, a primary may contain nested +indexterm elements. This is unsupported and will be removed +in DocBook V6.0. + + + +Processing expectations + +Suppressed. This element provides data for processing but is not +rendered in the primary flow of +text. + diff --git a/src/refpages/examples/procedure.1.xml b/src/refpages/examples/procedure.1.xml index 40bce2f02..a5794bfa2 100644 --- a/src/refpages/examples/procedure.1.xml +++ b/src/refpages/examples/procedure.1.xml @@ -3,22 +3,18 @@ An Example Procedure - A Step - + A Step - Another Step - + Another Step - Substeps can be nested indefinitely deep. - + Substeps can be nested indefinitely deep. - A Final Step - + A Final Step diff --git a/src/resources/css/defguide.css b/src/resources/css/defguide.css index 1492e4757..55d1d202a 100644 --- a/src/resources/css/defguide.css +++ b/src/resources/css/defguide.css @@ -146,6 +146,10 @@ li .sincerev { line-height: 1.25em; } +.pagetoc .sincerev { + display: none; +} + /* ============================================================ */ .cmjs { @@ -269,6 +273,25 @@ nav .title { background-color: inherit; } +html.js .pagetoc { + font-family: var(--title-family), sans-serif; +} + +html.js .pagebody .tocwrapper { + font-size: 80%; + overflow: scroll; + margin-bottom: 6rem; +} + +html.js .pagebody .pagetoc .ctrl { + top: 2rem; +} + +.pagetoc a, +.pagetoc a:visited { + color: black; +} + .infofooter { padding-top: 0.5rem; font-size: 14px; diff --git a/src/resources/js/refentry.js b/src/resources/js/refentry.js index f3468c4ca..f157fb1b8 100644 --- a/src/resources/js/refentry.js +++ b/src/resources/js/refentry.js @@ -1,164 +1,77 @@ -hideAll(); - -document.querySelectorAll(".cmshow").forEach(function (span) { - span.innerHTML = " ⏵"; - span.onclick = function() { - show(span.getAttribute("db-ref")); - }; -}); - -document.querySelectorAll(".cmhide").forEach(function (span) { - span.innerHTML = " ⏷"; - span.onclick = function() { - hide(span.getAttribute("db-ref")); - }; -}); - -let showAllWidget = document.querySelector(".cmshowall"); -let hideAllWidget = document.querySelector(".cmhideall"); -let deleteWidget = document.querySelector(".cmdelete"); - -if (showAllWidget && hideAllWidget && deleteWidget) { - showAllWidget.style.display = "inline"; - showAllWidget.innerHTML = " ⏵"; - showAllWidget.onclick = function() { - showAllWidget.style.display = "none"; - hideAllWidget.style.display = "inline"; - showAll(); - }; - - hideAllWidget.style.display = "none"; - hideAllWidget.innerHTML = " ⏷"; - hideAllWidget.onclick = function() { - showAllWidget.style.display = "inline"; - hideAllWidget.style.display = "none"; - hideAll(); - }; - - deleteWidget.innerHTML = " ×"; - deleteWidget.onclick = function() { - deleteWidget.style.display = "none"; - deleteAll(); - }; -} - -const pdiv = document.querySelector(".cmparents"); -if (pdiv) { - let html = "
Parents
×
    "; - let atleastone = false; - document.querySelectorAll(".refsection").forEach(function (div) { - const h3 = div.querySelector("header h3"); - if (h3 && h3.innerHTML === "Parents") { - const list = div.querySelector(".simplelist"); - list.querySelectorAll(".tag-element").forEach(function (code) { - if (code.parentNode.tagName === "A") { - const anchor = code.parentNode; - const next = anchor.nextElementSibling; - atleastone = true; - html += "
  • "; - html += code.innerHTML + ""; - if (next) { - html += " " + next.innerHTML; - } - html += "
  • "; - } - }); +(function() { + const toggleElementList = function(div, singularMsg, pluralMsg) { + const p = div.querySelector("p"); + const spans = p.querySelectorAll(":scope code.tag"); + const newP = document.createElement("p"); + const period = document.createTextNode("."); + const pcount = spans.length -1; + const del = document.createElement("span"); + const show = document.createElement("span"); + const hide = document.createElement("span"); + + const thisElem = spans[0].cloneNode(true); + + newP.innerHTML = pcount + " element"; + if (pcount > 1) { + newP.innerHTML += "s " + pluralMsg + " "; + } else { + newP.innerHTML += " " + singularMsg + " "; } - }); - html += "
"; - if (atleastone) { - pdiv.classList.add("cmsidebar"); - pdiv.innerHTML = html; - } - let div = pdiv.querySelector(".cmx"); - div.onclick = function() { - pdiv.style.display = "none"; - }; -} - -document.querySelectorAll("div.refsection").forEach(function (div) { - const h3 = div.querySelector("h3"); - if (h3 && h3.innerHTML == "Parents") { - toggleElementList(div, 'contains', 'contain'); - } - if (h3 && h3.innerHTML == "Children") { - toggleElementList(div, 'occurs in', 'occur in'); - } -}); - -function toggleElementList(div, singularMsg, pluralMsg) { - const p = div.querySelector("p"); - const spans = p.querySelectorAll(":scope code.tag"); - const newP = document.createElement("p"); - const period = document.createTextNode("."); - const pcount = spans.length -1; - const del = document.createElement("span"); - const show = document.createElement("span"); - const hide = document.createElement("span"); - - const thisElem = spans[0].cloneNode(true); - - newP.innerHTML = pcount + " element"; - if (pcount > 1) { - newP.innerHTML += "s " + pluralMsg + " "; - } else { - newP.innerHTML += " " + singularMsg + " "; - } - del.setAttribute("class", "cmjs cmdelete"); - del.innerHTML = " ×"; - del.onclick = function () { - p.style.display = "block"; - newP.style.display = "none"; - }; - - show.setAttribute("class", "cmjs"); - show.innerHTML = " ⏵"; - show.onclick = function () { - p.style.display = "block"; - show.style.display = "none"; - hide.style.display = "inline"; - }; - - hide.style.display = "none"; - hide.setAttribute("class", "cmjs"); - hide.innerHTML = " ⏷"; - hide.onclick = function () { - p.style.display = "none"; - show.style.display = "inline"; - hide.style.display = "none"; - }; - - newP.appendChild(thisElem); - newP.appendChild(period); - newP.appendChild(del); - newP.appendChild(show); - newP.appendChild(hide); + del.setAttribute("class", "cmjs cmdelete"); + del.innerHTML = " ×"; + del.onclick = function () { + p.style.display = "block"; + newP.style.display = "none"; + }; + + show.setAttribute("class", "cmjs"); + show.innerHTML = " ⏵"; + show.onclick = function () { + p.style.display = "block"; + show.style.display = "none"; + hide.style.display = "inline"; + }; - div.insertBefore(newP, p); + hide.style.display = "none"; + hide.setAttribute("class", "cmjs"); + hide.innerHTML = " ⏷"; + hide.onclick = function () { + p.style.display = "none"; + show.style.display = "inline"; + hide.style.display = "none"; + }; + + newP.appendChild(thisElem); + newP.appendChild(period); + newP.appendChild(del); + newP.appendChild(show); + newP.appendChild(hide); + + div.insertBefore(newP, p); - p.style.display = "none"; -} + p.style.display = "none"; + } -function hideAll() { - document.querySelectorAll("div.refsynopsisdiv").forEach(function (div) { - div.querySelectorAll(".patnlist").forEach(function (patn) { - const id = patn.id.substring(2); - hide(id); + const hideAll = function() { + document.querySelectorAll(".refsynopsisdiv").forEach(function (div) { + div.querySelectorAll(".patnlist").forEach(function (patn) { + const id = patn.id.substring(2); + hide(id); + }); }); - }); -} + } -function showAll() { - document.querySelectorAll("div.refsynopsisdiv").forEach(function (div) { - div.querySelectorAll(".patnlist").forEach(function (patn) { - const id = patn.id.substring(2); - show(id); + const showAll = function() { + document.querySelectorAll(".refsynopsisdiv").forEach(function (div) { + div.querySelectorAll(".patnlist").forEach(function (patn) { + const id = patn.id.substring(2); + show(id); + }); }); - }); -} + } -function hide(id) { + const hide = function(id) { var list = document.getElementById("l." + id); list.style.display = 'none'; @@ -167,9 +80,9 @@ function hide(id) { var minus = document.getElementById("plh." + id); minus.style.display = 'none'; -} + } -function show(id) { + const show = function(id) { var list = document.getElementById("l." + id); list.style.display = 'block'; @@ -178,114 +91,203 @@ function show(id) { var minus = document.getElementById("plh." + id); minus.style.display = 'inline'; -} + } -function deleteAll() { - const dli = []; - document.querySelectorAll("div.patnlist").forEach(function (div) { - dli.push(div.parentNode); - unwrapItem(div); - }); + const deleteAll = function() { + const dli = []; + document.querySelectorAll(".patnlist").forEach(function (div) { + dli.push(div.parentNode); + unwrapItem(div); + }); - const ul = dli[0].parentNode; - dli.forEach(function (item) { - ul.removeChild(item); - }); + const ul = dli[0].parentNode; + dli.forEach(function (item) { + ul.removeChild(item); + }); - const sli = []; - ul.querySelectorAll("li").forEach(function (li) { - sli.push(li); - }); - sli.sort(sortText); - - // Get rid of duplicates - const nsli = []; - const dups = []; - nsli[0] = sli[0]; - let pos = 1; - let dpos = 0; - for (i = 1; i < sli.length; i++) { - if (sameAs(sli[i-1],sli[i])) { - dups[dpos] = sli[i]; - dpos++; + const sli = []; + ul.querySelectorAll("li").forEach(function (li) { + sli.push(li); + }); + sli.sort(sortText); + + // Get rid of duplicates + const nsli = []; + const dups = []; + nsli[0] = sli[0]; + let pos = 1; + let dpos = 0; + for (i = 1; i < sli.length; i++) { + if (sameAs(sli[i-1],sli[i])) { + dups[dpos] = sli[i]; + dpos++; + } else { + nsli[pos] = sli[i]; + pos++; + } + } + + // Delete the dups... + dups.forEach(function (item) { + ul.removeChild(item); + }); + + // Move them into sorted order... + nsli.forEach(function (item) { + ul.appendChild(item); + }); + + const widgets = []; + document.querySelectorAll(".cmshow").forEach(function (widget) { + widgets.push(widget); + }); + document.querySelectorAll(".cmhide").forEach(function (widget) { + widgets.push(widget); + }); + document.querySelectorAll(".cmshowall").forEach(function (widget) { + widgets.push(widget); + }); + document.querySelectorAll(".cmhideall").forEach(function (widget) { + widgets.push(widget); + }); + widgets.forEach(function (widget) { + const p = widget.parentNode; + p.removeChild(widget); + }); + } + + const unwrapItem = function(listdiv) { + const li = listdiv.parentNode; + const ul = li.parentNode; + const lis = listdiv.getElementsByTagName("li"); + + // why does this insertBefore change the lis array? + while (lis.length > 0) { + ul.insertBefore(lis[0],li); + } + } + + const sortText = function(a,b) { + if (stringValue(a) < stringValue(b)) { + return -1; } else { - nsli[pos] = sli[i]; - pos++; + return 1; } } - // Delete the dups... - dups.forEach(function (item) { - ul.removeChild(item); - }); + const sameAs = function(a,b) { + return stringValue(a) == stringValue(b); + } - // Move them into sorted order... - nsli.forEach(function (item) { - ul.appendChild(item); - }); + const stringValue = function(a) { + let s = ""; + let c = a.firstChild; + let e = false; + + while (c != null) { + if (c.nodeType === Node.ELEMENT_NODE) { + e = e || c.nodeName === 'CODE'; + s = s + stringValue(c); + } else if (c.nodeType === Node.TEXT_NODE) { + s = s + c.data; + } + c = c.nextSibling; + } - const widgets = []; - document.querySelectorAll(".cmshow").forEach(function (widget) { - widgets.push(widget); - }); - document.querySelectorAll(".cmhide").forEach(function (widget) { - widgets.push(widget); - }); - document.querySelectorAll(".cmshowall").forEach(function (widget) { - widgets.push(widget); - }); - document.querySelectorAll(".cmhideall").forEach(function (widget) { - widgets.push(widget); + // This makes "text" => "a text" and "alt" = "e alt" which forces + // text to sort first... + if (e) { + return "e " + s; + } else { + return "a " + s; + } + } + + hideAll(); + + document.querySelectorAll(".cmshow").forEach(function (span) { + show(span.getAttribute("db-ref")); + span.innerHTML = " ⏵"; + span.onclick = function() { + show(span.getAttribute("db-ref")); + }; }); - widgets.forEach(function (widget) { - const p = widget.parentNode; - p.removeChild(widget); + + document.querySelectorAll(".cmhide").forEach(function (span) { + hide(span.getAttribute("db-ref")); + span.innerHTML = " ⏷"; + span.onclick = function() { + hide(span.getAttribute("db-ref")); + }; }); -} -function unwrapItem(listdiv) { - const li = listdiv.parentNode; - const ul = li.parentNode; - const lis = listdiv.getElementsByTagName("li"); + let showAllWidget = document.querySelector(".cmshowall"); + let hideAllWidget = document.querySelector(".cmhideall"); + let deleteWidget = document.querySelector(".cmdelete"); - // why does this insertBefore change the lis array? - while (lis.length > 0) { - ul.insertBefore(lis[0],li); - } -} + if (showAllWidget && hideAllWidget && deleteWidget) { + showAllWidget.style.display = "inline"; + showAllWidget.innerHTML = " ⏵"; + showAllWidget.onclick = function() { + showAllWidget.style.display = "none"; + hideAllWidget.style.display = "inline"; + showAll(); + }; -function sortText(a,b) { - if (stringValue(a) < stringValue(b)) { - return -1; - } else { - return 1; + hideAllWidget.style.display = "none"; + hideAllWidget.innerHTML = " ⏷"; + hideAllWidget.onclick = function() { + showAllWidget.style.display = "inline"; + hideAllWidget.style.display = "none"; + hideAll(); + }; + + deleteWidget.innerHTML = " ×"; + deleteWidget.onclick = function() { + deleteWidget.style.display = "none"; + showAllWidget.style.display = "none"; + hideAllWidget.style.display = "none"; + deleteAll(); + }; } -} - -function sameAs(a,b) { - return stringValue(a) == stringValue(b); -} - -function stringValue(a) { - let s = ""; - let c = a.firstChild; - let e = false; - - while (c != null) { - if (c.nodeType === Node.ELEMENT_NODE) { - e = e || c.nodeName === 'CODE'; - s = s + stringValue(c); - } else if (c.nodeType === Node.TEXT_NODE) { - s = s + c.data; + + const pdiv = document.querySelector(".cmparents"); + if (pdiv) { + let html = "
Parents
×
    "; + let atleastone = false; + document.querySelectorAll(".refsection").forEach(function (div) { + const h3 = div.querySelector("header h3"); + if (h3 && h3.innerHTML === "Parents") { + const list = div.querySelector(".simplelist"); + list.querySelectorAll(".tag-element").forEach(function (code) { + if (code.parentNode.tagName === "A") { + const anchor = code.parentNode; + const next = anchor.nextElementSibling; + atleastone = true; + html += "
  • "; + html += code.innerHTML + ""; + if (next) { + html += " " + next.innerHTML; + } + html += "
  • "; + } + }); + } + }); + html += "
"; + if (atleastone) { + pdiv.classList.add("cmsidebar"); + pdiv.innerHTML = html; } - c = c.nextSibling; } - // This makes "text" => "a text" and "alt" = "e alt" which forces - // text to sort first... - if (e) { - return "e " + s; - } else { - return "a " + s; - } -} + document.querySelectorAll(".refsection").forEach(function (div) { + const h3 = div.querySelector("h3"); + if (h3 && h3.innerHTML == "Parents") { + toggleElementList(div, 'contains', 'contain'); + } + if (h3 && h3.innerHTML == "Children") { + toggleElementList(div, 'occurs in', 'occur in'); + } + }); +})(); diff --git a/tools/xsl/book.xsl b/tools/xsl/book.xsl index bb80d8f8e..645a0ef82 100644 --- a/tools/xsl/book.xsl +++ b/tools/xsl/book.xsl @@ -48,6 +48,8 @@ + + @@ -60,7 +62,6 @@ -