08-04-2013, 12:53 AM | #1 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Starting Sigil with Args - feature request
As it stands at moment, if I run Sigil with an arg of an epub or html file, it opens or imports it.
What I'd like to suggest to add is that if there's any extra args that are html, font, css or image files then they get added as well. I know we can add them from in Sigil, but would be handy to have them already 'in' there. What do you guys/gals think? |
08-04-2013, 09:43 AM | #2 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
@Perkin
I am in the group that hates doing things like that (changes via CLI) wearing blinders. I like having to stare at what I am about to make changes to before they get done. I have been known to (more frequent than I like) select the wrong file(s) There are other tricks for a quick load. Place all fonts to be used into a folder along with the a (matching @fonts)stylesheet., When you use 'Add Existing', just select All in that folder. Wham Bang they are done. select (X)HTML files in the book: right-click; Link stylesheets select all stylesheets that will be used in those file (note that any existing stylesheet links will be deleted in those files). |
Advert | |
|
08-04-2013, 03:53 PM | #3 | |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Quote:
Just thought it might be nice to automate some of it. |
|
08-04-2013, 05:17 PM | #4 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Correct me if I'm wrong, but with the exception of fonts... Sigil will automatically include the rest of that stuff (styles, images) if it's correctly linked in the html (and the style and image files are in the correct path relative to the location of the html) file being passed to Sigil as an argument.
I just tested: "C:\Program Files\Sigil\sigil.exe" test.xhtml ... and when Sigil opened, it had pulled in any and all css files and images that were referenced in test.xhtml. Or were you referring to something else? EDIT: Now that you mention it, though... it would be sorta cool if you could feed Sigil an OPF file and then it would be able to pull all the rest of the files together from that. Mind you; I'm not trying to create work for anyone. Just wish-listing a bit. Last edited by DiapDealer; 08-04-2013 at 05:31 PM. |
08-04-2013, 08:48 PM | #5 |
A Hairy Wizard
Posts: 3,094
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
|
Hmmm...
A quick script to open sigil while auto adding each individual html file in my 1000+ book library and auto save it as an .epub. Then I can open up the epub's to edit. That would save a BUNCH of work! "C:\Program Files\Sigil\sigil.exe" /add-"filename.xhtml" /save-"filename.epub" [edit] or even better: "C:\Program Files\Sigil\sigil.exe" /add-"filename.xhtml","filename2.xhtml","font1.ttf","font2.ttf" /save-"filename.epub" Last edited by Turtle91; 08-05-2013 at 10:26 AM. |
Advert | |
|
08-05-2013, 03:19 AM | #6 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I think what Perkin wants is launching Sigil like this:
Code:
sigil Chapter-1.html Chapter-2.html Chapter-3.html |
08-05-2013, 07:58 AM | #7 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
I know Sigil imports any linked css, images, html files that are linked/referenced from a html import file. It currently doesn't add the fonts.
The main addition would be to add any font files that are args, any extras (html, images, css) could be done by adding a dummy.html file, which includes those other files. Then run Sigil with sigil mainfile.html dummy.html font1 font2 font3 font4 font5 Sigil would then open the 'mainfile', and import as usual (adding css, html, images), then add 'dummy.html' (and any referenced css, html and images), then add the font# files. You would then just need to delete the 'dummy.html' file in the 'Book Browser' pane, and you'd then have all the extra css, html, images AND fonts included, so you can then finalise editing. |
08-05-2013, 09:58 AM | #8 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
Just found a workaround for having fonts included in the import.
if I have in the imported html file Code:
<div class="hidden"><img alt="" src="Fonts/CharisSILI.ttf"/></div> Code:
.hidden {display:none;} You can then delete those lines from the imported file, or as they are hidden (in Sigil preview pane & calibre viewer), you could leave them. Edit: You need to delete those lines, as the epub will not validate with them in. - thanks @Jellby You could also use inline style as: Code:
<div style="display:none;"><img alt="" src="Fonts/CharisSILI.ttf"/></div> Found you could also just have Code:
<img style="display:none;" alt="" src="Fonts/CharisSILI.ttf"/> Last edited by Perkin; 08-05-2013 at 11:01 AM. |
08-05-2013, 10:42 AM | #9 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Does that validate? If it doesn't, you can leave out the alt="" anyway
|
08-05-2013, 10:57 AM | #10 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
@Jellby, you're correct, it doesn't validate, IF you leave the lines in the html file, but if you remove them then it does.
|
08-05-2013, 11:17 AM | #11 |
Guru
Posts: 655
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD, iPad (Marvin)
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sigil 0.6.2 for Mac repeatedly crashes on starting | HappyChris | Sigil | 13 | 01-22-2013 05:11 AM |
Possible Feature Request | BookJunkieLI | Calibre | 12 | 08-08-2012 10:34 AM |
Feature request | kater | Calibre | 6 | 06-18-2012 07:54 AM |
feature request | winterescape | Recipes | 2 | 03-13-2011 11:07 AM |
Feature request | AprilHare | Calibre | 4 | 04-22-2009 04:23 AM |