-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some questions about geany-preview #1
Comments
While the Preview plugin can also show HTML, it does not have features that web designers might want, like the devtools console. It is intended as an authoring tool for use with light-weight markup languages, like Markdown. It gives Geany features similar to those found in
I currently do not intend to submit this plugin to geany-plugins because doing so would limit my ability to add features and fix bugs. Of course, this is open source, so they are free to make a copy.
HTML and Markdown previews work without Pandoc and AsciiDoctor. XHTML as a standalone entity is basically dead. What you can do is write HTML in XML style. It's just personal preference that does not affect how HTML is rendered.
Similar. The preview is updated as the document is edited. Changes do not have to be saved to be previewed. The document type does have to be set though. For saved/loaded documents, Geany detects the document type automatically. For "untitled" documents, the document type can be changed from the menu at Document | Set Filetype.
The Symbols and Documents tabs are part of the Geany sidebar, which can be resized. Symbols is used for programming. Documents is an alternative to tabs for switching documents. You can access the sidebar from the menu at View | Show Sidebar. To make accessing it more convenient, you can assign a shortcut in preferences.
Preview uses the WebKit2GTK component. It is similar to the HTML engine used in Google Chrome, but rendering may be slightly different. For web development, you would eventually need to preview your designs in real web browsers. At a minimum, I would suggest checking that your pages work in both Firefox and Chrome. Note: There was a web engine, KHTML, used in KDE Konqueror. Apple forked KHTML into WebKit. Google forked WebKit into Blink. Blink is now used in numerous web browsers – Google Chrome, Microsoft Edge, Opera, Vivaldi, Brave, Falkon, etc.
There is only one Preview tab (on the right). The Preview is updated to match the currently selected document (on the left). What Preview displays depends on whether it is able to convert the document into HTML for preview. If it cannot (like for programming languages), it will display a message similar to: For text documents, Preview will attempt to use the |
@xiota I tried formika and retext. It is quite interesting. Then I wanted to install geany-preview but I failed. I'm sorry for asking. I have experience with installing (with sudo apt install ...), but no experience at all with building & installing. |
I made a
If you're interested in building from source, the source directory is the directory that you uncompressed the source code into. So if you downloaded the file
You might have to link the plugin in another folder so Geany can find it:
To uninstall, you could go back to the build directory and run
|
@xiota Sorry, but I still have problems to install geany-preview. So, here is what I did in Lubuntu 21.04: then in the terminal: Then I open Geany, I go in the menu-bar, then in Tools, then in the Plugin and there I activate "Preview". |
@ralf3u Did you go to the menu to show the sidebar? The sidebar is part of Geany, and the plugin just adds a tab. |
@xiota Yes, you are right: In the menu-bar in View I have to activate the sidebar. Now I can see the Preview. It's great to see this in Geany. It's awesome!! question 1 question 2 question 3 question 4 question 5 Thank you for an answer and your patience in advance. |
To change the position of the sidebar, go to Preferences/Interface/Interface.
For Markdown and Pandoc, you can edit the
I would like to synchronize the scrollbars, but don't know how. For long documents, there is a snippets mode that shows a preview for only a small section of the document. You can edit the settings in There are other options you can change too, but most of them won't do much if you didn't install Pandoc, AsciiDoctor, or Screenplain. For convenience, there are buttons to open the config file and folder in Edit/Plugin Preferences/Preview.
I just created a PPA for 21.10. So the geany-preview debs are ready for 21.10.
On the GitHub page, there's a green button that says "Code". After clicking on it, a box will appear that says "Download ZIP" in it.
It's safer to enter commands one by one, in case a program needs user input. That way it won't take the next command as input. |
question 1: question 2:
Can it be that in HTML nothing will be shown in Symbols even if JavaScript will be added? issue 1:
The preview-file is empty, so I can not edit them. Same for:
Thank you for an answer in advance. |
That is outside the scope of the preview plugin. There is another plugin that can do what you want: Save Actions.
The easiest way to see what happens is to load a document of interest and look at the tab. When an HTML document is loaded, the Symbols tab shows HTML specific information. To show JavaScript-related info, switch the document type to JavaScript in the menu at Document/Set Filetype/Scripting Languages/JavaScript source file. Switching document types is pretty cumbersome with the nested menus. I've been thinking about adding a filetype switcher to Preview. Another option is to use Lua scripts that can be assigned shortcuts to switch to specific document types.
That is probably related to packaging as a |
@ralf3u I fixed the problem with the missing config file. The problem was from when I made it into a deb. I made a PPA for geany plugins, so you can add it and get updates through the package manager if you want (without the other packages in my other PPAs). |
That's insane!! The combination Preview & Save Actions (save when not in focus any more) is phenomenal!! Preview is already out of this world, but now with the addition Save Actions, ... it's incredible!! That means that users don't only save the F5-shortcut for reloading the webpage, but also the Ctrl+s-shortcut for saving!! That is a saving of two shortcuts! question 1 question 2 question 3 question 4 issue 1 issue 2 issue 3 issue 4 issue 5 Thank you for an answer in advance. |
I opened new issues #2, #3 based on some of what you've typed. You can keep sending general questions here.
I haven't tried, but maybe this will do what you want?
I'm not sure what you mean. The Preview updates as you type. The context menu in the preview pane is broken though.
Thanks for letting me know. I'll fix it. It's the same document linked from the Readme.
My mistake. Most projects use "master". I forgot that I was using "main".
You have to understand what the commands are doing.
That was a different issue. The problem is fixed and uploaded to the PPA. You can install the ppa onto your system so that the plugin will update with
After installing the new version and restarting Geany, go to Edit/Plugin Preferences/Preview. Then click the button that says "Reset Config" followed by the button that says "Save Config". This will replace the old config file with a new one, then save your old settings into the new file.
You need to install
Here is a breakdown of what the command is doing...
That is fine. What you wrote is understandable. |
Thank you for your hint. It is indeed possible to switch with a shortcut to the editor and to switch with a shortcut to the sidebar. But one shortcut would be even better to toggle editor/sidebar. That was the reason why I just open a new issue in Geany geany/geany#2914. |
question 1 question 2 question 3 issue 1 issue 2 suggestion for improvement 1
So, on your webpage "Building and Installing" there are those three commands together: ./autogen.sh, cd build-aux and make. suggestion for improvement 2 suggestion for improvement 3 Thank you for an answer in advance. |
Right now it's 0.0.1 because a number is needed to fill in parts of the build scripts. But that may never change because version numbers are arbitrary and it's extra work to change.
I personally dislike unstable interfaces like that (eg, disappearing tab bars), so it's not something I would include directly in the Preview plugin. What you describe can be done with a Lua script though. I have written auto-sidebar for you to do this. You should be able to figure out how to install it since you have some experience with the toggle-menu script. If you already have an
Thanks for letting me know. I'll make a correction. This shows why it is important to understand what the commands you are running are doing. In this case, the command simply didn't work. Some commands that are mistyped can damage the system. For example, if an
You are probably using an old copy of the source. I recently changed the If you already updated the source, you are probably missing another package.
Commands are typically presented grouped together that way. You can triple click to select a single line for copying. You can also paste the commands into Geany to examine and correct them before running them.
It's better to include the missing packages in the Now that I have setup this PPA, I'd expect people to use the |
Wow!! That's soooooooooo cool!! From its functionality, it works exactly like I imagined!! And from its effect, it is even better than I thought!! Like my question about automatically saving, I was sure that it was not possible to realize. I thought that it was a crazy idea of mine. I even hesitated to ask. Maybe you don't like the auto-sidebar, but for me it is absolutely superb!! Thank you so much!! remark Today, on the other computer I tried 4 different ways to install Geany-Preview. But all four ways failed. Is this because I use an old notebook with Celeron N3060? What I did: What I did: What I did: What I did: Thank you for an answer in advance. |
Glad you like it.
Does this happen only with the auto-sidebar? Are you using the
To change the default colors, create a new
You need: I'll add it to the instructions.
You need: I'll update the instructions.
I wrote the name of the package wrong. I will correct the instructions. But by the time you got the missing compiler error,
Did you restart Geany? Geany only loads plugin names at startup. What version of Ubuntu/Lubuntu are you running on the old laptop? What version of Geany is it using? |
question 1
I didn't found the extra_css option (nor in markdown.css nor in preview.conf), maybe because I did not update the latest version of the plugin. Then I did: question 2 issue 1 Now I have 9 vertical lines in Geany in different colors with a distance of about 2 cm. The lines are on the right side. I restarted Geany. issue 2 question 3
OK, so instead of website: suggestion for improvement 1 website: suggestion for improvement 2 website: contradiction 1 website: contradiction 2 website: suggestion for improvement 3 website: suggestion for improvement 4 website: suggestion for improvement 5 website: suggestion for improvement 6 idea 1
This sentence sounds a little bit strange to me. The sentence reminds me of the software Meld, where scrollbars are synchronized when comparing two documents. I don't know if this kind of sentence will lead to a solution, because Meld is not HTML, what means that it could be that someone is making a change at the very end of the HTML-source-code, but the change will appear on the top of the web-page. In the citation the scrollbars are in the focus, although the scrollbars are not the problem. The scrollbar of the editor and the scrollbar of the Preview have nothing in common, so there is no need to synchronize the scrollbars. The focus should not be on the scrollbars but on the change. What about this idea: Compare webpage with the webpage that is changing and show the change in the middle of Preview. On the other computer
Lubunru 21.04, Geany 1.37.1 After a reboot of the computer and after updating the system, Preview was still not there, and Preview was still not in the list of the plugins of Geany. Thank you for an answer in advance. |
I don't know what happened.
Now that you have installed both the PPA and package. The following should be enough:
Those are column markers. Geany has an option to show one column marker, but I prefer several. They're helpful to know where to put line breaks, like in
If you are seeing "the previous content of the txt-document", there might not be anything I can do about it.
I don't know. I don't see flashing on my computer. What happens if you turn off the It doesn't make sense to include instructions for specific packages because PPAs can have multiple packages. The instructions also assume people know how to use the package manager to install software. (Ubuntu Package Management)
I will read over your comments and make changes later.
Some Linux cache files may be out of date. I don't know how/why it happens. Try running:
|
Yes, now the vertical lines are gone.
I use an Intel Pentium N5000. Maybe your computer ist much faster. What's your processor? Try this:
Now I know what I see as text that is flashing in the sidebar of the tab of the HTML-document:
If I delete activated.lua and if I delete auto-sidebar.lua then I don't see a white flash and I don't see a text flashing. The transition is smooth.
Then I reboot the computer. Preview is still not in the list of the plugins. In the sidebar there is no Preview. Thank you for an answer in advance. |
I just solved the problem with the flash! In .config/geany/plugins/preview/1.css I choosed this content: Now there is no white flash any more and no white flashing text. I already mentioned the possible solution on this webpage two days ago:
Now auto-sidebar works perfect! |
I don't know why it works on one computer but not the other. Maybe files are not installed in the right place. Try using the following commands to check:
You can also try updating all system packages:
Then reinstalling packages of interest:
Glad you figured it out. This may work fine for you, but cannot be part of the plugin itself because that would make the text invisible by default.
The problem is related to showing/hiding the sidebar. I've made some changes to the plugin that might help. They will be available in the PPA momentarily. You can use |
To the other computer: This is what I did: find /usr -name "saveactions.so" sudo apt-get update sudo apt-get reinstall geany geany-plugins geany-plugin-preview The answer for find /usr -name "saveactions.so": The answer for find /usr -name "preview.so": After rebooting the computer: Preview is still not in the list of the plugins. There is no Preview In the sidebar. the plan
This is what I did: in preview.conf that is in /home/t/.config/geany/plugins/preview in the plugin preferences: I deleted activated.lua So, this means that there is an issue, because html-documents don't respect dark.css. Important remark: html-documents don't respect dark.css |
The preview plugin looks like it's being installed to the correct location.
Please let me know the results. I have not decided when I will switch to 21.10.
Are you rebooting the entire computer or just restarting Geany? Maybe it is just a language issue, but want to make sure because rebooting the computer is not necessary.
Since you've customized your background to be dark, it makes the colors white. I will change
The |
@ralf3u I changed the default css themes to try to make them work better with dark themes. It should be available from the PPA momentarily. After installing, please delete the old css files from your config folder, especially the following, if they exist:
Please try with |
I will test not only the PPA in 21.04 and 21.10 but I will also try to build it from the source for 21.04 and 21.10. So then all ways are tested. to the other computer:
answer: /usr/bin/geany
answer: (no answer)
answer something like: Not possible. File could not be found.
"Reboot the system", means to reboot the computer. I do reboot sometimes the computer to be sure that the changes are executed, even maybe it is not necessary. on this webpage there are two issues issue 1 issue 2
To the issue with the flash and dark.css: I will try to test it extensively tomorrow. |
When building from source, files are installed to a different location, and you will need to make a link. I mentioned the command before (
As far as I can tell, it should be working. You can try uninstalling and running
Then reinstall each package separately, running
Just wanted to make sure you knew it wasn't necessary in most of the cases that you've been rebooting. (Eg, after changing the
I will check.
Some things are kept in the readme, even if it is duplicated elsewhere. I will just have to correct the errors. You should take a look at the source code of various projects. Duplication is sometimes required by the programming language. Some are worse than others. In C/C++, most functions have to be declared and defined. The function name, return type, and parameters are stated exactly the same way twice in different locations. In some cases, the declaration and definition can be combined, but then it ends up being more work than just having them separate. Java is especially bad with a lot of "boilerplate" code. There is even a separate language that is basically designed to fix problems with Java. (Should I Use Kotlin Instead Of Java?) |
To the other computer. This is what I did: sudo apt-get purge geany geany-plugins geany-plugin-preview sudo apt-get install geany After rebooting the computer: Preview is still not in the list of the plugins. There is no Preview In the sidebar. |
git is the version control system (the git part of the name of this site, github). After 1.38 was released, they changed the version in the git repository to 1.39. If you download the source from geany/geany, it will say 1.39. |
@xiota I have again 9 vertical lines in Geany.
I think that with config file you mean not geany.conf, but you mean preview.conf. In preview.conf it does not work. Thank you for an answer in advance. |
@ralf3u It's in a different plugin – Xi/Tweaks. You can edit the config file with Tools/Xi/Tweaks/Edit Config File. |
point 1 point 2 point 3 point 4 |
It's probably a change from 1.38.
I forgot that I had ported toggle-menu. auto-sidebar won't be ported though because of how complicated it would be to manage user-selected filetypes.
Did you set
The new package is missing a dependency. I've updated the PPA. Dependencies are normally added automatically, but with the plugins it seems like they have to be added manually. I don't know why the difference. |
@xiota In which version of Geany the plugin Xi/Tweaks will be avaible without PPA? |
I don't understand this question. |
If someone is not using PPA, so if a person is only using |
Not anytime soon. Maybe never. Xi/Tweaks is a collection of miscellaneous tweaks that don't really belong anywhere else. I might submit the menubar changes to Geany proper. But even if it's accepted, it wouldn't be available in the package repository until after 1.39 is released... The time between releases for 1.36 to 1.37 to 1.38 was about a year (28-Sep-2019 to 20-Oct-2020 to 9-Oct-2021). Then it take some time for distros to package it. |
So, if I understand it right, if you would give code to Geany, toggle menu bar hidden/visible would be part of Geany. I think that would be really cool. I only can talk about myself that I missed this feature in Geany about a long period.
So, better now than later. |
Maybe. The change would have to be reviewed and accepted. I have several pull requests to add features pending. (Most of them are included as patches in the PPA.) |
Is this component in development? Will it be updated automatically when I update Geany Preview? |
WebKit2GTK is actively maintained. You can visit their website for more info: https://webkitgtk.org/ |
Will WebKit2GTK be updated automatically when I update Geany Preview or rather when will it be updated? |
It will be updated when Ubuntu updates the official package. Except for security updates and some special software (eg, Firefox), most packages updated when the next version of Ubuntu is released. Ubuntu 21.10 was released just a couple weeks ago. Ubuntu 22.04 LTS will be released in six months. Rendering behavior of WebKit2GTK probably comes from upstream, WebKit. |
Just for interest: How did you write both images down below as text on github.com? I ask this because I can't reproduce it in the "Write"-mode of github.com. Thank you for an answer in advance. |
It is markdown. For multiple quote levels, use:
For a block or monospace text, use three backticks in a row: ``` monospace ``` |
I don't know why it doesn't work for you.
|
Yes, your example works. But I can't reproduce this image: Both lines have different heights. So, how did you do that? What I can do is this:
But it is not exactly the same like the image because the smaller line is at the bottom and not at the top. The Write-mode looks like this:
Now if I do this:
... then it looks like that:
In that case both lines have the same height. Thank you for an answer in advance. |
|
@xiota Because of physical problems from now on I will be online only around 3 pm CET. |
@xiota My plan is to publish the next days every day a new issue. Then I have no suggestion for improvement any more. So, next week I intend to leave this project to concentrate on my physical problems. |
@ralf3u Thanks for your suggestions so far. You should focus on your health. |
@xiota In issue number 9 there is this conversation:
With the two features shortcut toggle editor/sidebar and auto-sidebar, Geany Preview is close to be perfect, specially for non-scrolling webpages. Geany Preview is so good, that I can imagine to work with Geany Preview every day, if my health would allow it. So, what about the idea to split Geany Preview in different plugins? |
The problem is having to manage two slightly different plugins.. If I fix a bug in one, I'd have to find and fix it in the other. With xi-tweaks, the two derivative plugins won't have much overlap. Everything that's working goes in one plugin, while the sidebar stuff that I can't get working goes in the other. I've also completely restructured the tweaks plugin to prepare it for potential submission to geany-plugins. (Pretty much a rewrite.) I plan to restructure the preview plugin also. (Many recent bugs have come from reorganizing the code to make managing settings easier.)
If submitted the plugins to geany-plugins now, access to the plugins would still be by PPA or building yourself for the next couple years. The next official release that could include these plugins is 1.39, but that probably won't be for another year, since 1.38 was released last month. After that, it would take some time for distros to update packages. I'll think more about whether to submit the preview plugin if submitting the tweaks plugin goes well. |
@xiota I have no further questions and no suggestions for improvement any more. |
@ralf3u Thank you for the feedback. I'll gradually go through your suggestions and determine whether/how to implement them. It won't be as fast as previous changes because I want to restructure the plugin to make it more manageable. Feel free to open new issues if you think of anything else. I hope the health issues you mentioned before improve. |
@ xiota
I have again no suggestions for improvement any more. With my suggestions I tried to go to the edge of maximum. Another thing is of course a) if it can be realized, b) if it is too complicated to realize, c) if it takes too much resource from the computer, and d) if you are willing to program it. At least all my suggestions for improvement could be a help for a redesign of Geany Preview because I think that all big suggestions for improvement are now on the table. Please leave me a message when the new Geany Preview is published. Thank you for a message in advance. And thank you for the incredible work for Geany Preview. Even if none of my actual suggestions will be realized, Geany Preview is for me a masterpiece. |
I'm interested in geany-preview because I would like to go in webdesign. But before to install geany-preview, I have some questions, to really know if the software fits my needs:
question 1
Can I change the vertical line in the middle of the screen with the mouse, so that the vertical line is more to the left or to the right?
question 2
Does it work exactly like htmlivecode.com where one can see live every change, or do I need first to save the changes to see a preview?
question 3
Is the HTML-Parser in the preview exactly the same like the HTML-Parser in Firefox?
question 4
Is there also a XML-Parser, so I can program in xhtml?
question 5
If there is a XML-Parser, is it exactly the same like the XML-Parser in Firefox?
question 6
If there is a XML-Parser, it is hard to program live in xhtml because it will show many times during coding a kind of mistake-page, so is there the option to show only a preview of the last saving, so I will not have many times a mistake-page?
question 7
Can I have different HTML-documents on the right side, so if I tab-browse on the left side I can see the corresponding preview on the right side?
question 8
I don't understand the two tabs Symbols and Documents on the right side of the picture. For what are they standing?
question 9
How can I disable the preview-area, so that the vertical line and the right side will disappear?
question 10
If a txt-document or a lua-document is shown on the left, I don't need to see a preview on the right side, so what will happen if I tab-browse on the left side between HTML-documents and suddenly there is on the left a txt-document?
question 11
Do I need to use the command (sudo apt pandoc asciidoctor) to see the preview of xhtml-documents?
question 12
Is it planned that geany-preview will be part of geany-plugins?
Thank you for answers in advance.
The text was updated successfully, but these errors were encountered: