andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 39 forks source link

QtWebKit is deprecated #410

Closed rapgro closed 5 years ago

rapgro commented 8 years ago

Can we make WebKit optional? I see it's used for a widget, propably to render some html document. Does the user need it for "normal" text files? If it's optional widget, we could use a weak dependency in Fedora. Please also notice that QtWebKit is deprecated in favor of QtWebEngine. https://wiki.qt.io/Porting_from_QtWebKit_to_QtWebEngine

bjones1 commented 8 years ago

From your perspective, does it matter if I have and optional WebKit dependency or port to QtWebEngine? I'm considering just doing the port instead of optionally disabling the widget.

rapgro commented 8 years ago

:+1: QtWebEngine

Optional was a suggestion only to reduce dependencies by one. But it breaks a feature of course, it's now possible to use so called weak dependencies in Fedora.

andreikop commented 8 years ago

@rapgro, what are QWebKit and QWebEngine package names on Fedora? I'd like to give users a hint which package to install to get Preview working

andreikop commented 8 years ago

Oops, I closed wrong issue. QWebKit is optional now, but we haven't migrated to QtWebEngine

rdieter commented 8 years ago

Fedora's runtime library package names are: qt5-qtwebkit, qt5-qtwebengine , the python3 bindings names: python3-qt5-webkit, python3-qt5-webengine

andreikop commented 8 years ago

Thanks, I've added a hint

flintiii commented 7 years ago

Greetings Andrei Kopats,

I am operating on an Ubuntu platform:

root@seltzer:~/trantor/doc# cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=16.04 DISTRIB_CODENAME=xenial DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"

After resorting to installing enki and qutepart from source, you did a great job there, I fire up enki and in the preview window get the following error:

"Qt5 Webkit not found. Preview is not available"

There is no right hand preview window. Qt5 Webkit appears to have been installed due to the requirements of Cura as shown below:

"Qt5 Webkit not found. Preview is not available"

There is no right hand preview window. Qt5 Webkit appears to have been installed due to the requirements of Cura as shown below:

apt-get install python3-pyqt5.qtwebkit Reading package lists... Done Building dependency tree Reading state information... Done python3-pyqt5.qtwebkit is already the newest version (5.6+dfsg-1~cura~ppa~201609120727~6~ubuntu16.04.1). 0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

Can you help me to determine how to get the preview window running in enki?

Thanks in advance and...

Kindest Regards,

bjones1 commented 7 years ago

@flintiii, I've done most of the port, but don't have unit tests updated yet. However, it depends on very new Qt (5.7) -- you will probably need to sudo pip install -U pyqt5. My branch with these changes is at https://github.com/bjones1/enki/tree/qtwebengine. Feedback is welcome!

flintiii commented 7 years ago

Dear Brian,

Thanks a lot for your kind response.

Apparently, the enki editor has a patron in Red Hat, something I find very excellent. Intrepidly I chose to install enki on Ubuntu trusty. Despite many dedicate hours at the keyboard, and based upon guidance from a friend:

$ sudo -i $ add-apt-repository ppa:hlamer/enki $ cd /etc/apt/sources.list.d/ $ perl -p -i -e "s|trusty|raring|g;" hlamer-ubuntu-enki-trusty.list $ mv hlamer-ubuntu-enki-trusty.list hlamer-ubuntu-enki-raring.list $ apt update $ apt install enki

I started with this, but got nothing working. So I wacked away at the console, partially succeeding when I brought the source files down to the Ubuntu machine using git clone, did setup.py install and got enki running. The result:

Version on Ubuntu machine is: Version 16.04.1 Qutepart 3.0.1 (with binary parser) Qt 5.7.0

But try as I might I could never get the preview window running. This message was always in the preview window on the Ubuntu machine:

Qt5 Webkit not found. Preview is not available. Install python3-pyqt5.qtwebkit package on Debian based distributions, python3-qt5-webkit on Fedora

So I traced this error down in the source code, and actually wrote a quick test program to run as I troubleshot the issue:

1test.py

!/usr/bin/python3.5

import PyQt5.QtWebKitWidgets

I never got this working.

This morning I started up again on a Linux Mint 18 machine. I used my friends script as shown above and immediately got enki working on this Mint 18 distribution. The preview error was different...

ReStructuredText preview requires python-docutils package Install it with your package manager or see this page

after installation of python-docutils enki with the previewer takes off. It is Enki Version 13.09.2 Uses sQtepart 1.1.0

That said, the damn thing installed with minimum of fuss (other than to subsequently install python-docutils to get the enki previewer to take off), and am really very happy with enki as a tool.

That said, any idea what to do about Ubuntu trusty?

Running enki remote has already helped me with some restful text issues but it is a bit slow via remote X.

Thanks again and...

Kindest Regards,

Paul

On Mon, 28 Nov 2016, Bryan A. Jones wrote:

Date: Mon, 28 Nov 2016 07:36:58 -0800 From: Bryan A. Jones notifications@github.com Reply-To: andreikop/enki <reply+000db73508a4683637a83e217c5359c3fffcbe9a40a321f092cf000000011454111 a92a169ce090210a8@reply.github.com> To: andreikop/enki enki@noreply.github.com Cc: Paul Flint flint@flint.com, Mention mention@noreply.github.com Subject: Re: [andreikop/enki] QtWebKit is deprecated (#410)

@flintiii, I've done most of the port, but don't have unit tests updated yet. However, it depends on very new Qt (5.7) -- you will probably need to sudo pip install -U pyqt5. My branch with these changes is at https://github.com/bjones1/enki/tree/qtwebengine. Feedback is welcome!

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/andreikop/enki/issues/410#issuecomment-263303045

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

bjones1 commented 7 years ago

Does sudo pip install -U pyqt5 work / produce anything helpful? That should make your 1test.py work...

flintiii commented 7 years ago

Greetings Bryan,

Here it is:

**** start flint@seltzer:~/enki$ sudo pip install -U pyqt5 [sudo] password for flint: The directory '/home/flint/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

The directory '/home/flint/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

**** note the above is expected with the sudo of pip.

Requirement already up-to-date: pyqt5 in /usr/local/lib/python3.5/dist-packages Requirement already up-to-date: sip in /usr/local/lib/python3.5/dist-packages (from pyqt5) [1]+ Done gedit install_note_2016-11-28 flint@seltzer:~/enki$ bin/1test.py Traceback (most recent call last): File "bin/1test.py", line 2, in import PyQt5.QtWebKitWidgets ImportError: No module named 'PyQt5.QtWebKitWidgets' **** end

Bryan, what include module does "PyQt5.QtWebKitWidgets" live in?

Thanks a bunch and...

Kindest Regards,

Paul

On Mon, 28 Nov 2016, Bryan A. Jones wrote:

Date: Mon, 28 Nov 2016 09:00:42 -0800 From: Bryan A. Jones notifications@github.com Reply-To: andreikop/enki <reply+000db7353f5f68fb6d4fdb39453e233542a2b10f629e43b592cf00000001145424b a92a169ce090210a8@reply.github.com> To: andreikop/enki enki@noreply.github.com Cc: Paul Flint flint@flint.com, Mention mention@noreply.github.com Subject: Re: [andreikop/enki] QtWebKit is deprecated (#410)

Does sudo pip install -U pyqt5 work / produce anything helpful? That should make your 1test.py work...

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/andreikop/enki/issues/410#issuecomment-263327974

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

bjones1 commented 7 years ago

Use import PyQt5.QtWebEngineWidgets instead.

flintiii commented 7 years ago

Ah. I've been doing a LOT of PyQt and PySide work and had all the requisite packages, which is why my instructions worked for me but not for you. Add in:

$ sudo apt install python-pyqt5.qtwebkit python3-pyqt5.qtwebkit

I'd report to the Launchpad maintainer(s) that there needs to be a dependency written into the Debian package -- or maybe to the Debian maintainer(s).

And, of course, there may be other dependencies waiting in the wings.

bjones1 commented 7 years ago

Thanks. But, I'm a bit confused. Do you means that:

Pardon my confusion, I primarily develop on Windows and haven't booted by Ubuntu to try things there.

flintiii commented 7 years ago

Greetings again Bryan,

Finally getting annoyed enough at Enki via a remote X session that I chose to take another shot at Enki on Ubuntu 16.04. Fact is that my methodology likely muddied the waters, and contributed to your confusion. Where I had success last November was when I installed from source.

I would look forward to cloning your source from you git repository. I am gonna look around for it but if you get a chance please send me a URL.

Thanks in advance and...

Kindest Regards,

Paul

flintiii commented 7 years ago

Bryan,

One interesting observation: When I start enki, in the preview pane (pain :^) I get the now traditional message (which by the way you cannot copy and paste...):

"Qt5 Webkit not found. Preview is not available. Install python3-pyqt5.qtwebkit package on Debian based distributions, python3-qt5-webkit on Fedora"

Then upon exiting the program, I type the following: # apt-get install python3-pyqt5.qtwebkit Reading package lists... Done Building dependency tree Reading state information... Done python3-pyqt5.qtwebkit is already the newest version (5.5.1+dfsg-3ubuntu4). 0 upgraded, 0 newly installed, 0 to remove and 74 not upgraded. Thus leading me to assume my machine is in a quantum state where python3-pyqt5.qtwebkit is both installed and un-installed. I continue to research this interesting phenomena.

Regards,

Paul

bjones1 commented 7 years ago

@flintiii, I now have a beta version of Enki installable via PyPI. This should help. Try:

sudo apt-get install build-essential libpcre-dev exuberant-ctags
sudo pip install -U pip https://dl.dropboxusercontent.com/u/2337351/enki-16.4.1-py3-none-any.whl
flintiii commented 7 years ago

Greetings Bryan,

I cloned your github image:

Followed along and actually got enki working (good news) Bad News - No WYSIWIG Preview mode. This takes all the fun out of it. So I tried your latest approach, and almost completed step 1...

`

sudo apt-get install libpcre-dev

Reading package lists... Done Building dependency tree
Reading state information... Done E: Unable to locate package libpcre-dev

` Possible candidates to replace include:

Any idea how to proceed?

Thanks and...

Kindest Regards,

Paul

flintiii commented 7 years ago

Greetings again Bryan,

I decided that installing libpcre3-dev was a good guess. Did it and discovered it already installed.

Then I tried your really fancy pip install (so many cool arguments, and to a drop box repo!).

THIS WORKED! (sorry for the caps!) Under Ubuntu 16.0.4. Put this in a box and ship it out!!!

If you need more testing help I am your man.

Thanks a lot and...

Kindest Regards,

Paul

bjones1 commented 7 years ago

Great! Glad you got it working. I need to fix up my tests before officially releasing this, but I'll let you know when it's ready for more testing!

flintiii commented 7 years ago

Greetings Bryan Jones,

Any particular reason why a plain working .. toctree:: directive would break in enki? Am I doing something wrong with my config.py or even the default.css?

Note the Sphinx eats the .rst file (index.rst in this case) and puts out a nice list of linkable elements. When I load this code into enki, I hget this error:

System Message: ERROR/3 (, line 392)

Unknown directive type "toctree".

The very same code runs in a web site after I do:

sphinx-build -b html ./ test ;

Any idea why enki would choke on such a simple thing?

Thank and....

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

bjones1 commented 7 years ago

It processes the file with docutils, not Sphinx, by default. Go to Settings | Settings, pick Sphinx, then enable it and specify your project directory.

flintiii commented 7 years ago

Dear Bryan,

Ahem...

Thanks!!!!

Regards,

Flint

On Wed, 15 Feb 2017, Bryan A. Jones wrote:

Date: Wed, 15 Feb 2017 12:53:22 -0800 From: Bryan A. Jones notifications@github.com Reply-To: andreikop/enki <reply+000db7357f9b05fd41be73139cc77ad9cc8a9c16258609fc92cf0000000114bc81c 292a169ce090210a8@reply.github.com> To: andreikop/enki enki@noreply.github.com Cc: Paul Flint flint@flint.com, Mention mention@noreply.github.com Subject: Re: [andreikop/enki] QtWebKit is deprecated (#410)

It processes the file with docutils, not Sphinx, by default. Go to Settings | Settings, pick Sphinx, then enable it and specify your project directory.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/andreikop/enki/issues/410#issuecomment-280135336

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

flintiii commented 7 years ago

Good Morning Bryan Jones,

I am really liking enki, and would very much like to participate in the development process. I suppose the best way for me to do so now is to continue to ask stupid questions...

The first one is a conf.py question.

What do I do to conf.py in order to get this message to go away"

"Warning: assuming .html extension. Use the conf.py template to set the extension."

I looked but it did not jump out at me.

The second, I suspect a minor cute (QT) issue.

Neither of the "reload" shortcuts , work on my instance (Version 16.04.1 Qutepart 3.0.1 (with binary parser) Qt 5.7.1). This turns out to be very useful if you are validating auto-generated code you are then submitting to sphinx. In addition I will report this to the enki bug tracker.

Again, what an astounding editor. Thanks!!!

If there were a feature I could want in enki, it would be the ability to fold or collapse around some keyword or stigil... I am not yet clear on how this would work specifically, let me continue to use it and maybe I can focus a use case.

Anyway have a great day and...

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

bjones1 commented 7 years ago

To fix your conf.py, see https://github.com/andreikop/enki/blob/master/enki/plugins/preview/sphinx_templates/conf.py#L181 - paste this in:

html_file_suffix = '.html'

# **Sphinx note:** `Enki <http://enki-editor.org/>`_, which hosts Sphinx,
# needs to know this value. So, save it to a file for Enki_ to read.
import codecs
try:
    with codecs.open('sphinx-enki-info.txt', 'wb', 'utf-8') as f:
        f.write(html_file_suffix)
except NameError as TypeError:
    # If ``html_file_suffix`` isn't defined (NameError) or is None (TypeError),
    # Enki will assume ``.html``.
    pass
bjones1 commented 7 years ago

I can't reproduce your reload failures -- when I modify a file outside of Enki, F5 reloads it. ???

bjones1 commented 7 years ago

I'd welcome any contributions! One area in need of help is getting the tests working again after I ported to QtWebKitWidgets -- I don't want to add any features until the tests pass...

flintiii commented 7 years ago

Dear Bryan,

I must stop using my TRS/DOS system I suppose...

I will try to figure it out and get back to you.

Thanks,

Flint

On Thu, 16 Feb 2017, Bryan A. Jones wrote:

Date: Thu, 16 Feb 2017 07:58:24 -0800 From: Bryan A. Jones notifications@github.com Reply-To: andreikop/enki <reply+000db735e26de742b39468378e328cf0ba7ee0dafa0d5e3b92cf0000000114bd8e2 092a169ce090210a8@reply.github.com> To: andreikop/enki enki@noreply.github.com Cc: Paul Flint flint@flint.com, Mention mention@noreply.github.com Subject: Re: [andreikop/enki] QtWebKit is deprecated (#410)

I can't reproduce your reload failures -- when I modify a file outside of Enki, F5 reloads it. ???

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/andreikop/enki/issues/410#issuecomment-280371602

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

flintiii commented 7 years ago

Greetings Bryan,

This coincides with my ardent desire to master Python unit testing.

Regards,

Flint

On Thu, 16 Feb 2017, Bryan A. Jones wrote:

Date: Thu, 16 Feb 2017 08:00:34 -0800 From: Bryan A. Jones notifications@github.com Reply-To: andreikop/enki <reply+000db7351f1811efc6234ccb523aea73487c01cf57ed8c0192cf0000000114bd8ea 292a169ce090210a8@reply.github.com> To: andreikop/enki enki@noreply.github.com Cc: Paul Flint flint@flint.com, Mention mention@noreply.github.com Subject: Re: [andreikop/enki] QtWebKit is deprecated (#410)

I'd welcome any contributions! One area in need of help is getting the tests working again after I ported to QtWebKitWidgets -- I don't want to add any features until the tests pass...

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/andreikop/enki/issues/410#issuecomment-280372286

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

bjones1 commented 7 years ago

Great! You'll need to work on my branch, which has the changes. See https://github.com/bjones1/enki/tree/qtwebengine.

flintiii commented 7 years ago

Bryan,

Trying to install enki on a Linux Mint Cinnamon system,

uname -a Linux trantor 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

cat debian_version

stretch/sid

I am almost convinced that the best thing for installation of enki might be a shell script or a docker image.

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

bjones1 commented 7 years ago

@flintiii, did you run into a specific error? Or is a general recommendation? @andreikop does releases, so you can install an Enki package.

flintiii commented 7 years ago

Greetings Bryan,

Indeed I did run into specific errors.

I am going to resend the email with the error gui as a MIME attachment.

Thanks and...

Kindest Regards,

Paul

On Wed, 19 Apr 2017, Bryan A. Jones wrote:

Date: Wed, 19 Apr 2017 09:01:33 -0700 From: Bryan A. Jones notifications@github.com Reply-To: andreikop/enki <reply+000db73591bf67d1154bd8475ce6bfa9810bc4e08640719492cf00000001150f4bd d92a169ce090210a8@reply.github.com> To: andreikop/enki enki@noreply.github.com Cc: Paul Flint flint@flint.com, Mention mention@noreply.github.com Subject: Re: [andreikop/enki] QtWebKit is deprecated (#410)

@flintiii, did you run into a specific error? Or is a general recommendation? @andreikop does releases, so you can install an Enki package.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/andreikop/enki/issues/410#issuecomment-295323209

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

flintiii commented 7 years ago

Greetings Bryan,

Given my ongoing difficulties in popularizing enki via installation, what do you think of the idea of developing an enki Appimage?

Kindest Regards,

☮ Paul Flint (802) 479-2360 Home (802) 595-9365 Cell

/**** Based upon email reliability concerns, please send an acknowledgement in response to this note.

Paul Flint 17 Averill Street Barre, VT 05641

bjones1 commented 7 years ago

Packaging Enki has long been a weakness for me. Thoughts on this:

So, my final conclusions are:

How familiar with appimage are you? Would you be able to help with this?

dglent commented 7 years ago

For Linux there is no reason to resolve and install the dependencies with the setup.py Is the job of the packager of each distribution to do this

bjones1 commented 5 years ago

Current Enki doesn't depend on webkit.