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

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 03:56 PM   #1
jjk
Connoisseur
jjk began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Aug 2018
Location: Paris (France)
Device: Kobo Kindle Vivlio-Inkpad3
Open the working directory

In editor, is there a way to open directly the working directory where are decompressed all the file of the current epub ?
What I am looking for is a command in Calibre editor, a menu/sub-menu, or a hotkey.

In my configuration I found a blue icon near the middle of the main toolbar. But when I click it, the opened window is always the same, independantly of the opened book. Worst : that directory is empty.

TIA

Last edited by jjk; Yesterday at 04:02 PM.
jjk is offline   Reply With Quote
Old Yesterday, 04:07 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 82,203
Karma: 150871427
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jjk View Post
In editor, is there a way to open directly the working directory where are decompressed all the file of the current epub ?
What I am looking for is a command in Calibre editor, a menu/sub-menu, or a hotkey.

In my configuration I found a blue icon near the middle of the main toolbar. But when I click it, the opened window is always the same, independantly of the opened book. Worst : that directory is empty.

TIA
Why do you want to see the eBook files?
JSWolf is online now   Reply With Quote
Advert
Old Yesterday, 04:13 PM   #3
jjk
Connoisseur
jjk began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Aug 2018
Location: Paris (France)
Device: Kobo Kindle Vivlio-Inkpad3
Because I want to try to edit them in some other text editor
jjk is offline   Reply With Quote
Old Yesterday, 04:42 PM   #4
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: 50,573
Karma: 178402706
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
You might want to look at using Sigil to edit ePubs then. It has an option to launch an external HTML editor.
DNSB is offline   Reply With Quote
Old Yesterday, 05:00 PM   #5
BetterRed
null operator (he/him)
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: 22,427
Karma: 31000056
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by DNSB View Post
You might want to look at using Sigil to edit ePubs then. It has an option to launch an external HTML editor.
As does the calibre book editor:

Click image for larger version

Name:	calibre - edit book - open with.jpg
Views:	23
Size:	112.4 KB
ID:	221401

BR
BetterRed is online now   Reply With Quote
Advert
Old Today, 08:35 AM   #6
jjk
Connoisseur
jjk began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Aug 2018
Location: Paris (France)
Device: Kobo Kindle Vivlio-Inkpad3
Quote:
Originally Posted by BetterRed View Post
As does the calibre book editor:

Attachment 221401

BR
Thanks, BetterRed. I didn't know that. It will be very useful for my work.

But, editing by other text editor is only one of my needs.

I want also to read and modify decompressed files by Python scripts.
Here is my project : in Calibre editor I edit a lot of epubs created by Adobe Indesign export. This export creates css with very redundant. The main css file contains for example selector p.Title with up to 15 props/values, p.Title2 with up to 15 props/values. Say that the only difference is about font-size.
So I want to create the p.css file which contains props/values for standard paragraph, and styles.css with p.Title { font-size: 2em; } and p.Title2 { font-size: 1.5em; }, and I link p.css and styles.css to all my xhtml files.

At least I want to create a Python script to dedupe p selector props/values, ie delete those which are already present in p.css selector p. Therefore I need to know where are decompressed files, in order to read them, then modify them, and at least re-compress them.
jjk is offline   Reply With Quote
Old Today, 10:06 AM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 82,203
Karma: 150871427
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jjk View Post
Thanks, BetterRed. I didn't know that. It will be very useful for my work.

But, editing by other text editor is only one of my needs.

I want also to read and modify decompressed files by Python scripts.
Here is my project : in Calibre editor I edit a lot of epubs created by Adobe Indesign export. This export creates css with very redundant. The main css file contains for example selector p.Title with up to 15 props/values, p.Title2 with up to 15 props/values. Say that the only difference is about font-size.
So I want to create the p.css file which contains props/values for standard paragraph, and styles.css with p.Title { font-size: 2em; } and p.Title2 { font-size: 1.5em; }, and I link p.css and styles.css to all my xhtml files.

At least I want to create a Python script to dedupe p selector props/values, ie delete those which are already present in p.css selector p. Therefore I need to know where are decompressed files, in order to read them, then modify them, and at least re-compress them.
All of that can easily be done in the calibre editor.

What you do is create snippits. Then you can easily add in your own CSS no problem. One thing that's incorrect is {p class="title"} as it should be a header tag such as <h2>. style <h2> to be your main chapter title settings. Using the Edit Spans & Divs plugin, it's very simple to change <p class="title"> to <h2>. Then when you do finish, you can use Remove unused CSS from the tools menu. It will remove unused CSS in the CSS and HTML. So if you are no longer using yout title style, it will be deleted.

If you use the calibre error checker, it will tell you if you have duplicate CSS. Then you just have to delete the one you don't want.

If you are going to write a Python script, you may as well write an editor script to do what you want.

Click image for larger version

Name:	Snippit.jpg
Views:	5
Size:	153.4 KB
ID:	221430
JSWolf is online now   Reply With Quote
Old Today, 10:56 AM   #8
jjk
Connoisseur
jjk began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Aug 2018
Location: Paris (France)
Device: Kobo Kindle Vivlio-Inkpad3
Thanks JSWolf for your explanations.
But I have not Indesign, I receive exported epubs from Indesign and I have no way to modify export config. So, <Hx> tags are <p>. Even the Edit Spans & Divs plugin is not appropriate because there is no matching between class name (as "Title") and <Hx> level. In my original epubs there is no <Hx>, only <p>.

Now I return to my initial question : where is the working directory. And why the command "Open the directory (EPUB uncompressed) as a book", that is the 6th option of the File menu, does not work ? Or don't I understand what that command is supposed to do ?
jjk is offline   Reply With Quote
Old Today, 11:37 AM   #9
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,307
Karma: 5007213
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
I'm not sure Edit Book has a working directory--I think it may just keep everything in memory. I don't see one in the calibre temp dir, anyway.

Are you aware of Calibre's older 'Unpack book' tool? It unzips the epub to a temp dir, pops open a file browser and gives you a dialog to rebuild it when you're done. Default hotkey is 'U'. (Previously known as 'Tweak book' to us old timers.)

I'm able to use Edit book's "Open the directory (EPUB uncompressed) as a book" feature on that dir.

That's basically what you wanted, but with more steps? I don't know a shorter way.

And be aware, I don't think Edit book notices if the files are changed while it's running. File > Recently Opened Books > (current file or dir) is the quickest way I know to get Edit books to reload.
JimmXinu is offline   Reply With Quote
Old Today, 12:22 PM   #10
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: 31,545
Karma: 62543878
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Calibre has 'Open With' (both built in and a plugin) for those who do like using other tools.
theducks is offline   Reply With Quote
Old Today, 02:37 PM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 82,203
Karma: 150871427
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jjk View Post
Thanks JSWolf for your explanations.
But I have not Indesign, I receive exported epubs from Indesign and I have no way to modify export config. So, <Hx> tags are <p>. Even the Edit Spans & Divs plugin is not appropriate because there is no matching between class name (as "Title") and <Hx> level. In my original epubs there is no <Hx>, only <p>.

Now I return to my initial question : where is the working directory. And why the command "Open the directory (EPUB uncompressed) as a book", that is the 6th option of the File menu, does not work ? Or don't I understand what that command is supposed to do ?
With Edit Spans & Divs, you easily change <p class="Title"> to <h2>. It's very simple.

Click image for larger version

Name:	Edit Spans & Divs.jpg
Views:	6
Size:	43.2 KB
ID:	221438

Once you get to know calibre's editor, you won't have any need to do it your way which (IMHO) is more difficult. I've edited plenty of eBooks created with inDesign and it's not difficult at all.

Last edited by JSWolf; Today at 03:06 PM.
JSWolf is online now   Reply With Quote
Old Today, 06:06 PM   #12
BetterRed
null operator (he/him)
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: 22,427
Karma: 31000056
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@jjk - the editor unzips the epub into a randomly named directory in its 'temp' directory, which defaults to whatever your OS decides it will be, but it can be overridden via an Environment Variable, e.g.

CALIBRE_TEMP_DIR=C:\_AppData\Calibre\Temp

BR
BetterRed is online now   Reply With Quote
Old Today, 06:18 PM   #13
BetterRed
null operator (he/him)
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: 22,427
Karma: 31000056
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by jjk View Post
Now I return to my initial question : where is the working directory. And why the command "Open the directory (EPUB uncompressed) as a book", that is the 6th option of the File menu, does not work ? Or don't I understand what that command is supposed to do ?
That option assumes the user has already unzipped the epub they want to edit into a folder using a utility like 7zip, WinRAR, or whatever their OS provides. I've never found a need to use it.

BR
BetterRed is online now   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
"open containing folder" gives no such directory under Linux exachillus Calibre 1 01-30-2014 02:02 AM
Conversion from "open ebook" directory? ysth Conversion 2 07-26-2012 05:15 PM
Open Source Font Directory for 1.9.5 Toastedpine Kobo Reader 3 06-29-2011 03:16 PM
ebook-convert: access current working directory inside recipe jens32 Recipes 3 06-03-2011 11:57 AM
Calibre working directory paulfiera Calibre 17 01-02-2011 03:28 AM


All times are GMT -4. The time now is 06:29 PM.


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