asciidoctor / atom-asciidoc-preview

⚛ AsciiDoc preview for the Atom editor.
https://atom.io/packages/asciidoc-preview
MIT License
142 stars 42 forks source link

Feature suggestion: make the preview respect the :toc: left attribute #282

Closed refaelsh closed 5 years ago

refaelsh commented 5 years ago

Hi,

Following the discussion here, I would like to suggest the following feature: make the preview respect the :toc: left attribute.

Thanks. Refael.

mojavelinux commented 5 years ago

I feel strongly we should not do this (for the default stylesheet). It takes away entirely too much space in the preview and doesn't really make sense to show the toc there in this context. The preview window is not meant to emulate the webpage that the end user sees. It's meant to offer a preview of the content.

For navigating the document, the preferred approach is a dedicated Atom view that contains the outline of the source as provided by the document-outline package. See https://github.com/asciidoctor/atom-asciidoc-assistant/issues/16 (which you also suggested).

If you really want the toc on the left for your own purposes, then you can do so in your own custom stylesheet. Nothing should get in the way of that option.

refaelsh commented 5 years ago

I understand what you are saying. But, please consider the following counter-arguments:

  1. I wasted a few good hours trying to understand why I don't see my toc on the left.
  2. Preview, should help me, like, you know, I wanna try the toc on the left side, then on the right side, then in the middle, and see what option is better for me - I cant do that with the current state of the default stylesheet.
mojavelinux commented 5 years ago

I wasted a few good hours trying to understand why I don't see my toc on the left.

Then we need to improve the docs.

Preview, should help me, like, you know, I wanna try the toc on the left side, then on the right side, then in the middle, and see what option is better for me - I cant do that with the current state of the default stylesheet.

That's not the purpose of this preview. It's not meant to help design the output. It's to preview the content part.

Please understand I'm not saying you don't have a valid use case. It's just not the focus of this plugin. If you want a plugin that has that focus, then you are free to create one.

mojavelinux commented 5 years ago

If you want a plugin that has that focus, then you are free to create one.

...or a custom stylesheet. Again, this is a great example of why the plugin allows a custom stylesheet. I just don't want it to be in the default stylesheet because it doesn't align with our goals for the plugin.

refaelsh commented 5 years ago

Thank you @mojavelinux. I understand. I will go and submit a pull request for updating the docs about this. I will also create my own stylesheet.