mirror of
https://github.com/boostorg/boostlook.git
synced 2026-01-19 04:02:14 +00:00
Revert "refactor: always show TOC, remove toggle functionality"
This reverts commit d9059ad133.
This commit is contained in:
11
boostlook.rb
11
boostlook.rb
@@ -3,21 +3,13 @@ Asciidoctor::Extensions.register do
|
|||||||
process do |doc, output|
|
process do |doc, output|
|
||||||
output = output.sub(/(<body[^>]*>)/, '\1<div class="boostlook">')
|
output = output.sub(/(<body[^>]*>)/, '\1<div class="boostlook">')
|
||||||
output = output.sub('</body>', '</div></body>')
|
output = output.sub('</body>', '</div></body>')
|
||||||
# Comment out toggle button - TOC should always be visible
|
output = output.sub(/(<body.*?<div[^>]*id="toc"[^>]*>)/m, '\1<button id="toggle-toc" title="Show Table of Contents" aria-expanded="false" aria-controls="toc">☰</button>')
|
||||||
# output = output.sub(/(<body.*?<div[^>]*id="toc"[^>]*>)/m, '\1<button id="toggle-toc" title="Show Table of Contents" aria-expanded="false" aria-controls="toc">☰</button>')
|
|
||||||
output = output.sub(/(<body.*?<div[^>]*id="footer"[^>]*>)/m, '</div>\1')
|
output = output.sub(/(<body.*?<div[^>]*id="footer"[^>]*>)/m, '</div>\1')
|
||||||
|
|
||||||
script_tag = <<~SCRIPT
|
script_tag = <<~SCRIPT
|
||||||
<script>
|
<script>
|
||||||
(function() {
|
(function() {
|
||||||
const html = document.documentElement;
|
const html = document.documentElement;
|
||||||
// Always show TOC - no toggle functionality needed
|
|
||||||
html.classList.add('toc-visible');
|
|
||||||
html.classList.add('toc-pinned');
|
|
||||||
html.classList.remove('toc-hidden');
|
|
||||||
|
|
||||||
// Comment out toggle functionality since TOC should always be visible
|
|
||||||
/*
|
|
||||||
const isPinned = localStorage.getItem('tocPinned') === 'true';
|
const isPinned = localStorage.getItem('tocPinned') === 'true';
|
||||||
|
|
||||||
html.classList.add('toc-hidden');
|
html.classList.add('toc-hidden');
|
||||||
@@ -64,7 +56,6 @@ Asciidoctor::Extensions.register do
|
|||||||
|
|
||||||
updateTocVisibility(isPinned);
|
updateTocVisibility(isPinned);
|
||||||
});
|
});
|
||||||
*/
|
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
SCRIPT
|
SCRIPT
|
||||||
|
|||||||
Submodule doc/antora_specimen/content deleted from d1fceb5897
Reference in New Issue
Block a user