mirror of
https://github.com/boostorg/boostlook.git
synced 2026-01-19 04:02:14 +00:00
refactor: comment out TOC toggle functionality
This commit is contained in:
committed by
Julio C. Estrada
parent
9bb732f91b
commit
1b0f191b58
11
boostlook.rb
11
boostlook.rb
@@ -3,13 +3,21 @@ 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>')
|
||||||
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>')
|
# 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="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');
|
||||||
@@ -56,6 +64,7 @@ Asciidoctor::Extensions.register do
|
|||||||
|
|
||||||
updateTocVisibility(isPinned);
|
updateTocVisibility(isPinned);
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
SCRIPT
|
SCRIPT
|
||||||
|
|||||||
Reference in New Issue
Block a user