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 12-20-2018, 03:45 PM   #106
JeffPalley
Yold
JeffPalley began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Sep 2011
Device: none
DOCXimport troubles in Sigl

Hi DiapDealer,

I'm running Win10. When I look at my main Sigil menu, there's a menu item called "Plugins." When I open it, I am given a choice of "Manage Plugins" or three categories: Input, Validation, and Edit. Then I choose "Input" and the name Docximport pops up. I click on "Docximport" and immediately a window opens up with the title "Plugin Runner." At the top of the window there are two labels: the first says "Plugin: Docximport." the second is a green progress bar that says "Status failed." Within the window itself, this text appears: "Status:failed," and "Launcher: missing or incorrect paths passed in." At that point, all I can do is click on OK.

Incidentally: (1) I appreciate your fast help and look forward to more of it.
(2) I'm not looking for a turnkey conversion solution; just one I can edit easily. I've used Sigil with various HTML input files before, and I think I know what to expect.

Finally, yes, I was expecting what you say: an input window in which to enter a filename.docx. The input window opens, but it immediately fills itself with the two error messages I described above, and doesn't give me any input choice except "OK." If you'd like, I can send you a screenshot of it.

Again, thanks for being so helpful. -Jeff
JeffPalley is offline   Reply With Quote
Old 12-20-2018, 04:00 PM   #107
JeffPalley
Yold
JeffPalley began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Sep 2011
Device: none
Hi again, DiapDealer,

Here's a screenshot of what I get as soon as choose Docximport.
JeffPalley is offline   Reply With Quote
Old 12-20-2018, 04:01 PM   #108
JeffPalley
Yold
JeffPalley began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Sep 2011
Device: none
Well, I guess I don't know how to enter the URL of a local JPG image. Sorry, -Jeff

Last edited by JeffPalley; 12-20-2018 at 04:15 PM.
JeffPalley is offline   Reply With Quote
Old 12-20-2018, 04:36 PM   #109
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Now I'm really puzzled. It almost sounds as if your Sigil plugin launcher framework is incomplete. When you go to Plugins->Manage Plugins, Is the "Use Bundled Python" checkbox checked in the preferences? What version of Sigil? You're not using a Portable Apps version of Sigil are you?

As far as images go, you're trying to link to an image path that's on your own PC. To use IMG tags, you'd need to upload the image somewhere, and put the public url of that image in the IMG tags. You can attach an image to a post from your PC, by clicking the "Go Advanced" button below the post editor window, and then using "Manage Attachments" in the Additional Options section below the post editing window to add an attachment.

Last edited by DiapDealer; 12-20-2018 at 04:41 PM.
DiapDealer is offline   Reply With Quote
Old 12-20-2018, 04:49 PM   #110
JeffPalley
Yold
JeffPalley began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Sep 2011
Device: none
OK DiapDealer, I think you solved it. "Use bundled Python" was NOT checked. I checked it and got a much friendlier window. Plus it imported and converted sample.docx with only a few warnings. Thank you very much, -Jeff

P.S. Thanks for the info about images.
JeffPalley is offline   Reply With Quote
Old 12-20-2018, 04:52 PM   #111
JeffPalley
Yold
JeffPalley began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Sep 2011
Device: none
Last time you'll hear from me today.

The warnings were from within your app. ... actually, from Mammoth. When I ran epubcheck and flightcrew on the epub file, they both returned "No problems found!"

Last edited by JeffPalley; 12-20-2018 at 05:01 PM.
JeffPalley is offline   Reply With Quote
Old 12-20-2018, 06:15 PM   #112
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Glad to hear it worked! I haven't run the sample.docx through in while. I'll try to see what warnings Mammoth is generating from it. Perhaps I can make a few changes to the sample to make it import a little cleaner. Or perhaps leaving some warnings would be advantageous? Can't have people thinking everything will always work perfectly!
DiapDealer is offline   Reply With Quote
Old 03-05-2019, 11:12 AM   #113
quinta@ebf.cz
Connoisseur
quinta@ebf.cz began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
Hi. Trying plugin as suggested from
Quote:
Originally Posted by BetterRed View Post
.
Does import need some special treetment for empty paragraphs?

input: docx containing just one empty paragraph, using paragraph style "Text"
style map:
Code:
p[style-name='Text'] => p.Text:fresh
output (where NBSP = nbsp numeric entity):
Code:
<p">NBSP<p></p>

</p">
Which of course is not valid xhtml. Am I doing something wrong?

Last edited by quinta@ebf.cz; 03-05-2019 at 11:43 AM. Reason: more descriptive replacer for numeric entity in code
quinta@ebf.cz is offline   Reply With Quote
Old 03-05-2019, 08:34 PM   #114
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by quinta@ebf.cz View Post
Hi. Trying plugin as suggested from
Does import need some special treetment for empty paragraphs?

input: docx containing just one empty paragraph, using paragraph style "Text"
style map:
Code:
p[style-name='Text'] => p.Text:fresh
output (where NBSP = nbsp numeric entity):
Code:
<p">NBSP<p></p>

</p">
Which of course is not valid xhtml. Am I doing something wrong?
Not sure. I've never had the plugin generate that kind of invalid code before (though admittedly, I never employ the empty paragraph technique for vertical spacing). I'd recommend experimenting with a document that consists of a bit more than a single empty paragraph. Perhaps a couple of paragraphs of Ipsem Lorem while you get the hang of things?

Last edited by DiapDealer; 03-05-2019 at 08:37 PM.
DiapDealer is offline   Reply With Quote
Old 03-06-2019, 07:07 AM   #115
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 692
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
Quote:
Originally Posted by quinta@ebf.cz View Post
Which of course is not valid xhtml. Am I doing something wrong?
Change one line in htmlformat.py.

Is:
Code:
fragment = regex.sub(r'<p([^>])*></p>', r'<p\1>*</p>', fragment)
Change to:
Code:
fragment = regex.sub(r'<p([^>]*)></p>', r'<p\1>*</p>', fragment)
BeckyEbook is offline   Reply With Quote
Old 03-06-2019, 09:44 AM   #116
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BeckyEbook View Post
Change one line in htmlformat.py.
Thanks! Would you mind terribly submitting a pull-request for this change on DOCXImport's github repo? That way I don't have to go to the trouble of manually crediting you with the fix.

I understand if forking/committing/pushing/submitting a pull request is bit too much for such a tiny change. Just let me know if so and I'll commit the change myself.

Thanks again.
DiapDealer is offline   Reply With Quote
Old 03-06-2019, 02:15 PM   #117
quinta@ebf.cz
Connoisseur
quinta@ebf.cz began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
Quote:
Originally Posted by DiapDealer View Post
… I'd recommend experimenting with a document that consists of a bit more than a single empty paragraph. Perhaps a couple of paragraphs of Ipsem Lorem while you get the hang of things?
Negative. Every empty paragraph (with imported style) is imported incorrectly.
After applying BeckyEbook's patch things looks better.

Some question: Is there possibility to simply import _every_ style used in source document? Without need of explicitly creating list of styles (for style map). E.g. by using wildcards in style map... or somehow.
Code:
p.* => p.*
r.* => span.*

Last edited by quinta@ebf.cz; 03-06-2019 at 02:24 PM. Reason: added "(with imported style)"
quinta@ebf.cz is offline   Reply With Quote
Old 03-06-2019, 02:57 PM   #118
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by quinta@ebf.cz View Post
Negative. Every empty paragraph (with imported style) is imported incorrectly.
After applying BeckyEbook's patch things looks better.
Yes. I know that now. That's why I asked her to submit her change to DOCXImport's code repository. Her fix will make it into the next version of the plugin.

Quote:
Originally Posted by quinta@ebf.cz View Post
Some question: Is there possibility to simply import _every_ style used in source document? Without need of explicitly creating list of styles (for style map). E.g. by using wildcards in style map... or somehow.
Code:
p.* => p.*
r.* => span.*
No there's not. At least not via this plugin anyway. You could ask the developer of the Mammath python library (this plugin is merely a wrapper around that library) if he could incorporate it. But being familiar with the structure of his library, I'm not sure that's feasible. The very unstable "transforms" feature of mammoth might prove useful in some way, but I've no plans to incorporate that into this plugin.

I'll be honest... I never envisioned this plugin being used for one user to convert other users' docx documents. It was primarily aimed at authors/creators who already had a standard Word style setup they used to create their documents in Word and could create a mammoth style map to accommodate that framework. Once it was initially set up, it would all just work (with occasional tweaks needed here and there). But this plugin isn't for anyone who's looking for that initial map creation phase to be done for them.

A conversion process that can "smartly" convert unknown word style names (unknown to the user) into semantically correct, class-matched html that can be easily styled via css may be possible, but it's not likely going to happen with Mammoth.

Last edited by DiapDealer; 03-06-2019 at 03:02 PM.
DiapDealer is offline   Reply With Quote
Old 03-06-2019, 03:57 PM   #119
quinta@ebf.cz
Connoisseur
quinta@ebf.cz began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Mar 2019
Device: Kindle 3 Paperwhite
Roger.

Detecting "unrecognized" styles is probably not done at the plugin level. So plugin cannot dynamically add items into style map?
Mayby there is a possibility to use VBA macro to create complete style map for selected document.

Sorry, just thinking loud. An interesting project. Thank you for assistance.
quinta@ebf.cz is offline   Reply With Quote
Old 03-06-2019, 04:24 PM   #120
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,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
No. The plugin can not dynamically add items into the style map. The plugin is actually very, very dumb. The underlying Mammoth python library is what does all of the heavy lifting. The plugin merely makes the user-defined style map available to the mammoth engine and makes sure everything that comes back out can be cobbled together as a valid Sigil EPUB. The plugin wouldn't have the first notion of what kind of styles the DOCX has in it. Mammoth hasn't processed it yet. A dynamically created style map based on the DOCX's defined styles would be putting the cart before a horse that hasn't been born yet.

And I'm not Roger, by the way. I'm Doug.
DiapDealer is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FileType Plugin] YVES Bible Plugin ClashTheBunny Plugins 27 01-16-2023 01:25 AM
[Plugin] KindleImport Sigil plugin DiapDealer Plugins 187 07-04-2022 10:11 AM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 02:24 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM


All times are GMT -4. The time now is 05:23 AM.


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