xiota / geany-preview

Turns Geany into a markdown editor by providing a preview pane in the sidebar to show the formatting of several light-weight languages as they are edited. Supported document types include AsciiDoc, DocBook, Fountain, HTML, LaTeX, Markdown, MediaWiki, reStructuredText, Textile, and Txt2Tags.
GNU General Public License v3.0
15 stars 0 forks source link

Does Geany Preview exist for Lubuntu 23.10? #49

Closed ralf3u closed 8 months ago

ralf3u commented 1 year ago

I ask this because I would like to test Lubuntu 23.10. Thank you for an answer.

xiota commented 1 year ago

I will try to update the PPA this weekend.

Geany 2.x was recently released. Do you want 2.x added to the PPA? I think it includes fixes for some bugs that were affecting you. As far as I can tell, 2.x is not yet in official Ubuntu repositories. I wouldn't expect it until the 24.04 release.

The problem is, plugins built for 1.38 won't work on 2.x anymore, and vice versa.

ralf3u commented 1 year ago

Geany 2.x was recently released. Do you want 2.x added to the PPA?

No, thanks. Geany Preview is enough.

xiota commented 1 year ago

The latest version of the plugin has been built for 22.04, 23.04, and 23.10 on the PPA.

The plugin no longer builds on 20.04 because of API changes. An older version may still be available.

I deleted the old build of geany-git. I'm leaving geany-plugins because Lua and some other plugins had some bug fixes.

ralf3u commented 1 year ago

I'm leaving geany-plugins [...]

Oh. What does "leaving" in concrete mean?

[...] because Lua and some other plugins had some bug fixes.

Does that mean that the shortcut to disable/enable the menu bar of Geany does not work any more? Does that mean that the auto-sidebar and the shortcuts for Geany Preview don't work any more?

xiota commented 1 year ago

What does "leaving" in concrete mean? ... does not work any more? ...

It means, I am not deleting them. However, I had forgotten that they need to be built to be available for 23.10. I will do so in the next few days. Sorry for the oversight.

ralf3u commented 1 year ago

It means, I am not deleting them. However, I had forgotten that they need to be built to be available for 23.10.

I don't understand. If I install geany and geany-plugins, then Lua Scripts should be there. So, why Lua Scripts need to be built?

xiota commented 1 year ago

I recall that there were bugs in the Lua scripts plugin that are not fixed in the version currently provided by Debian/Ubuntu. If that is not the case, then I do not need to rebuild the plugins for the PPA. I will check the package database before building.

ralf3u commented 1 year ago

[...] there were bugs in the Lua scripts plugin that are not fixed in the version currently provided by Debian/Ubuntu.

Does this also have consequences on the shortcut to disable/enable the menu bar of Geany, the auto-sidebar and the shortcuts for Geany Preview? If not, then I don't care so much if there are bugs in Lua scripts.

ralf3u commented 9 months ago

Sorry to answer so late. But I was confronted with many problems. I just wanted to use the toggle menu bar and test later Preview. But I can't use the toggle menu bar because I can't find the plugin 'Lua Script' in the list of plugins.

ralf3u commented 9 months ago

If you are too busy at the moment, I can wait till end of April, because in two months there will be Lubuntu 24.04.

xiota commented 9 months ago

I haven't been using Ubuntu-based distros for a while... Will review PPA over the next few days or weekend.

ralf3u commented 9 months ago

This year I would like to test again Debian, because in Debian there is the option to install only free software, what can be realized in the expert-mode. Some years ago I installed Debian, but I think that I was frustrated because the speakers didn't work. I thought that Debian was the problem. Today I think that the speakers didn't work because of the non-free drivers. What is your experience with Debian?

xiota commented 9 months ago

My info about Debian is old. I used Debian for 1-2 years a long time ago. I used Ubuntu variants for many years after that.

Debian package versions tend to be old relative to the latest Ubuntu releases, but not too much different from using LTS. Debian default config is different. Package availability is different. PPA may not work with Debian.

In terms of free vs non-free, most firmware is considered non-free. Without firmware, many devices do not work at all. So usually hardware issues are not fixed by removing non-free packages. (Different issue from proprietary vs open-source drivers.) But only way to really know is to try.

ralf3u commented 9 months ago

PPA may not work with Debian.

Hm, so it could be that Geany Preview does not work in Debian?

xiota commented 9 months ago

The plugin should still be usable. You'd probably have you build it yourself though. Standard Debian/Ubuntu packaging is a pain. Something like makedeb and MPR would be easier.

xiota commented 9 months ago

I had thought the packages were already built for 23.10 last Nov, but I had a typo in my config. It should be fixed now. Let me know if it's not working by tomorrow. (You're too patient, waiting so many months.)

I'm thinking about retiring the PPA in favor of including a makedeb config file.

ralf3u commented 9 months ago

Let me know if it's not working by tomorrow.

I still can't find Lua Scripts in the list of plugins in Geany.

xiota commented 9 months ago

I still can't find Lua Scripts in the list of plugins in Geany.

Is geany-plugin-lua installed?

ralf3u commented 9 months ago

Is geany-plugin-lua installed?

I can't remember that I had to install geany-plugin-lua in the past. It was automatically in the list of plugins after the installation of geany-plugins.

ralf3u commented 9 months ago

What is the reason that it is not any more integrated in geany-plugins?

xiota commented 9 months ago

What is the reason that it is not any more integrated in geany-plugins?

I don't know. Packages can be forced uninstalled or installed with or without depends. Some depends can be optional. If the packages are installed, mismatched versions between geany and geany-plugins can make the plugins not show up.

Is your problem resolved after trying to install geany-plugin-lua? If not, I can add updated geany and geany-plugins to the PPA. Both packages would be needed to keep the package versions synced because there was a 2.0 release.

ralf3u commented 9 months ago

I don't know. Packages can be forced uninstalled or installed with or without depends. Some depends can be optional. If the packages are installed, mismatched versions between geany and geany-plugins can make the plugins not show up.

Maybe it would be good to add some information like this on your webpage (https://github.com/xiota/geanylua-scripts/):

Installation If Lua Scripts is not in the list of plugins in Geany, even after an installation of geany-plugins, then do: sudo apt install geany-plugin-lua

Is your problem resolved after trying to install geany-plugin-lua?

I didn't try, but I will test it tomorrow.

xiota commented 9 months ago

I'd rather not add distro-specific instructions to install Lua. Users should be able to figure out that much on their own.

ralf3u commented 9 months ago

I'd rather not add distro-specific instructions to install Lua. Users should be able to figure out that much on their own.

OK. But if I install geany-plugin-lua and then if Lua Scripts is in the list of plugins, can I update the 'step-by-step description', that is located in the issue number 633 of Geany, by adding a kind of text like the next line?

if Lua Scripts is not in the list of plugins, then you need to install Lua Scripts by terminal: sudo apt install geany-plugin-lua

xiota commented 8 months ago

You're free to edit your own comment. The reminder to check that the plugin is installed could be helpful, but not everyone uses Debian/Ubuntu, so the apt command won't necessarily help. For example, if Geany is manually built and installed to /usr/local (outside package manager control), Geany plugins also has to be manually built and installed to /usr/local.

I wouldn't mind adding to the lua scripts readme:

If "Lua Script" is not shown in the Plugin Manager, make sure the Geanylua plugin is installed. See distro documentation for details.

ralf3u commented 8 months ago

I installed the plugin Lua Script with sudo apt install geany-plugin-lua. Now, Lua Script is in the list of plugins. The shortcut toggle menu bar works. I updated the content of the step-by-step description at Geany (issue number 633).

In the next days I will install Geany Preview to test the other shortcuts.

ralf3u commented 8 months ago

Excuse me to disturb you, but I have a problem, and maybe you know the solution.

I can change the design of tabs and I can change the design of the active tabs, but I can't change the design of the tab, that is in focus. So, this is what works in geany.css:

/* design of tabs */
tab {
    padding-top:25px;
    padding-bottom:10px;
    padding-left: 35px;
}

/* design of active tabs (e.g. tab of the editor and tab of the sidebar) */
tab:checked {
    font-weight: bold;
    border-bottom: 5px solid black;
}

I opened yesterday a discussion at Geany with the number 3784, but with the answer I couldn't solve the problem. I think you could know the solution, because when I used the shortcut 'Toggle between the editor and sidebar' in Preview, I could clearly see which tab is in focus.

So, do you know the selector name for geany.css to change the design of the tab that is in focus? Or is it not possible to solve the problem in geany.css? Is there an easy solution?

Thank you very much in advance for an answer.

xiota commented 8 months ago

What you want sounds like theming. Maybe look at some gtk themes to see what they do. May not be any universal solution. Could be different for different themes.

ralf3u commented 8 months ago

What you want sounds like theming. Maybe look at some gtk themes to see what they do. May not be any universal solution. Could be different for different themes.

I tested all GTK 3 Themes and some GTK 2 Themes in main menu, Preferences, LXQt Settings, Appearance, GTK Style. After each change I restarted Geany. But it didn't help.

For the sidebar I just recognized that you already programmed a solution for sidebar-tab-focus/unfocus. I described how to use it in https://github.com/xiota/geany-tab-style/issues/6. So, the focus/unfocus problem of the sidebar could be solved partially with geany-plugin-xi-tweaks, partially because xiota/geany-tab-style#6 still exists.

Thanks to geany-plugin-xi-tweaks, now, what I need is a solution to recognize the tab-unfocus of the editor. It could be like this:

tab:checked {
    font-weight: bold;
    border-bottom: 5px solid black;
}
tab:unfocus {
    font-weight: bold;
}

But tab:unfocus does not work.

In https://github.com/xiota/geany-tab-style/issues/6 you write: "The editor is a different component. (scintilla)".

Do you have an idea how to recognize the tab-unfocus of the editor?

Thank you in advance for an answer.

ralf3u commented 8 months ago

The problem has to do with Preview. If I use the default settings of geany.css, then I can see which tab is in focus when pressing the shortcut Switch focus between editor and the sidebar. But because I use an ePaper-display, I can't use the default settings of geany.css. So, I use tab:checked. But when pressing the shortcut Switch focus between editor and the sidebar I would like to use a kind of tab:unchecked or rather tab:unfocus or tab:unactive for the tab in the editor.

xiota commented 8 months ago

Maybe some screenshots or photos would help me understand better what you are describing?

I'm also interested in the epaper display. What are the make and model?

ralf3u commented 8 months ago

I'm also interested in the epaper display. What are the make and model?

It is BOOX MIRA (boox.com). It is so good for the eyes. There is also a BOOX MIRA PRO, but it is more for music production or video production because of the big screen. I had to change to ePaper-display because the eyes started to hurt after a while when using the notebook display. When using a TFT/LCD-display, you look into light. And that is not good for the eyes on a long term. In BOOX MIRA I can turn off the lights, so I don't see into the light. I use a LED-lamp instead with 11 Watt that shines directly into the display, so I don't see into the light, but into reflected light, what is much better for the eyes.

ralf3u commented 8 months ago

Maybe some screenshots or photos would help me understand better what you are describing?

Just paste the following code at the end of geany.css, save geany.css, and then restart Geany by opening the sidebar.

/* design of tabs */
tab {
    padding-top:25px;
    padding-bottom:10px;
    padding-left: 35px;
}

/* design of active tabs (e.g. tab of the editor and tab of the sidebar) */
tab:checked {
    font-weight: bold;
    border-bottom: 5px solid black;
}

Then you will see that both active tabs have exactly the same design. And then, if you put a tab of the sidebar in focus, the design of the tab of the editor does not change.

xiota commented 8 months ago

I think I see what you're trying to do now. You want whichever single tab is active / focused / receiving keyboard input, regardless of which notebook it is in (editor or sidebar) to have a visual indicator to show its state.

I don't know how to do that with pure css. If possible, you probably need to find a GTK-specific forum. :focus seems to be closest, but it doesn't work. Maybe because the tab children have focus, not the tab/notebook itself.

xiota commented 8 months ago

I've updated the xi-tweaks plugin to highlight a single active tab across editor, sidebar, and msgwin. It's uploaded to the PPA: geany-plugin-xi-tweaks 0.0.0-r32.g9900a17

Config:

[tweaks]
sidebar_focus_enabled=false
notebook_focus_enabled=true

sidebar_focus_enabled=true is the old behavior that highlights only the sidebar tabs.

notebook_focus_enabled=true highlights the single focused tab from sidebar, msgwin, or editor. "Notebook" is the GTK terminology for a tabbed widget.

geany.css rules are different from before. Here is a sample config:

#geany-xitweaks-notebook-tab-focus {
    font-weight: bold;
    color: #399;
}

#geany-xitweaks-notebook-tab-unfocus {
}

#geany-xitweaks-notebook-page-focus {
    border-width: 3px;
    border-style: solid;
    border-color: #399;
}

#geany-xitweaks-notebook-page-unfocus {
    border-width: 3px;
    border-style: solid;
    border-color: transparent;
}

Basically, sidebar in old name is changed to notebook. The example config installed with the package has an unused example I forgot to remove.

ralf3u commented 8 months ago

I have three questions:

In my description of https://github.com/xiota/geany-tab-style/issues/6 I write that geany-plugin-xi-tweaks can be installed by the following command: sudo apt install geany-plugin-xi-tweaks

In your last comment above you write:

It's uploaded to the PPA: geany-plugin-xi-tweaks 0.0.0-r32.g9900a17

1) Does that mean that I have first to install Preview? 2) If the answer is yes, can other users still use the following command? sudo apt install geany-plugin-xi-tweaks 3) What does msgwin mean?

xiota commented 8 months ago

The xi-tweaks plugin is separate from the preview plugin. It contains only a couple features you had requested that I thought don't fit anywhere else: a panel switch shortcut and tab highlighting.

If the PPA is installed, the command to install the xi-tweaks plugin should be sudo apt install geany-plugin-xi-tweaks

The CSS rules related to #geany-preview-sidebar-page are not used by the xi-tweaks or preview plugins. It is left over from some previous attempts to provide the tab highlighting feature you requested.

The other CSS rules have been renamed by changing sidebar to notebook. For example #geany-xitweaks-sidebar-page-unfocus is now #geany-xitweaks-notebook-page-unfocus.

The message window (msgwin) is another tabbed panel. You can see it by activating: Menubar > View > Show Message Window.

ralf3u commented 8 months ago

Just for information: During the installation process of the PPA there was this text in the terminal:

Description:
20.04, 22.04, 22.10, 23.04

23.10 is missing

xiota commented 8 months ago

Thank you. I updated the description to 20.04, 22.04, 23.10. The next Ubuntu release 24.04 may be the last.

Let me know if xi-tweaks feature notebook_focus_enabled=true does what you were searching for. Also, somehow the problem with wrong tab being highlighted with keyboard navigation may be fixed now. No idea how/why.

ralf3u commented 8 months ago

With those settings, everything works correct:

#geany-xitweaks-notebook-tab-focus {
    font-weight: bold;
}

#geany-xitweaks-notebook-tab-unfocus {
}

#geany-xitweaks-notebook-page-focus {
}

#geany-xitweaks-notebook-page-unfocus {
}

But with those settings:

#geany-xitweaks-notebook-tab-focus {
    font-weight: bold;
    border-bottom: 5px solid black;
}

#geany-xitweaks-notebook-tab-unfocus {
}

#geany-xitweaks-notebook-page-focus {
}

#geany-xitweaks-notebook-page-unfocus {
}

If sidebar or msgwin are in focus: The tab-title of the sidebar or msgwin is shown with a border, as it should be. But: If editor is in focus: The tab-title of the sidebar is shown without a border, although I expect a border.

xiota commented 8 months ago

If editor is in focus: The tab-title of the sidebar is shown without a border, although I expect a border.

Maybe adding generic CSS, similar to your previous attempt, would do what you want?

tab:checked {
    border-bottom: 5px solid black;
}

#geany-xitweaks-notebook-tab-focus {
    font-weight: bold;
}

#geany-xitweaks-notebook-tab-unfocus {
}

#geany-xitweaks-notebook-page-focus {
}

#geany-xitweaks-notebook-page-unfocus {
}
ralf3u commented 8 months ago
tab:checked {
    border-bottom: 5px solid black;
}

Then all three tab-titles are underlined what is not my goal.

The goal for me: tab that has focus: underline and bold; at the same time: active tab of the other panels: only bold

xiota commented 8 months ago

active tab of the other panels: only bold

tab:checked {
font-weight: bold;
}

tab that has focus: underline and bold; at the same time:


#geany-xitweaks-notebook-tab-focus {
font-weight: bold;
border-bottom: 5px solid black;
}

geany-xitweaks-notebook-tab-unfocus {

}

geany-xitweaks-notebook-page-focus {

}

geany-xitweaks-notebook-page-unfocus {

}

ralf3u commented 8 months ago

When the tab of the editor is in focus: There is no underline what is not the goal.

xiota commented 8 months ago

I don't understand what you are trying to accomplish then. Maybe the following config?

[tweaks]
sidebar_focus_enabled=true
notebook_focus_enabled=false

With following in geany.css:

tab:checked {
    font-weight: bold;
}

#geany-xitweaks-notebook-tab-focus {
    font-weight: bold;
    border-bottom: 5px solid black;
}

#geany-xitweaks-notebook-tab-unfocus {
}

#geany-xitweaks-notebook-page-focus {
}

#geany-xitweaks-notebook-page-unfocus {
}
ralf3u commented 8 months ago

I don't understand what you are trying to accomplish then.

tab that has focus: underline and bold; at the same time: active tab of the other panels: only bold

I will try your last comment in around ten hours.

ralf3u commented 8 months ago

First I want to say that you had a a good idea to add a further option to the plugin Xi/Tweaks and not to change completely the plugin, so that in case the further option does not work, there is still a fallback-solution.

I recognized that I still don't know exactly what kind of tab-title-format I would like to use because the frequent use will show what is the best for me.

Some days ago I wanted that only the tab that is in focus should be underlined and bold. But then I recognized that I lose the orientation on the ePaper-display because I don't know which tab is active of the panel that has not the focus. That is the reason why I chose that all active tabs should be bold and while the tab that is in focus should be underlined.

To make all active tabs bold can be realized by this:

tab:checked {
    font-weight: bold;
}

Then, the only thing what is missing is the underline.

To make the underline work not only in the sidebar but also in other panels I need this form of configuration:

sidebar_focus_enabled=false
notebook_focus_enabled=true

That is the reason why I decided today not to test your suggestion of your last comment.

Now comes the CSS for the underline. This is the part that is not working in the editor as it should work:

#geany-xitweaks-notebook-tab-focus {
    border-bottom: 5px solid black;
}

#geany-xitweaks-notebook-tab-unfocus {
}

#geany-xitweaks-notebook-page-focus {
}

#geany-xitweaks-notebook-page-unfocus {
}

But what is interesting: If I replace border-bottom: 5px solid black; by this line font-style:oblique; or by this line font-size: 50px; then it works in the editor.

So, the CSS-selector border is the problem, because if I chose this line border: 5px solid black; it also does not work in the editor while in the other panels it works.

Maybe the problem is related to the following lines because the border is touching the page?

#geany-xitweaks-notebook-page-focus {
}

#geany-xitweaks-notebook-page-unfocus {
}

It is weird. Do you you have an explication?

ralf3u commented 8 months ago

I think that my guess of my last comment is correct, because If I chose this

#geany-xitweaks-notebook-tab-focus {
}

#geany-xitweaks-notebook-tab-unfocus {
    border: 5px solid black;
}

#geany-xitweaks-notebook-page-focus {
    border: 5px solid black;
}

#geany-xitweaks-notebook-page-unfocus {
    border: 5px solid black;
}

I can clearly see that the page is above the area where the underline should appear.

Maybe the solution is to put the page of the editor under the tab bar.

ralf3u commented 8 months ago

The page of the editor is not at the same horizontal level like the page of the sidebar, no matter if sidebar or editor is in focus.

I think that the position of the page of the editor is not correct. That is the reason why the CSS-selector border does not work. The correct position of the page of the editor is not to place the page under the tab bar, like I wrote in my last comment, but to place it just below the tab bar. The page of the editor should be at the same horizontal level like the page of the sidebar.

ralf3u commented 8 months ago

The CSS-selector text-decoration does not work on any panel. I don't know why.