Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 03-28-2017, 11:23 PM   #31
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,323
Karma: 2385865
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Hi

Out of curiosity, I tried your nice plugin with a complex .docx file. It produces quite a clean output. I added a custom epub.css file without any problem.
I have some questions.

1. - About structure
I missed probably something, but I got only one .xhtml file for a 1.6MB ebook. Is there a recommended way to control spllitting into small .xhtml files?

2. - About metadata
A lot were missing. Same question: is there a recommended place in the docx (or outside) to set metadata?

3. - About images
All images were cleanly processed. But if I wish to set all (or most) of them in their own .xhtml page with margin 0, is there a way?

Sorry for many questions and thanks for a nice plugin.

Last edited by roger64; 03-28-2017 at 11:29 PM.
roger64 is offline   Reply With Quote
Old 03-29-2017, 01:41 AM   #32
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 12,187
Karma: 10633638
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by roger64 View Post
2. - About metadata
A lot were missing. Same question: is there a recommended place in the docx (or outside) to set metadata?
This is what Word 2010 offers as DOCX metadata

Click image for larger version

Name:	Capture.JPG
Views:	179
Size:	26.4 KB
ID:	155860

I only bother with Title and Authors - Mammoth seems to pick those up, and puts them into the places you'd expect. I suspect Tags would end up as DC Subjects, Comments as DC Description and Company as DC Publisher. No idea about the rest.

BR
BetterRed is offline   Reply With Quote
Advert
Old 03-29-2017, 01:56 AM   #33
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,323
Karma: 2385865
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by BetterRed View Post
This is what Word 2010 offers as DOCX metadata

Attachment 155860

I only bother with Title and Authors - Mammoth seems to pick those up, and puts them into the places you'd expect. I suspect Tags would end up as DC Subjects, Comments as DC Description and Company as DC Publisher. No idea about the rest.

BR
Thanks. Yes these Word metadata are more tuned to word-processng purposes than for Epub publishing. I guess I'll have to complete metadata with Sigil.
roger64 is offline   Reply With Quote
Old 03-29-2017, 04:25 AM   #34
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 12,187
Karma: 10633638
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by roger64 View Post
Thanks. Yes these Word metadata are more tuned to word-processng purposes than for Epub publishing. I guess I'll have to complete metadata with Sigil.
Actually more like tuned to business document management, Excel and Powerpoint, and other Office components expose the same metadata properties.

BR
BetterRed is offline   Reply With Quote
Old 03-29-2017, 09:42 AM   #35
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: 19,638
Karma: 100081276
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by roger64 View Post
Hi

Out of curiosity, I tried your nice plugin with a complex .docx file. It produces quite a clean output. I added a custom epub.css file without any problem.
I have some questions.
It DOES produce clean output. But I feel compelled to remind users that without a custom style map, Mammoth will drop all formatting that is applied via predefined Word/libreOffice styles. Only the styling directly applied using the Bold, Italics, (and possibly the Underline) buttons will be honored.

Quote:
Originally Posted by roger64 View Post
1. - About structure
I missed probably something, but I got only one .xhtml file for a 1.6MB ebook. Is there a recommended way to control spllitting into small .xhtml files?
Mammoth (and consequently this plugin) relies on formatting info being supplied by the docx document. There is no chapter- or file-break indicator in a docx document, hence the plugin doesn't split the input into individual files.

What you can do however is "mark" your split points in your source docx document with something like a horizontal line (or any empty named style paragraph, actually). That way, you can map (by creating a Mammoth style map) the horizontal line (or whatever you used) to Sigil's special split marker. My sample document and style map include this very technique ("p.HorizontalLine => hr.sigil_split_marker" ... meaning a Word paragraph of the style HorizontalLine will be converted to an hr tag with the class name "sigil_split_marker"). That way, the user can split the epub into "chapters" immediately after the plugin is done.

I suppose I could have the plugin perform the file-splitting at those markers as its final step. But quite frankly ... I have no desire to port Sigil's complex, pre-existing C++ chapter-splitting routines to Python when a quick menu-item or keyboard shortcut can split the file after the new epub as been created.

Quote:
Originally Posted by roger64 View Post
2. - About metadata
A lot were missing. Same question: is there a recommended place in the docx (or outside) to set metadata?
See BetterRed's response. Mammoth uses the docx's metadata.

Quote:
Originally Posted by roger64 View Post
3. - About images
All images were cleanly processed. But if I wish to set all (or most) of them in their own .xhtml page with margin 0, is there a way?

Sorry for many questions and thanks for a nice plugin.
Same answer as for point #1: add an indicator to the source document that can then be mapped to Sigil's special split marker (<hr class="sigil_split_marker" />) upon conversion, to get images on their own "page.". There's currently no way to generate a style attribute for images (or even a class name for that matter). I can certainly investigate the possibility of doing so, but there's no guarantees. I'm not willing to rewrite large chunks of Mammoth's underlying code to accomplish it.

Hope that answers your questions. I'm certainly no Mammoth expert, so I encourage users to read their documentation on creating style maps (there's a link in the first post). I just wrapped their work into a Sigil plugin.

Last edited by DiapDealer; 03-29-2017 at 09:44 AM.
DiapDealer is online now   Reply With Quote
Advert
Old 03-29-2017, 10:22 AM   #36
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,323
Karma: 2385865
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@DiapDealer

Thanks for taking the time to write such a detailed reply. I will begin to tune the "style-map" without forgetting to map this important horizontalline item.

Out of using a manual page break like you advise, there also could probably be a way to provoke an automatic split before h1 (or some other) titles.

If I compare with ODTImport, I use manual pagebreaks to create individual pages for images and, after that, once the EPUB has been created, I use a plain regex to give their body a null margin.

Time to experiment.
roger64 is offline   Reply With Quote
Old 03-29-2017, 03:27 PM   #37
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: 19,638
Karma: 100081276
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by roger64 View Post
Out of using a manual page break like you advise, there also could probably be a way to provoke an automatic split before h1 (or some other) titles.
Not within the plugin, though. As I said, Sigil's C++ file-splitting routines are not available to plugins, and I'm not going to reinvent the wheel, so to speak, with Python. Not when automatically marking the split points with the plugin, and then splitting with Sigil immediately after the plugin is done is so trivial to do.
DiapDealer is online now   Reply With Quote
Old 03-29-2017, 05:07 PM   #38
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 12,187
Karma: 10633638
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Slightly OT - does Sigil have a simple tool to spilt monolithic files based on header tags h1, h2 etc. I thought it did but now I can't find the blessed thing. I thought it was in the book browser context menu, but I might be misremembering.

Polluting the DOCX originals with artefacts just for Sigil to use isn't an option for me.

BR
BetterRed is offline   Reply With Quote
Old 03-29-2017, 05:51 PM   #39
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: 19,638
Karma: 100081276
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by BetterRed View Post
Slightly OT - does Sigil have a simple tool to spilt monolithic files based on header tags h1, h2 etc. I thought it did but now I can't find the blessed thing. I thought it was in the book browser context menu, but I might be misremembering.
No, there is no such Sigil tool. You can Split At Cursor, or you can Split At Markers.

You can always use regex to insert the split marker in front of particularly classed h tags (after the document is in Sigil of course).

Last edited by DiapDealer; 03-29-2017 at 05:55 PM.
DiapDealer is online now   Reply With Quote
Old 03-29-2017, 06:36 PM   #40
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 12,187
Karma: 10633638
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DiapDealer View Post
You can always use regex to insert the split marker in front of particularly classed h tags (after the document is in Sigil of course).
Yeah, that's what I do. Maybe the split at headers is/was in calibre editor, but I can't find in there either. Must have been me dreaming wishful thoughts

BR
BetterRed is offline   Reply With Quote
Old 03-29-2017, 07:17 PM   #41
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 22,629
Karma: 22515576
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab A, Kobo Aura2
Quote:
Originally Posted by BetterRed View Post
Slightly OT - does Sigil have a simple tool to spilt monolithic files based on header tags h1, h2 etc. I thought it did but now I can't find the blessed thing. I thought it was in the book browser context menu, but I might be misremembering.

Polluting the DOCX originals with artefacts just for Sigil to use isn't an option for me.

BR
I use a S&R to insert the : <hr class="sigil_split_marker" /> whenever I can make a solid Search pattern

then hit F6 to DO the split at Markers Thingy
theducks is online now   Reply With Quote
Old 03-30-2017, 05:30 AM   #42
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 12,187
Karma: 10633638
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by theducks View Post
I use a S&R to insert the : <hr class="sigil_split_marker" /> whenever I can make a solid Search pattern

then hit F6 to DO the split at Markers Thingy
As I already said, when I'm conscious I do much the same thing.

But in my dreams I right 'right click' on the monolithic xhtml file, select something like 'Split at Headers', it prompts me for a file name prefix which it defaults to "Chapter", I click OK, and I'm off to races

BR
BetterRed is offline   Reply With Quote
Old 03-30-2017, 06:51 AM   #43
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,323
Karma: 2385865
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by BetterRed View Post
.../...

But in my dreams I right 'right click' on the monolithic xhtml file, select something like 'Split at Headers', it prompts me for a file name prefix which it defaults to "Chapter", I click OK, and I'm off to races

BR
Your dream may come true using ODTImport Sigil plugin. In the config.xml file, you can select -among many other things- some automatic settings (your value between brackets) for the "split level", for manual or style "page_break_split" and even (I had missed this one ) for an "image split".
Code:
<!-- File options -->
  <option name="external_toc_depth" value="3" />
  <option name="split_level" value="2" />
  <option name="repeat_levels" value="5" />
  <option name="page_break_split" value="explicit" />
  <option name="split_after" value="0" />
  <option name="image_split" value="none" />
  <option name="cover_image" value="false" />
  <option name="save_images_in_subdir" value="false" />
  <option name="uplink" value="" />
Documentation reference

http://writer2latex.sourceforge.net/...ual-screen.pdf

page 58

Last edited by roger64; 03-30-2017 at 07:51 AM. Reason: doc
roger64 is offline   Reply With Quote
Old 03-30-2017, 09:38 AM   #44
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 12,187
Karma: 10633638
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by roger64 View Post
Your dream may come true using ODTImport Sigil plugin.
Introducing another format (ODT), more software (Open Office of some sort), latex2html, and another Sigil plugin sounds like a nightmare to me

I'm a minimalist - less is better, least is best. So I don't use toolbars, I avoid using the mouse, I don't have covers on my EPUBs, and I reduce EPUB embedded metadata to title, author, publisher, and date of publication, anything else is dross and it gets removed pronto

I think I can do a calibre EPUB to EPUB conversion and use it's XPath gadgetry to do the splits and retain the results of my style mapping. I just need to find the time and inclination to confirm the latter in detail. I have and use calibre daily.

BR
BetterRed is offline   Reply With Quote
Old 03-30-2017, 09:52 AM   #45
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,323
Karma: 2385865
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Though the settings may be a little long to set up, once it's done, everything is automatic...
I did not change anything in config.xml for several months.

It's the usual trade off, long before, easy after OR easy before, long after...

Anyway, everyone makes his choice.

/off and sorry.

Last edited by roger64; 03-30-2017 at 09:58 AM.
roger64 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 12:46 PM.


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