IntelliJ plugin - can I detect preview mode?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

IntelliJ plugin - can I detect preview mode?

PeterSt
Hi, I am quite new to this (and yet nagged the developers with some bugs ) so I'd like to know if there is a way to distinguish between …
  • viewing a file in IntelliJ's preview pane
  • viewing a file via button in a browser

Both have the the same user-home, env, outfilesuffix, …

What I'd like to achieve is this … while writing in IntelliJ, collapsible blocks are expanded, but them are collapsed when viewing the file in a browser.

As an alternative it would be nice to expand collapsed blocks in preview pane as soon as they are entered in the source pane or having an attribute in the language/plugin settings for the collapsed behaviour or not have the sections collapsed at all.

Regards Peter
Reply | Threaded
Open this post in threaded view
|

Re: IntelliJ plugin - can I detect preview mode?

Alexander Schwartz
Hi Peter,

not that I am aware of. Please consider opening an issue the the AsciiDoc IntelliJ plugin. Maybe it is time to add another attribute like "env-preview" to the plugin.

Regards,
Alexander
(maintainer of the AsciiDoc plugin)

PS: nice to meet you here as well :-)
Alexander Schwartz (alexander.schwartz@gmx.net)
https://www.ahus1.de
Reply | Threaded
Open this post in threaded view
|

Re: IntelliJ plugin - can I detect preview mode?

Alexander Schwartz
I had another look and there is an implicit difference between creating the HTML with the button and the preview: In the preview the attribute "embedded" is set. The following will work:
ifdef::embedded[]
Only shown if in preview
endif::[]
Alexander Schwartz (alexander.schwartz@gmx.net)
https://www.ahus1.de
Reply | Threaded
Open this post in threaded view
|

Re: IntelliJ plugin - can I detect preview mode?

mojavelinux
Administrator
Here's what we use for the preview in Atom


If we need something more generic than env=browser env-browser, we should probably discuss in an issue so that the various plugins can align.

Best Regards,

-Dan

On Thu, Apr 30, 2020 at 12:42 PM Alexander Schwartz [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I had another look and there is an implicit difference between creating the HTML with the button and the preview: In the preview the attribute "embedded" is set. The following will work:
ifdef::embedded[]
Only shown if in preview
endif::[]
Alexander Schwartz ([hidden email])
https://www.ahus1.de



If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/IntelliJ-plugin-can-I-detect-preview-mode-tp7961p7963.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: IntelliJ plugin - can I detect preview mode?

PeterSt
This post was updated on .
Thanks guys!
Works like a charm until I found out, that AsciiDoc in GitLab also is "embedded" ... well — that can be fixed

Regards Peter