de-jcup / eclipse-asciidoctor-editor

An eclipse editor for asciidoctor files
https://marketplace.eclipse.org/content/asciidoctor-editor
Other
58 stars 15 forks source link

Open the preview in a separate eclipse view rather than splitting the editor #98

Open dvojtise opened 6 years ago

dvojtise commented 6 years ago

Hi I just discovered the https://github.com/de-jcup/eclipse-asciidoctor-editor editor thanks to https://github.com/hallvard/plantuml/issues/59 and it will be useful for editing my big asciidoc+plantuml documentation for gemoc :smile:

A suggestion: do you think it would be possible to "share" the same area for asciidoctor preview and plantuml view ?

ie. at least make sure that the 2 views can be stacked/docked in the same place in eclipse ide? Currently the asciidoc preview is directly in the main editor area and cannot be freely moved in the same area as the plantuml one. Our screen are bigger than some years ago, but we still need to organize it smoothly :-)

This would be also be useful for asciidoc documents where the plantuml images are not embedded and would take advantage of automatic png generation such as https://github.com/hallvard/plantuml/issues/41

paulvi commented 6 years ago

What you may be asking is actually way to hide preview within Editor, but it is already implemented

image

Note that as it is different plugin, their rendering may be different.

Also for AsciiDoc Editor - it shows all diagrams, while PlantUML View only the first diagram, that is only one per document. ref https://github.com/hallvard/plantuml/issues/62

dvojtise commented 6 years ago

Yes, I've seen this option

However, having the preview directly in the editor area force to have a large area for the editors if one wish to use the preview (or the preview will be small and less usable) The user has to resize the area when he/she switches between content (ie. editors)

Allowing to put the asciidoc editor preview in a classic eclipse view instead of embedding it in the editor would allow more flexible workbench disposition and avoid to resize the areas depending on the file displayed.

about. hallvard/plantuml#62, I do not try to put the sources of multiple diagrams in a single source file, the documents I'm working on are usually too big to remain in a single file, so except for some very simple diagrams that could remain embedded, this should not occurs too often.

paulvi commented 6 years ago

OK, so you prefer View, as said in title.

I actually like the current solution as fresh as finally using width of modern monitors.
And for a separate View other plugin already exists.

In the end, it is up to author or new contribution ...

dvojtise commented 6 years ago

Ok so I add a [note for self]: " if time, have a look to contribute a new option and view to asciidoc editor" :wink:

de-jcup commented 6 years ago

Hello @dvojtise,

I think it wouldn't be too much difficult to integrate a special view which just contains an internal web browser component (same as inside vertical/horizontal mode) but standalone.

Maybe the most easiest and comfortable variant would be to hook into (re)creation of preview html output . At this time the implementation just needs to lookup if there is the view visible or not. (see Example ) . If the view is shown the integrated browser component should be setup with same url as internal browser system. (same on initializing info which is shown at init time). So you could just turn default view mode in preferences to "hide preview" and keep the view open...

Would this solve your problem ?