Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 08-16-2021, 02:23 PM   #16
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by DiapDealer View Post
That sounds an awful lot like the built-in clipboard history feature.



Wait....Wut???


Please don't tell me I missed another function that Sigil does so well already.....




Turtle91 is online now   Reply With Quote
Old 08-16-2021, 09:20 PM   #17
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
On a Windows computer, pressing windows-V give you a history to paste from. This works in Sigil and most other programs.
DNSB is offline   Reply With Quote
Advert
Old 08-16-2021, 09:32 PM   #18
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
Or as DiapDealer said use Sigil's Edit/Paste From Clipboard History... menu item or key shortcut on any platform. You can highlight any clipboard history item to paste or use the delete key to remove it from the history.
KevinH is offline   Reply With Quote
Old 08-16-2021, 09:50 PM   #19
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It also saves the history between Sigil sessions (the preference setting determines how many are saved between sessions)
DiapDealer is offline   Reply With Quote
Old 09-04-2021, 06:25 AM   #20
fxp33
Addict
fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.
 
Posts: 261
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
Pasting

Hi all,

Maybe far from the original post title, but as the conversation was on the pasting topic I continue here.

The process is:
  1. copy from a web page
  2. go to sigil
  3. ctrl+v
  4. choose plain text
  5. or choose html

Here is what I meant... in images: https://www.youtube.com/watch?v=NAXWuLJN3lI

Hope this helps
Cheers
fxp33 is offline   Reply With Quote
Advert
Old 09-04-2021, 07:53 AM   #21
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
Just use PageEdit with Sigil. It will do exactly what you want.

Quote:
Originally Posted by fxp33 View Post
Hi all,

Maybe far from the original post title, but as the conversation was on the pasting topic I continue here.

The process is:
  1. copy from a web page
  2. go to sigil
  3. ctrl+v
  4. choose plain text
  5. or choose html

Here is what I meant... in images: https://www.youtube.com/watch?v=NAXWuLJN3lI

Hope this helps
Cheers
KevinH is offline   Reply With Quote
Old 09-04-2021, 12:21 PM   #22
fxp33
Addict
fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.
 
Posts: 261
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
Quote:
Originally Posted by KevinH View Post
Just use PageEdit with Sigil. It will do exactly what you want.
Well, using a 160Mo external editor was not my idea of a simple pasting option 😉

I hoped more for an addition of ten lines of code:

javascript
Code:
document.addEventListener('paste', function (evt) {
  document.getElementById("plain").textContent = evt.clipboardData.getData('text/plain');
  document.getElementById("html").textContent = evt.clipboardData.getData('text/html');
}
Python gtk
Code:
#!/usr/bin/env python
import gtk
print (gtk.Clipboard().wait_for_contents('text/html')).data

qt
Code:
void DropArea::paste()
{
    const QClipboard *clipboard = QApplication::clipboard();
    const QMimeData *mimeData = clipboard->mimeData();

    if (mimeData->hasImage()) {
        setPixmap(qvariant_cast<QPixmap>(mimeData->imageData()));
    } else if (mimeData->hasHtml()) {
        setText(mimeData->html());
        setTextFormat(Qt::RichText);
    } else if (mimeData->hasText()) {
        setText(mimeData->text());
        setTextFormat(Qt::PlainText);
    } else {
        setText(tr("Cannot display data"));
    }
fxp33 is offline   Reply With Quote
Old 09-04-2021, 01:00 PM   #23
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
Huh? That code exists in PageEdit and it can easily be launched and run. It is meant to be integrated into Sigil which has an easy way to launch it.

Sigil's CodeView editor is not a browser window and always pastes html/text as its base property since it is an xhtml code editor where copy and paste of code snippets are always done. Almost all copies made in CodeView typically includes html tags or partial html as text. You can not paste into a CodeView formatted rich text or images. You are confusing the target (a pure text code editor vs a browser like dom editor (Old BookView and PageEdit).

PageEdit is exactly like old Sigil's BookView and pasting formatted text into the PageEdit browser window is handled as you would expect.

Last edited by KevinH; 09-04-2021 at 01:05 PM.
KevinH is offline   Reply With Quote
Old 09-04-2021, 01:15 PM   #24
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
@fxp33

If the feature is that important to you, why not use a plugin? The following code should do the trick:

Spoiler:
Code:
# -*- coding: utf-8 -*-
import sys
from PyQt5.Qt import QApplication

def run(bk):
    app = QApplication(sys.argv)
    clipboard = QApplication.clipboard()
    mime_data = clipboard.mimeData()
    
    if mime_data.hasHtml():
        app.clipboard().setText(mime_data.html())

    return 0

def main():
  print ("I reached main when I should not have\n")
  return -1

if __name__ == "__main__":
  sys.exit(main())


Just assign it one of the 10 plugin shortcuts and a corresponding keyboard shortcut, and you're good to go.

However, you might want to consider using PageEdit instead, because it'll significantly clean up the messy HTML code that some apps will copy to the clipboard.
Attached Files
File Type: zip CopyHTML.zip (1.6 KB, 145 views)
Doitsu is offline   Reply With Quote
Old 09-05-2021, 11:09 AM   #25
fxp33
Addict
fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.
 
Posts: 261
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
Quote:
Originally Posted by Doitsu View Post
@fxp33
Just assign it one of the 10 plugin shortcuts and a corresponding keyboard shortcut, and you're good to go.
Hi Doitsu,

Yep, the plugin was my intention... and this is precisely why I was hoping I could get a hint on "how to insert text at cursor position" in this thread. I opened a lot of plugins to try and understand how to do that... 😉

Thanks a lot for packaging and rewriting the code into a plugin... And of course, I will indeed, check with pageEdit 👍

Best regards
François
fxp33 is offline   Reply With Quote
Old 09-05-2021, 11:37 AM   #26
fxp33
Addict
fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.fxp33 figured out that Keyser Söze was the Kevin Spacey character in less than 20 minutes.
 
Posts: 261
Karma: 110864
Join Date: Mar 2013
Location: Bordeaux, France
Device: Kobo Glo, Aura HD, kindle paperwhite
Quote:
Originally Posted by KevinH View Post
Huh? That code exists in PageEdit and it can easily be launched and run. It is meant to be integrated into Sigil which has an easy way to launch it.

PageEdit is exactly like old Sigil's BookView and pasting formatted text into the PageEdit browser window is handled as you would expect.
Yes Kevin, I see that I can have:
  • raw text: with a paste in Sigil
  • original html: with all the code and classes (PageEdit ctrl+v)
  • structured text: linefeed are kept with p and br (PageEdit, Edit menu, paste, select "no")

What I can't figure out is why all the buttons from pageEdit have been added to Sigil (bald, italic, images, special caracters and even cut, paste) except this pasting option. PageEdit seems therefor very redundant to Sigil, and I find it to be a very big "plugin" for "just pasting".

But as you and Doitsu mentioned: it does not just paste, it cleans the code too when choosing "plain text" by adding "p" and "br". Which I understand is not just 10 lines of code.

Thanks for your reply, this helped me try new things with pageEdit. 👍
Regards
François
fxp33 is offline   Reply With Quote
Old 09-05-2021, 11:50 AM   #27
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,645
Karma: 5433388
Join Date: Nov 2009
Device: many
PageEdit is not a plugin. It is separate editing program app that allows limited WYSIWYG editing similar to what the old BookView did in some ways. It can be easily launched from within Sigil by setting PageEdit as the External XHTML editor in Sigil's Preferences.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get cursor position or highlighted text inside plugin otherpasserby Plugins 10 12-16-2018 05:40 AM
How to send cursor to the home position by code ? reinsley Library Management 4 02-25-2017 02:08 PM
Reopening CC loses position, and reader app doesn't reopen at current position iatheia Calibre Companion 9 11-13-2015 08:20 PM
Glo Sleep with cover mess the current position ploum Kobo Reader 10 05-06-2013 07:49 AM
your current position regarding the 505 hello Sony Reader 1 10-06-2007 05:37 AM


All times are GMT -4. The time now is 08:09 AM.


MobileRead.com is a privately owned, operated and funded community.