08-30-2014, 05:44 AM | #1 |
Addict
Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
|
SOLVED: Need help changing template for Metadata Book Jacket
UPDATE: Solved as of post #11 on 9/1.
ORIGINAL POST: I need some help properly setting up the .xhtml and css files to give the metadata that I want in my book jacket when I polish it. I have tried editing and saving the template as xhtml and then making the css correspond. However, this part is beyond my capabilities. I can't figure it out and have tried! IF YOU KNOW HOW TO EDIT the BOOK JACKET METADATA template and the corresponding CSS, please do so and return the files. I know how to place them in the correct folder as referenced when looking at the Book Editor and jacket.xhtml page. I CAN RENAME AND DO THE TESTING IF YOU CAN EDIT. This would be a MAJOR HELP to me. My goal is to remove some info and add info from custom data fields to my book jacket. The attached files are: 1) the " stylesheet css COPY of original " file as referenced and found in ProgramFiles(x86)/Calibre2/resources/jacket 2) the original " template.xhtml COPY of original" file from the same directory file as referenced and found in ProgramFiles(x86)/Calibre2/resources/jacket THESE 2 FILES are NOT SPECIAL and are part of the Calibre install. 3) an .xhtml file and .doc file as saved in MS Word when opening the template.xhtml to customize. You can do a side by side with the original template.xhtml when viewed in MS Word to see the goals of adding a custom fields {#words} and some format changes. I cannot guarantee that these saved formats are appropriate. I know the original template.xhtml opens as a true template requiring saving under another name to work with it. I just can't figure out how to go from what I want to making it happen. I have noticed that book jackets were still creating according the the standard template even though I had renamed the files in the ..resources/jacket folder and did nothing else. I now wonder where it actually pulls from in this is the case. Can anyone help? Thanks in advance! Last edited by jecilop; 09-03-2014 at 09:38 PM. Reason: UPDATE |
08-30-2014, 07:34 AM | #2 |
null operator (he/him)
Posts: 20,937
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
First up - you need to copy the resources/jacket folder from the install location to your config folder, then you need to turn of their read only attributes, then you need to edit them to what you want - but don't rename the files.
It works like this, when calibre wants a resource of some sort (say fred.png), it first looks in the users configuration resource data for it, if it finds what its looking for then it uses that one, if it can't find what it wants it uses what's in the install resources folder. But don't have any skills in coding these things - I just hack away until its near enough. BR Last edited by BetterRed; 03-08-2017 at 05:12 PM. |
08-30-2014, 09:57 AM | #3 |
Well trained by Cats
Posts: 30,378
Karma: 58053698
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Moved to the main Calibre section.
This is not an 'Editor' question (BR's answer is the correct one for modifying basic calibre HTML-templates/icons ) |
08-30-2014, 11:19 AM | #4 | |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
If you specify, in simple English, what visual changes you want, I'll try to oblige. NB: Do not let MS Word anywhere near xhtml/css files that you want to edit. Use a good text editor instead (on Windows Notepad++ is good). |
|
08-30-2014, 11:20 AM | #5 |
Grand Sorcerer
Posts: 11,942
Karma: 7219261
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
First problem: you cannot use custom column lookup names in template.xhtml. See the "Customizing the Descriptions template and Section lists" section in the Creating Catalogs: Start here thread.
Starting with calibre 2.1 you can use custom columns, or in fact any valid calibre template, in the templates defined in section_list_templates.py. These templates are used to generate the reference lines in the various contents sections. Finally, you can place a custom column in the description section (extra description) and in the comments section (merge with comments). Although these are limited to a single custom column lookup name, you can add an arbitrary amount of information using columns built from other columns (a "composite" column). You can insert newlines into a composite column intended for use in a catalog using "<br>", as in "{#myinfo}<br>{#somedate}" |
08-30-2014, 07:22 PM | #6 |
Addict
Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
|
Where I am after feedback...
THANK YOU EVERYONE for you input and clarification of thread location. This seemed the place since I saw other threads on editing metadata templates here. I do hate when people don't take the time to figure it out. EACH reply is addressed below.
@BETTERRED, thanks for the input. I, however, cannot find the config folder. I tried ProgramFiles..., User/Appdata/Local... and Roaming..., and I looked at files under the main folders and do not see the referenced files that match the resources/catalog files you mentioned. I too start by learning to "hack away" and pick up more as I go. However, I cannot find what you reference although I would like to for the future. Perhaps a FULL LOCATION PATH would be more helpful. If I overlooked the obvious, I can slap my head with a, "Doh!" after seeing it. @JACKIE_W, thanks for the visual. You have the right idea. I use the Count Pages plug-in for pages and words. I would like that info in the book metadata jacket also and not just as a column I see in Calibre. The lookup name is Words. I don't know if in this case you use Words or #words. I suppose it can't hurt to show both Pages and then Words. I want to modify the following (a sketchup picture is attached):
I would need some direction, if BETTER RED is accurate, as to where to place the modified file(s) if ProgramFiles../Calibre../resources/jacket is not the correct directory. FULL LOCATION PATHS are most helpful. ATTACHED is a picture of what I would like. Also attached is the epub I made to generate this info in case it helps with anything. @CHALEY, you information was helpful in framing the above ideas, but it's not something I can try yet because I can't get files where they need to be to work. It's probably simple, but I'm baffled right now. I can't learn how to do composite columns until I can test my tweaking. (By the way, I am in Calbre 2.1) I'm hoping help, perhaps as from JACKIE_W, will get me there. I need the visual now to overcome this learning hurdle. Thanks. SIDE NOTE: Anyone know how to get the tags to print alphabetically like they show in the book details pane and columns? I know that when in Edit Metadata, they show according to how they were entered. I see they print in the Book Metadata Jacket the same way. I'll likely ask this as a separate thread later. Last edited by jecilop; 08-30-2014 at 11:15 PM. Reason: edited attached photo and typos |
08-30-2014, 07:46 PM | #7 |
null operator (he/him)
Posts: 20,937
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@jecilop - if there's no resources folder in your configuration folder then create one.
To access you config folder see attachment. Its best not to change things in the calibre configuration folder whilst calibre is running. The reason I (and maybe others) tend to shy away from using absolute paths is that the default locations for the configuration folder in Windows XP, Windows Vista/7/8, OS/X and Linux are different. Also the configuration folder can be relocated, providing you put its new location into the CALIBRE_CONFIG_DIRECTORY environment variable, e.g. my config folder is at E:\CalibreData\Configuration. BR |
08-30-2014, 10:08 PM | #8 |
Addict
Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
|
@BetterRed
THAT helped me find the config directory, thanks. I'm still trying to reconcile how to correlate changes in the template and stylesheet, however. I made some changes to the template that copied from the resources/catalog you directed me to earlier and copied the catalog folder into the config directory. No such folder existed there before (I assume that is how it should be). Interestingly, the copied template file is a little different from Calibre has been pulling in by default. The Series Name [#] is coming in as " Number # of Series Name" by default. Even after copying the catalog folder into the config directory, the book jacket metadata update is using the default form and not what I've copied over. I also copied those two files into the config directory alone (config directory calibre/template.xhtml and stylesheet.css VERSES being in config director calibre/catalog/template.xhtml and stylesheet.css) It doesn't work there either. At least I know how to include some custom icon access faster now in the future vs. browsing each time to find them. I know where they are stored now (cc_icons) :-) So, IN SUMMARY, I know more but still can't get it to work. The default stuff is still what shows. ..and yes, I did testing after restarting Calibre. UPDATE:... Well, I figured out that I have to make a resources/jacket directory and copy the files there in the config directory . Of course, the one file I modified now loses ALL formatting and some info...Edison learned over 500 ways NOT to make a lightbulb :-) Now if @jackie_w can help me with the proper files, I'm a step closer. I'm going to keep playing with it (ie, learning). Last edited by jecilop; 08-30-2014 at 11:16 PM. Reason: Update |
08-31-2014, 12:37 PM | #9 | ||||
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
OK, here's an update. When they are in the correct place in my calibre config directory (Windows 7), the 2 customised jacket files are called:
C:\Documents and Settings\myuserid\Application Data\calibre\resources\jacket\stylesheet.css They are in the attached jacket.zipC:\Documents and Settings\myuserid\Application Data\calibre\resources\jacket\template.xhtml Quote:
Quote:
Quote:
Quote:
Finally, I've attached a screencap of the new jacket using your test epub (with the excess Comments removed). [ETA: I see Android as your Reader details. Based on my experience, some of the popular Android reader apps may make a complete pig's ear of the calibre jacket styling. On the other hand chaley's wonderful Calibre Companion app will mean you never need to bother embedding a calibre jacket at all. All the calibre metadata you could possibly wish to see without needing to open the epub (or azw3, pdf,... etc) at all. Last edited by jackie_w; 08-31-2014 at 12:49 PM. Reason: Android comment |
||||
08-31-2014, 02:01 PM | #10 |
Grand Sorcerer
Posts: 11,942
Karma: 7219261
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
@jackie_w: I was very confused when I wrote my first post. I thought we were talking about catalogs, not book jackets.
The book jacket template cannot use arbitrary templates. However, it can use composite custom columns, but as far as I can tell from the code a custom column cannot contain html because it would be escaped and shown as characters. I haven't tried it. |
09-01-2014, 07:51 AM | #11 |
Addict
Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
|
@jackie_w
I have taken your modified file and figured out (finally) how to modify it even more. It took some missing components to Sharepoint Web designer to handle it for me and to help me see and learn the internals of it better! Attached is a picture of the copy of the version I currently have set and properly working. If you would like a return copy of the template and stylesheet, let me know. I'm going to post it for others if I can get info back on the below stuff. FYI, I have two threads out there to see if I can find answers on the: Alphabetical tags : https://www.mobileread.com/forums/sho...d.php?t=245516 and Getting Author Links from the Author Mgmt section to show: https://www.mobileread.com/forums/sho...d.php?t=245524 Thank you again. This was a BIG help and now a jumping point for me. SIDE NOTE: Yes, I've notice how my reader does some weird things with the metadata jacket formatting, but at least now the desired info is there. Readers can changes as well as the setup of my reader. I let my "standard publication" appearance be what I see in Calibre Viewer. Last edited by jecilop; 09-01-2014 at 10:25 AM. Reason: updated to correct copy of picture.; don't submit or save when you haven't slept! |
09-01-2014, 10:14 AM | #12 |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Glad it helped I know for myself that a worked example can be a great catalyst to getting to grips with something new.
As I mentioned above, now that I use Calibre Companion, I don't actually need the jacket anymore for my own epubs, but I did spend a bit of time experimenting with customisation a few years ago when I was still new to html/css. |
10-20-2014, 10:18 PM | #13 |
Junior Member
Posts: 3
Karma: 10
Join Date: Oct 2014
Device: none
|
Hi all,
this thread is very interesting for me, but I didn't find here ansver to my problem. So I would like to ask you. Can you explain me pleas, how can I modify template.xml of jacket for inserting Laguage and ISBN of book and for its displaying on jacket page of my epub? I tried many variants of template.xhtml modifications, but no one workes. I suppose, that tags could by used for it. But I hope that there is possible to use something like {isbn} and {language} because both of them are standard metadata parameters wich I define as parameters of my Calibre command line command for epub converting from source file. Simnilar problem I have with format of {pubdate} . I can not find how to define it in example .xhtml for displaying result in format MM yyyy. Could you help me pleas, or put here link to another thread, where my porblem has been already solved? Thanks a lot. |
02-17-2015, 11:58 AM | #14 | |
Junior Member
Posts: 1
Karma: 10
Join Date: Feb 2015
Device: Kobo aura H2O
|
Quote:
I use calibre portable ... i try show custom data in custon columns in catalog (in section book description). I create catalog cartel e copy the main default file for modify. I can do more modify but when i use { _customcolumn} as a value return me error code 1 and specify do not recognize _customcolumn ... There is the error log : calibre, version 2.19.0 (win32, isfrozen: True) Errore di conversione: Non riuscita: Crea catalogo Crea catalogo Sections: Authors, Descriptions Catalog_EPUB_MOBI('Calibre Library'): Generating epub for tablet in GUI environment, locale: 'Italian' connected_device: 'None' book count: 47 opts: author_clip: 100 catalog_title: u'Libri su Kobo' connected_kindle: False creator: u'marted\xec, febbraio 17, 2015' cross_reference_authors: False description_clip: 380 exclude_genre: u'\\[.+\\]|^\\+$' exclusion_rules: ((u'Cataloghi', u'Tag', u'Catalogo'),) fmt: u'epub' genre_source_field: u'Tag' header_note_source_field: u'#datalettura' merge_comments_rule: ':before:False' output_profile: 'tablet' prefix_rules: ((u'Letto', u'#letto', u'Vero', u'*'), (u'Letto', u'#letto', u'Falso', u'\u2022')) search_text: None sort_by: None sort_descriptions_by_author: True sync: False thumb_width: u'1.00' use_existing_cover: False Begin catalog source generation (0:00:00) Books excluded by tag: Custom fields: #datalettura 'Data lettura' datetime #formats 'Formati' composite #letto 'Letto' bool #pagine 'Pagine' int Thumbnails: DPI = 132; thumbnail dimensions: 132 x 175 existing thumb cache at E:\Calibre Portable\Calibre Settings\caches\catalog\thumbs.zip, cached_thumb_width: 1.00" Ordinamento titoli (0:00:04) Ordinamento database (0:00:04) Miniature (0:00:04) Descrizioni HTML (0:00:14) unhandled exception in catalog generator Python function terminated unexpectedly u'pagine' (Error Code: 1) Traceback (most recent call last): File "site.py", line 132, in main File "site.py", line 109, in run_entry_point File "site-packages\calibre\utils\ipc\worker.py", line 193, in main File "site-packages\calibre\gui2\convert\gui_conversion.py", line 68, in gui_catalog File "site-packages\calibre\library\catalogs\epub_mobi.py", line 404, in run File "site-packages\calibre\library\catalogs\epub_mobi_builde r.py", line 289, in build_sources File "site-packages\calibre\library\catalogs\epub_mobi_builde r.py", line 2835, in generate_html_descriptions File "site-packages\calibre\library\catalogs\epub_mobi_builde r.py", line 2758, in generate_html_description_header File "site-packages\calibre\library\catalogs\epub_mobi_builde r.py", line 2666, in _generate_html KeyError: u'pagine' When i set a parameters for create catalog in the other options / additional description does not show me in the list the column I want. In any case, I would view the data from more custom columns and do not think it's possible. is right or am I wrong something? Why its function in jackets book and no in catalog??? TY for helping me .... Best regards Last edited by claxon; 02-17-2015 at 12:19 PM. |
|
10-14-2018, 06:27 AM | #15 |
Zealot
Posts: 145
Karma: 12
Join Date: Jun 2017
Location: Australia
Device: Mac Pro 2013 & Mini 2018, iPad Mini 4, iPhone 11, iBooks, K4Mac/PC
|
Since this was last responded to in 2015, is there an easier way to edit the template for the book jacket? Detailed instructions on how to do this would be appreciated, as I found it a bit complicated following the conversation above.
Thanks, Inukami |
Tags |
book jacket, metadata, solved, templates |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Language in book jacket... or as metadata? | enriquep | Library Management | 4 | 05-02-2014 08:05 PM |
Help! Big PB customizing jacket template | alphane | Library Management | 2 | 04-30-2014 12:28 PM |
Polish Book Metadata Jacket Shows Tags Twice. | Penny_Dreadful | Calibre | 2 | 03-17-2014 09:09 AM |
Book Jacket Metadata | GeckoFriend | Library Management | 3 | 03-23-2013 07:48 AM |
Help changing metadata on MobileRead book | krazy4katz | Amazon Kindle | 3 | 10-05-2009 09:07 PM |