|
|
#1 |
|
Connoisseur
![]() 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. |
|
|
|
|
|
#2 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Connoisseur
![]() 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
|
|
|
|
|
|
#4 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#5 | |
|
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,427
Karma: 31000056
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
|
|
|
| Advert | |
|
|
|
|
#6 | |
|
Connoisseur
![]() Posts: 59
Karma: 10
Join Date: Aug 2018
Location: Paris (France)
Device: Kobo Kindle Vivlio-Inkpad3
|
Quote:
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. |
|
|
|
|
|
|
#7 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
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. |
|
|
|
|
|
|
#8 |
|
Connoisseur
![]() 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 ? |
|
|
|
|
|
#9 |
|
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
|
|
|
|
|
#10 |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
|
|
|
|
|
#11 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
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. |
|
|
|
|
|
|
#12 |
|
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
|
|
|
|
|
#13 | |
|
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,427
Karma: 31000056
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
BR |
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
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 |