Open andrewmortag opened 3 years ago
Hi!
It looks like these errors are not specific to ReText, but also happen with other Qt / PyQt applications using Qt WebEngine.
Is the preview completely blank for you, or only some of the content is missing? Does this happen with only a specific document or with all documents? Also can you check if unselecting “Edit → Use WebEngine (Chromium) renderer” helps?
Hi Thank you for reply.
My observations so far:
I loaded first a rst doc i made with a different editor (geany) in order to see the preview effect => the preview doesn't work. It's completly blank.
I opend Retext, started a new doc and enterd some rst formated text => the preview shows pretty formated text.
Checking or unchecking of the option "Edit → Use WebEngine (Chromium) renderer" dosent't seem to have an effect. Rst in a new window is shown in preview. The loaded file made with a different editor results in a complete blank preview.
It is possible to start Retext from cmd or powershell and the preview is working in case of rst text in a new text window.
It is not possible to start Retext directly in explorer from C:\Program Files\Python39\Scripts until i start with "run as admin".
The 2 selectors "format" and "symbols" are disabled all the time. What to do for enabling the selectors?
Regards, Andrew
The behavior you are describing is very strange. I want to ask you some questions that may shed more light on this:
<body>
and </body>
?It is not possible to start Retext directly in explorer from C:\Program Files\Python39\Scripts until i start with "run as admin".
This may also be a clue. ReText uses a separate process for rendering. Maybe there are some issues with permissions for that process?
I have very little knowledge of Windows so I can’t say why it happens. ReText definitely does not need administrator/superuser rights for anything. And it’s surprising that python -m ReText
works and calling the script directly does not. Maybe you can try changing some permissions of that script?
The 2 selectors "format" and "symbols" are disabled all the time. What to do for enabling the selectors?
It is normal. These boxes are only for Markdown and not for reStructuredText. In fact, I consider them of little use even for Markdown, but some users like them so I keep them for now.
markups
package.C:\Program Files\Python39
where python
in CMD -> should print: C:\Program Files\Python39\python.exe
pip install ReText pyenchant PyQtWebEngine
where retext
in CMD -> should print: C:\Program Files\Python39\Scripts\retext.exe
Close ReText
Run Notepad++
as-admin and
C:\Program Files\Python39\Lib\site-packages\markups\restructuredtext.py
Change the following code:
class CustomHTMLTranslator(HTMLTranslator):
def starttag(self, node, tagname, suffix='\n', empty=False, **attributes):
if node.line is not None:
attributes['data-posmap'] = node.line
return super().starttag(node, tagname, suffix, empty, **attributes)
To look like:
class CustomHTMLTranslator(HTMLTranslator):
def starttag(self, node, tagname, suffix='\n', empty=False, **attributes):
if (node is not None) and hasattr(node, 'line') and (node.line is not None):
attributes['data-posmap'] = node.line
return super().starttag(node, tagname, suffix, empty, **attributes)
Ctrl+S and close Notepad++
Open ReText from CMD non-admin by either of:
retext
python -m ReText
All .rst files should now render without issues
Hi, im running W10, Python39 and have ReText 7.2.1 installed by pip3 with all mentioned packages. I want to use this amazing editor for rst texts. Unfortunatly the preview in Retest dosn't work.
Regards, Andrew
Python -m Retext in powershell show up with:
PS C:\WINDOWS\system32> python -m ReText Using configuration file: C:/Users/UsEr/AppData/Roaming/ReText project/ReText.ini C:\Program Files\Python39\lib\site-packages\ReText\window.py:404: RuntimeWarning: Dictionary for language 'de_DE' could not be found Please check https://pyenchant.github.io/pyenchant/ for details warnings.warn(str(e), RuntimeWarning) [1584:15984:0522/145536.758:ERROR:cache_util_win.cc(19)] Unable to move the cache: 5 [1584:15984:0522/145536.758:ERROR:cache_util.cc(140)] Unable to move cache folder C:\Users\UsEr\AppData\Local\ReText project\ReText\QtWebEngine\Default\GPUCache to C:\Users\UsEr\AppData\Local\ReText project\ReText\QtWebEngine\Default\old_GPUCache_000 [1584:15984:0522/145536.759:ERROR:disk_cache.cc(168)] Unable to create cache [1584:15984:0522/145536.762:ERROR:shader_disk_cache.cc(620)] Shader Cache Creation failed: -2