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
12 stars 0 forks source link

empty preview for txt-documents as option #29

Closed ralf3u closed 2 years ago

ralf3u commented 2 years ago

The preview of txt-documents shows nearly the same content like the content of the editor. One option is the auto-sidebar to hide the preview of txt-documents (mentioned in issue number 1). But maybe some users will not like that the vertical line between editor and preview appears and disappears while tab-browsing. So, another option could be to show a completely empty preview, with something like empty_preview_for_txt=false as default setting in preview.conf. The setting empty_preview_for_txt=true would then show a completely empty preview. Personally, I think that I would use it sometimes as variation.

xiota commented 2 years ago

I've gone back and forth between making plain text show or not in the preview pane. So I guess it is time to turn it into an option.

ralf3u commented 2 years ago

I've gone back and forth between making plain text show or not in the preview pane. So I guess it is time to turn it into an option.

When I opened this issue, I had myself also some doubts, but I was not able to explain why. Today I know the reason. The reason is because once you offer this option, then one should be consequent by offering the option for all other formats, because it would make sense also for css, js, conf and lua. At the moment for those formats there is this text in the preview: "Unable to process type: ..." The text could disturb a user in a long-term. So, what about the idea to offer more options, like in auto-sidebar, where the user can add the formats? Personally something like that would be my settings: empty_preview_txt=true empty_preview_js=true empty_preview_css=true empty_preview_lua=true empty_preview_conf=true

ralf3u commented 2 years ago

I just recognized that the problem "Unable to process type: ..." mentioned in my last comment could be solved easily by css: If the values color und the background have the same color, then the text is invisble. But it is not a clean solution. And for long txt-documents, even when the preview is then invisible, it can be that scrollbars appears on the right and on the bottom, what looks quite strange.

xiota commented 2 years ago

That's too many options to keep track of. The difference with txt is sometimes emails are saved with txt extension. In that case, it might be worth showing them in the preview with basic formatting. (But not if people will expect every single format to have an on/off option).

A blank preview can make it look like the preview isn't working. (Is it supposed to be blank, or is it broken?) Instead of "Unable to process type", it should probably say "unsupported type".

ralf3u commented 2 years ago

That's too many options to keep track of.

OK, I just changed the title of this issue. So, the title of this issue is again like it was at the beginning.

The difference with txt is sometimes emails are saved with txt extension. In that case, it might be worth showing them in the preview with basic formatting.

I don't understand so much. If the option would be realized, then there are two possibilities: Either the txt-document is shown in the preview or there is an empty preview with no scrollbars. And what has that to do now with "it might be worth showing them in the preview with basic formatting"?

ralf3u commented 2 years ago

Remark In the new version of Geany Preview there is now an empty preview for txt-documents. And for long txt-documents there are no scrollbars in the preview, as it should be. But I don't see a possibility in preview.conf to turn this feature off.

xiota commented 2 years ago

The preview is not shown for text documents unless it is detected as a supported type. There's no option because the preview would be identical to what's already in the editor, and I don't want to go down the path where every file format has an option.

You can force the preview to show by adding "Format: plain" to the beginning of the document. This can also be used to change the format, "Format: markdown". This isn't currently documented anywhere, but it's been part of the plugin for a while. (Before the mess with the preview-headers.css/preview.css file.)

ralf3u commented 2 years ago

@xiota

Before the mess with the preview-headers.css/preview.css file.

You can change it again from preview.css to preview-headers.css, so that there is no mess any more. I didn't know to that time (where I made the suggestion to short the name) that the name preview-headers.css has to do something with emails.

xiota commented 2 years ago

The mess wasn't the name change, but that it wasn't working properly. Now that it's working, better to leave it alone.

xiota commented 1 year ago

Somewhat related to this issue. Just added an option to set the default file type for newly created documents. Haven't updated the PPA yet because not using Ubuntu anymore. Need to set up a container to run the commands.