retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.88k stars 196 forks source link

Live preview pan is blank #524

Open hadi-f90 opened 4 years ago

hadi-f90 commented 4 years ago

I installed Retext on python 3.8 installed win 10 PC and tried to open an .rst file. While the source would load flawlessly, live preview and preview of the .rst file shows a white blank page without anything. image

mitya57 commented 4 years ago

Do you have docutils Python package installed? Can you run ReText with python.exe instead of pythonw.exe and check if anything is printed to the terminal?

Do you have “Edit → Use WebEngine (Chromium) renderer” enabled?

hadi-f90 commented 4 years ago

Thanks, I gave all your possible solutions a try. Here is the result:

( Here's the errors in case they might be useful to you). image

PS1: I found Retext.exe in \Python38\Scripts. which is responsible for running Retext. PS2: The exported pdf is blank, too.

mitya57 commented 4 years ago

By the way, I don't have any chromium like browsers installed.

If you have PyQt packages from PyPI installed, then you also have Qt WebEngine which is based on Chromium. No need to install anything else.

I tried to run Retext by python.exe itself through site-package folder, but the files -that on my thought could be the probable main Retext files- all returned error by running through cmd.

Sorry, I did not tell you how to run it with python.exe. Can you try just python -m ReText? My hypothesis is that the renderer process crashes for some reason, and this should show the traceback.

Can you please also check if “Edit → View HTML code” shows anything meaningful?

hadi-f90 commented 4 years ago

I tried to run Retext by running python -m Retext and it didn't work. Although I had python 3.8 installed, it returned an error with this message: \Python38\python.exe: No module named retext hence, the html output was ok. I copied the html into a file and opened using Edge and it was functioning.

Alternatively, I cloned the repository to my desktop and ran python retext.py from the clone root directory in cmd. Here's the result: image By the way, I couldn't find out why icons were absent. As you can see, the preview pan is almost functioning. By the way, along with some syntactical errors, my source .rst file includes some lines the only Sphinx is capable of intepretting e.g. table of content. I couldn't find any .rst editor. Anyway, here's the resulting cmd output: image

PS: Retext is the only .rst editor that supports right to left languages like Persian very well well. For now it works for me. Thanks for taking time.

mitya57 commented 4 years ago

I tried to run Retext by running python -m Retext and it didn't work.

I think case is significant here. It should be ReText, not Retext.

Alternatively, I cloned the repository to my desktop and ran python retext.py from the clone root directory in cmd. Here's the result: By the way, I couldn't find out why icons were absent.

Please download the icons ZIP and unpack all icons from there to the icons directory inside the cloned repository.

Or simply run python setup.py sdist, it should do the same.

By the way, along with some syntactical errors, my source .rst file includes some lines the only Sphinx is capable of intepretting e.g. table of content.

Yes, unfortunately ReText uses pure reStructuredText, and does not support Sphinx constructions.

I couldn't find any .rst editor.

The only reStructuredText editor that supports Sphinx (and that I know) is livesphinx, but it works in a browser and I have never used it. Maybe I can steal some ideas from there, though.

Retext is the only .rst editor that supports right to left languages like Persian very well well.

I am surprised to hear that because I never did anything to support RTL languages specifically :) Anyway, glad to hear that. I guess some things may be improved, like line numbers can be on right side… Maybe also the editor pane should be on right.

mitya57 commented 3 years ago

Are there any remaining issues with the installation, or I can close this?

hadi-f90 commented 3 years ago

Sorry for my delay. For the being time, I gave it a try in Win 10 and here is the result:

  1. The Soft wrapping, now, wraps the text pretty well, while it might need some work to have a better human friendly look (As you will see in the pictures below, the text should flush to the right-most part of the widget and the empty space created by wrap text should go to the left. I don't know if it is a Qt widget problem of not. If you managed to do this the Text Statics would look better if they go to the left side for RTL languages).

  2. Now, the Rendering Engines work well without any error. The preview pan itself and the pictures load and show up well using both of the rendering engines.

  3. I think both Cursor line and Wrapped Line mode now work fine, too.

Cursor Line mode image

Wrapped Line image

  1. Regarding the formatting Buttons, I found that, as you said, the buttons are disabled, whereas; the Edit ->Formatting section menu is enabled and works fine. As far as I remember, these Button were all enabled in Linux Mint 20, but it is faint since it was long time ago and I don't remember whether the document I was working with in Linux was .rst or .md. Anyway, I'll let you know as soon as I tested in Linux. I don't know whether I should report it in a new issue or I should follow it here, if it was.

  2. Finally, I couldn't locate the language change section to see how the translation would look like. and I got a pychant dictionary error:

RuntimeWarning: Dictionary for language 'Persian_Iran' could not be found Please check https://pyenchant.github.io/pyenchant/ for details.

mitya57 commented 3 years ago
  1. The Soft wrapping, now, wraps the text pretty well, while it might need some work to have a better human friendly look (As you will see in the pictures below, the text should flush to the right-most part of the widget and the empty space created by wrap text should go to the left. I don't know if it is a Qt widget problem of not. If you managed to do this the Text Statics would look better if they go to the left side for RTL languages).

Yes, unfortunately it's a Qt problem. I will try to create a minimal example and submit a bug upstream. I will keep you updated on this.

  1. Regarding the formatting Buttons, I found that, as you said, the buttons are disabled, whereas; the Edit ->Formatting section menu is enabled and works fine.

Right, I think it's the expected behavior. If you need quick access to the actions available in the Formatting menu, you can use shortcuts like Ctrl+B, etc.

  1. Finally, I couldn't locate the language change section to see how the translation would look like.

I will pull the translations from Transifex before making a new release, which will be soon (before end of January, I think).

Until that you can try to download a .ts file from Transifex, put it as locale/retext_fa.ts, then run lrelease locale/retext_fa.ts to generate a locale/retext_fa.qm from it. (lrelease is available as part of Qt tools).

and I got a pychant dictionary error: RuntimeWarning: Dictionary for language 'Persian_Iran' could not be found

It is only related to spell checking. Try using fa_IR instead of Persian_Iran, maybe that will work?

mitya57 commented 3 years ago

I will try to create a minimal example and submit a bug upstream. I will keep you updated on this.

Upstream bug created: https://bugreports.qt.io/browse/QTBUG-91125. Sorry for the delay again — I have too little time and too many issues to work on :(