jmzambon / libreoffice-code-highlighter

Code snippet highlighter for LibreOffice.
https://extensions.libreoffice.org/en/extensions/show/5814
Other
79 stars 5 forks source link

Add a preview of highlighting style to the dialog #46

Open kompilainenn opened 3 weeks ago

kompilainenn commented 3 weeks ago

Would be cool to see a Preview without button clicking, just after Language and Style selecting at once. And the Preview should be inside the dialog not in the document

You already answered me in #32 as "It was the idea at start, but previewing requires to activate all the highlighting machinery, which is not responsive enough to be bound to such events. But I keep thinking about other solutions."

But I thought maybe we can just create some PNG with all variants of highlight and then just show the PNG for selected Language+Style pair?

Of course we need some simple code examples for all languages...

And it looks as too hard for implementation=(

Maybe your idea about using all the highlighting machinery is a better idea...

jmzambon commented 2 weeks ago

Hi,

An in-dialog preview is possible but would need much more work, and I'd like to keep this extension as simple as possible, considering I don't have much time for maintenance. Nevertheless, since issue #32, I've made some tests for an in-document autopreview feature. I've pushed it in the 'autopreview' branch. If you'd like to try it, the binary is here. Thanks in advance for your feedback.

kompilainenn commented 2 weeks ago

I don't have much time for maintenance.

You made a great extension that works perfectly and without any problems! I don't think you will need a time for maintenance at all =))

If you'd like to try it, the binary is here. Thanks in advance for your feedback.

Two problems I saw:

  1. I before should select some code example in the document.
  2. The preview will be show in the document for selected text.

Why it's a problems? When I want to highlight many code examples in a big document, I want to see the preview at all inside the dialog without addition actions like a text selecting and the dialog moving to see preview in the document =(

What about some expanded section for the preview in the dialog, like this:

image

The Preview button will open/close the Preview section on the right side of the dialog. What do you think?

jmzambon commented 1 week ago

Hi,

This is not as straightforward as it seems to be. I'll need to think about it.

jmzambon commented 4 days ago

You made a great extension that works perfectly and without any problems! I don't think you will need a time for maintenance at all =))

Thank you very much :D .

Two problems I saw:

  1. I before should select some code example in the document.
  2. The preview will be show in the document for selected text.

Why it's a problems? When I want to highlight many code examples in a big document, I want to see the preview at all inside the dialog without addition actions like a text selecting and the dialog moving to see preview in the document =(

What about some expanded section for the preview in the dialog, like this:

![image]

The Preview button will open/close the Preview section on the right side of the dialog. What do you think?

The problem is only for "highlight all code" option, as selection is requested otherwise. The LibreOffice API, regarding dialog and window management, is terrible. Previewing part of a document in a dialog box is possible (I think) but really uneasy. I need time to find a way and test it. But right now I'm very busy with professional and personal stuffs :( .

kompilainenn commented 4 days ago

But right now I'm very busy with professional and personal stuffs :( .

Of course, we all have a real life and we all want to eat.

Of course you fell free to close this one at all as WONTFIX, no problem =)

Thanks for your work again, with your extension I formatted another book about Flask and Python very easy!