https://discuss.asciidoctor.org/Toc-rendering-options-in-Asciidoctor-js-tp3564p3568.html
Abel,
I'm looking forward to your improvements!
To answer your question, I'll explain how it works today. Keep in mind, I'm merely explaining the current situation. The option to improve the behavior is always on the table.
The allowed values for the `toc` attribute depend on whether you are converting to a standalone HTML document (header_footer: true) or embeddable HTML (header_footer: false). The allowed values for the `toc` attribute when converting to embeddable HTML are a subset of the values when converting to a standalone HTML document. The values that only apply to the standalone HTML document are `auto` (the default value if blank), `left` and `right`.
The reason `left` and `right` are only available when converting to a standalone HTML document is two-fold.
1. We need a slot in the HTML structure to put the left and right toc, which is only available when making a standalone HTML document.
2. Embeddable HTML is intended to be inserted anywhere inside another HTML document and therefore we can't assume we have access to the HTML viewport to place the left and right toc.
(Also remember that below the medium-sized screen breakpoint, the left and right toc will return to the center).
The preview in the Atom editor uses the embeddable HTML (`header_footer: false`). Therefore, it has a limited number of toc placement options. The embeddable HTML is used in the Atom preview because the viewport itself is an HTML document. It's also slightly faster for us to produce the embeddable HTML because it doesn't have to prepare the HTML head.
In general, I think the right solution is making the embeddable HTML as functional as it can be so that we don't end up losing important features just because we aren't converting to a standalone HTML document.
I hope that helps answer your questions.
Cheers!
-Dan