Closed ViToni closed 9 months ago
Checking the HTML output from auto
against macro
/ preamble
the difference seems to be:
with macro
/ preamble
the toc
div
is within the content
div
<body class="article">
<div id="header">
<h1>Title</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div id="toc" class="toc">
<div id="toctitle" class="title">Table of Contents</div>
<ul class="sectlevel1">
<li><a href="#_section_title">Section title</a></li>
<li><a href="#_one_more_section_title">One more section title</a></li>
</ul>
</div>
<div class="paragraph">
<p>Some text.</p>
</div>
...
whereas auto
(and also right
/ left
) creates the toc
div
before the content
div
.
<body class="article">
<div id="header">
<h1>Title</h1>
<div id="toc" class="toc">
<div id="toctitle">Table of Contents</div>
<ul class="sectlevel1">
<li><a href="#_section_title">Section title</a></li>
<li><a href="#_one_more_section_title">One more section title</a></li>
</ul>
</div>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>Some text.</p>
</div>
...
So the assumption is, that macro
/ preamble
triggers: https://github.com/asciidoctor/asciidoctor-vscode/blob/26c8034cd915118f37be0fb759c2dd04db6a46f1/media/asciidoctor-editor.css#L1061-L1071
or respectively: https://github.com/asciidoctor/asciidoctor-vscode/blob/26c8034cd915118f37be0fb759c2dd04db6a46f1/media/asciidoctor-default.css#L901-L907
Using the preview mode with the ToC placement
macro
/preamble
with a custom "Workbench: Color Theme" (in this case "Red" to make it stand out more but usually it would be more switching between light / dark modes I guess)The default
:toc:
or explicitly calling:toc: auto
are shown just fine:ToC placement
preamble
shows "light" colored ToC background:ToC placement
macro
shows "light" colored ToC background:System information: Version: 1.86.2 Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda Date: 2024-02-13T19:42:13.651Z Electron: 27.2.3 ElectronBuildId: 26908389 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin x64 23.3.0 AsciiDoc: v3.2.0