diff --git a/boostlook.css b/boostlook.css index f8bae66..ee0ecdb 100644 --- a/boostlook.css +++ b/boostlook.css @@ -542,10 +542,14 @@ p, h1, h2, h3, h4, h5, h6 { overflow-y: auto; } - .boostlook:not(#libraryReadMe) { + .boostlook { margin-left: 18rem; } + .boostlook#libraryReadMe { + margin-left: 0; + } + .boostlook #toggle-toc { position: fixed; top: 2rem; @@ -585,8 +589,6 @@ p, h1, h2, h3, h4, h5, h6 { } html.toc-hidden .boostlook #toc.toc2 { - width: 0; - opacity: 0; visibility: hidden; } diff --git a/boostlook.rb b/boostlook.rb index 21e2b57..93211cc 100644 --- a/boostlook.rb +++ b/boostlook.rb @@ -1,74 +1,66 @@ Asciidoctor::Extensions.register do postprocessor do process do |doc, output| - output = output.sub(//, '
') - output = output.sub(/<\/body>/, "
") - output = output.sub(/(
)/, '\\1') - - output = output.sub(/(\\1') - - inline_script = <<~SCRIPT - - SCRIPT - output = output.sub(/<\/head>/, "#{inline_script}") + output = output.sub(/(]*>)/, '\1
') + output = output.sub('', '
') + output = output.sub(/(]*id="toc"[^>]*>)/m, '\1') + output = output.sub(/(]*id="footer"[^>]*>)/m, '
\1') script_tag = <<~SCRIPT SCRIPT - output = output.sub(/<\/body>/, "#{script_tag}") + + output = output.sub('', "#{script_tag}") output end