05-22-2022, 03:52 PM | #151 |
Guru
Posts: 767
Karma: 2297170
Join Date: Jan 2017
Location: Poland
Device: Various
|
@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:
Perhaps you will find a better solution. |
05-23-2022, 12:49 PM | #152 |
Grand Sorcerer
Posts: 27,903
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'll look into it. Thanks!
|
Advert | |
|
04-14-2023, 02:23 AM | #153 |
Junior Member
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?
|
04-14-2023, 08:34 AM | #154 |
Grand Sorcerer
Posts: 27,903
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
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.
|
04-14-2023, 01:00 PM | #155 |
the rook, bossing Never.
Posts: 12,250
Karma: 89531599
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?
|
Advert | |
|
04-14-2023, 01:38 PM | #156 |
Grand Sorcerer
Posts: 27,903
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Nope.
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. |
04-15-2023, 03:00 AM | #157 |
Junior Member
Posts: 4
Karma: 10
Join Date: Aug 2022
Device: samsung s8
|
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.
|
04-15-2023, 07:43 AM | #158 |
Grand Sorcerer
Posts: 27,903
Karma: 198500000
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. |
04-15-2023, 11:30 AM | #159 |
Addict
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. |
06-09-2023, 12:02 AM | #160 |
Oracle Pig Keeper
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 |
06-09-2023, 12:59 AM | #161 | |
Bibliophagist
Posts: 39,488
Karma: 154108302
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
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. |
|
06-09-2023, 01:43 AM | #162 | ||
Oracle Pig Keeper
Posts: 26
Karma: 5024
Join Date: Jun 2023
Device: Kindle Fire HD, Samsung Tab
|
Quote:
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:
Thanks again, Tim |
||
06-09-2023, 06:20 AM | #163 |
Grand Sorcerer
Posts: 27,903
Karma: 198500000
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. |
06-09-2023, 09:48 AM | #164 | |
Grand Sorcerer
Posts: 27,903
Karma: 198500000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Code:
br[type='page'] => hr.sigil_split_marker Last edited by DiapDealer; 06-09-2023 at 09:53 AM. |
|
06-09-2023, 05:13 PM | #165 | ||
Oracle Pig Keeper
Posts: 26
Karma: 5024
Join Date: Jun 2023
Device: Kindle Fire HD, Samsung Tab
|
Quote:
Quote:
Thanks Tim |
||
|
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 |