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 05-22-2022, 03:52 PM   #151
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: 704
Karma: 2180740
Join Date: Jan 2017
Location: Poland
Device: Misc
@DiapDealer:
I thought you could add extra error handling, but it turns out that in qtdialogs.py you have to check for smap and css files first, and if they are not there (and the checkboxes are checked) the whole dialogbox returns default values, so the DOCX file also is "None".

Since the existence of smap and css files is not crucial to the operation of the plugin, you can probably just add messages directly in qtdialogs.py instead of "return".
The user will be better informed and the plugin will still work.

You don't need to change anything at tkdialogs.py.

Spoiler:
Code:
        if self.checkbox_smap.isChecked():
            if len(self.cust_smap_path.text()):
                self.prefs['useSmapPath'] = self.cust_smap_path.text()
                _DETAILS['smap'] = (self.checkbox_smap.isChecked(), self.cust_smap_path.text())
            else:
                # Message box that no file is selected
                # return
                print("Not selected smap file!")
        self.prefs['useCss'] = self.checkbox_css.isChecked()
        if self.checkbox_css.isChecked():
            if len(self.cust_css_path.text()):
                self.prefs['useCssPath'] = self.cust_css_path.text()
                _DETAILS['css'] = (self.checkbox_css.isChecked(), self.cust_css_path.text())
            else:
                # Message box that no file is selected
                # return
                print("Not selected css file!")


Perhaps you will find a better solution.
BeckyEbook is offline   Reply With Quote
Old 05-23-2022, 12:49 PM   #152
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,588
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'll look into it. Thanks!
DiapDealer is online now   Reply With Quote
Old 04-14-2023, 02:23 AM   #153
kawaberitan
Junior Member
kawaberitan began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2022
Device: samsung s8
I really enjoy using docximport, but I have a small issue. I have to manually adjust the indentations and spacing of each quoted sentence or paragraph because it is recognized as an ordinary body paragraph. How can I prevent this from happening?
kawaberitan is offline   Reply With Quote
Old 04-14-2023, 08:34 AM   #154
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,588
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by kawaberitan View Post
How can I prevent this from happening?
By creating a custom style for the quoted paragraphs in Word which defines them as unordinary, and then mapping that style to the desired css in the style map the plugin uses. There are examples of style mapping in the samples.
DiapDealer is online now   Reply With Quote
Old 04-14-2023, 01:00 PM   #155
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,524
Karma: 87454321
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
No auto-generation of CSS from styles then? I have to predefine CSS for each style?
Quoth is offline   Reply With Quote
Old 04-14-2023, 01:38 PM   #156
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,588
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Quoth View Post
No auto-generation of CSS from styles then?
Nope.

Quote:
Originally Posted by Quoth View Post
I have to predefine CSS for each style?
Yes. As it was always intended. I've always envisioned this plugin as an authorial tool that could be tailored to a user's particular--and hopefully consistent--docx style practices. Not a conversion tool that would automatically generate css from a myriad of users' varied docx style practices.
DiapDealer is online now   Reply With Quote
Old 04-15-2023, 03:00 AM   #157
kawaberitan
Junior Member
kawaberitan began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2022
Device: samsung s8
Quote:
Originally Posted by DiapDealer View Post
By creating a custom style for the quoted paragraphs in Word which defines them as unordinary, and then mapping that style to the desired css in the style map the plugin uses. There are examples of style mapping in the samples.
thanks for the answer. I had a hard time with multi-quote books. I solve it by marking the tags that docximport supports and importing them back into the blockquote tag.
kawaberitan is offline   Reply With Quote
Old 04-15-2023, 07:43 AM   #158
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,588
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Glad you got it working, but you're probably better off using div tags with css styling rather than blockquote tags. Naked text inside blockquote tags will fail EPUBCheck validation, and it might prove difficult to map your docx style to something like <blockquote><p>blah</p></blockquote>.

Not sure what you mean by "tags docximport supports," though. The plugin should be fairly tag agnostic. It has been in my experience.
DiapDealer is online now   Reply With Quote
Old 04-15-2023, 11:30 AM   #159
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 311
Karma: 3196258
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
You can nest elements in those mammoth map files. Something like p[style-name='Quote'] => blockquote > p:fresh.

Last edited by phillipgessert; 04-15-2023 at 11:33 AM.
phillipgessert is offline   Reply With Quote
Old 06-09-2023, 12:02 AM   #160
Interrobang
Oracle Pig Keeper
Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!
 
Posts: 26
Karma: 5024
Join Date: Jun 2023
Device: Kindle Fire HD, Samsung Tab
Thanks

@DiapDealer:

First off I wanted to thank you for all the work you’ve put into docximport. I’ve had it on my To Be Tried pile for a while and have finally started to use it. As a result, I’ve come across a few things.

When importing a .docx file, it creates a new epub with the .xhtml and .css files at the root of the file structure and not under the OEBPS folder. I thought the epub spec required the files to be nested under that folder. Correct?

Mammoth supports the command include_default_style_map=False to disable default style mappings. Is there a way to pass that command with docximport? If not, could it be added?

Finally, with regards to split markers, what elements can be defined in the style map to be mapped to it besides the horizontal line? It would be great if one could use the Word page break character.

Thanks again for your hard work on the plugin.

Tim
Interrobang is offline   Reply With Quote
Old 06-09-2023, 12:59 AM   #161
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: 36,424
Karma: 145748708
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Interrobang View Post
When importing a .docx file, it creates a new epub with the .xhtml and .css files at the root of the file structure and not under the OEBPS folder. I thought the epub spec required the files to be nested under that folder. Correct?
Nope. You must have an uncompressed mimetype file in the root of the .zip container. You must have a META-INF directory which must contain a container.xml file. The META-INF directory can contain other files such as encryption.xml, manifest.xml, metadata.xml, rights.xml and signatures.xml though other than encryption.xml, you will seldom see the other files in the wild. None of those files will be listed in the manifest as they strictly speaking are not part of the Epub document nor can they be encrypted.

Everything else can be placed in the root of the .zip file though using an OEBPS directory containing Text, Images, Styles, Misc and the content.opf and toc.ncx is pretty common and what Sigil uses when you click on Restructure Epub to Sigil Norm. Early versions of Sigil forced that structure.

If you are suffering from insomnia, you can check the Open Container Format for more information.
DNSB is offline   Reply With Quote
Old 06-09-2023, 01:43 AM   #162
Interrobang
Oracle Pig Keeper
Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!
 
Posts: 26
Karma: 5024
Join Date: Jun 2023
Device: Kindle Fire HD, Samsung Tab
Quote:
Originally Posted by DNSB View Post
If you are suffering from insomnia, you can check the Open Container Format for more information.
Mmmm, midnight fuel. Thanks for the link. I did know that some files and the META-INF folder are at the root.

My comment was based on a simple Google search, in which every answer appeared to confirm the fact that other content related files and folders are stored under /OEBPS. Even the Wiki page on EPUB states:
Quote:
Apart from mimetype and META-INF/container.xml, the other files (OPF, NCX, XHTML, CSS and images files) are traditionally put in a directory named OEBPS.
So I interpreted that as a requirement, but it appears it's just strongly suggested. Do you concur?

Thanks again,
Tim
Interrobang is offline   Reply With Quote
Old 06-09-2023, 06:20 AM   #163
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,588
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I ran into too much trouble trying to accommodate a structure with subdirectories, so I took the easy way out of creating a flat structure on import. I did this, knowing that it's trivial in Sigil to Restructure to Sigil Norm. It can even be included in a Toolchain after running the plugin. But really; any reading system or rendering engine that can't deal with a flat epub structure should be considered broken.

As for include_default_style_map=False, there is no current way, but I'll try to look into it.

I don't remember offhand how the split markers are generated, but I would assume that anything that CAN be mapped by Mammoth could be mapped to sigil's split marker. I've not altered Mammoth in that regard.
DiapDealer is online now   Reply With Quote
Old 06-09-2023, 09:48 AM   #164
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,588
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Interrobang View Post
Finally, with regards to split markers, what elements can be defined in the style map to be mapped to it besides the horizontal line? It would be great if one could use the Word page break character.
The following should work in your style map:

Code:
br[type='page'] => hr.sigil_split_marker
I will incorporate that into my samples. It makes more sense than adding horizontal lines to the original document.

Last edited by DiapDealer; 06-09-2023 at 09:53 AM.
DiapDealer is online now   Reply With Quote
Old 06-09-2023, 05:13 PM   #165
Interrobang
Oracle Pig Keeper
Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!Interrobang , Klaatu Barada Niktu!
 
Posts: 26
Karma: 5024
Join Date: Jun 2023
Device: Kindle Fire HD, Samsung Tab
Quote:
Originally Posted by DNSB View Post
...what Sigil uses when you click on Restructure Epub to Sigil Norm.
Quote:
Originally Posted by DiapDealer View Post
...knowing that it's trivial in Sigil to Restructure to Sigil Norm.
Thank you both for that tidbit of information. I'm learning Sigil as I work on this project and didn't know that command was available.

Thanks
Tim
Interrobang 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:56 AM.


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