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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-10-2011, 08:14 PM   #1
eosrose
Enthusiast
eosrose began at the beginning.
 
Posts: 43
Karma: 14
Join Date: May 2010
Location: WI
Device: Sony PRS-T1
Insert metadata as page at start of book (epub to epub)

I've added custom metadata columns such as #genre and #wordcount (among others) and now I'm wondering if it's possible to somehow include this extra metadata in the output when I convert my epub to epub and select the "insert metadata as page at start of book" under "Structure Detection." I'm presuming that I would need to modify a template (unless there's a plugin that will do this?), but where would I find it? I'm still learning my way around, so any direction would be appreciated.
eosrose is offline   Reply With Quote
Old 11-10-2011, 08:52 PM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by eosrose View Post
I've added custom metadata columns such as #genre and #wordcount (among others) and now I'm wondering if it's possible to somehow include this extra metadata in the output when I convert my epub to epub and select the "insert metadata as page at start of book" under "Structure Detection."
Find your calibre configuration folder and create the following folder(s).

\resources\jacket\

Now go to the calibre program directory, on my machine it is

Calibre\resources\jacket

Copy the two files found there

stylesheet.css
template.xhtml

to the same folder you created under your calibre configuration directory. Now you can edit the files under your calibre configuration directory to suit your needs.

Good Luck.
DoctorOhh is offline   Reply With Quote
Old 11-10-2011, 09:17 PM   #3
eosrose
Enthusiast
eosrose began at the beginning.
 
Posts: 43
Karma: 14
Join Date: May 2010
Location: WI
Device: Sony PRS-T1
That's very helpful! I've been able to modify the template, but now I'm running into an issue when I try to include my custom metadata. I'm using {#genre}, but only getting an error when I try to run the conversion. I must be missing a step somewhere.
eosrose is offline   Reply With Quote
Old 11-10-2011, 09:31 PM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by eosrose View Post
That's very helpful! I've been able to modify the template, but now I'm running into an issue when I try to include my custom metadata. I'm using {#genre}, but only getting an error when I try to run the conversion. I must be missing a step somewhere.
I'm afraid my knowledge here is limited. I believe GRiker added this feature, maybe he'll see this and add his two cents.
DoctorOhh is offline   Reply With Quote
Old 11-10-2011, 09:35 PM   #5
eosrose
Enthusiast
eosrose began at the beginning.
 
Posts: 43
Karma: 14
Join Date: May 2010
Location: WI
Device: Sony PRS-T1
Good to know. In the meantime, I can at least customize the layout to my hearts content.
eosrose is offline   Reply With Quote
Old 11-10-2011, 10:38 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,433
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC, you cannot add custom column metadata to the jacket.
kovidgoyal is offline   Reply With Quote
Old 08-02-2012, 12:31 PM   #7
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,497
Karma: 424627
Join Date: Mar 2009
Device: iPad
In looking at the template.xhtml file, there is a comment describing how to add the contents of a custom column to the generated jacket.

Follow @dwanthny's instructions in post #2 above, then edit template.xhtml to add the name of the custom column whose contents you want included.

G
GRiker is offline   Reply With Quote
Old 08-08-2012, 06:47 PM   #8
BookJunkieLI
Addict
BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.
 
Posts: 273
Karma: 3136
Join Date: Jan 2010
Location: Long Island
Device: Nook, REB 1100, Ebookwise 1500, Jb-Lite, PRS-650, PB302, Asus T-90MT
Quote:
Originally Posted by GRiker View Post
In looking at the template.xhtml file, there is a comment describing how to add the contents of a custom column to the generated jacket.

Follow @dwanthny's instructions in post #2 above, then edit template.xhtml to add the name of the custom column whose contents you want included.

G
I appear to be doing something wrong with this but can't figure out what. I copied the two files to a new resources/jacket directory in the calibre configuration directory then edited the template.xhtml file to add the custom column I wanted. It's not showing up though and I don't know why. I put the following piece of code just below where the comments on how to add custom columns appears and right above the code for comments.

<div><b>{_fandom1_label}:</b> {_fandom1}</div>

Is there someplace else I'm supposed to put it?
BookJunkieLI is offline   Reply With Quote
Old 08-08-2012, 08:11 PM   #9
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,497
Karma: 424627
Join Date: Mar 2009
Device: iPad
Quote:
Originally Posted by BookJunkieLI View Post
I appear to be doing something wrong with this but can't figure out what. I copied the two files to a new resources/jacket directory in the calibre configuration directory then edited the template.xhtml file to add the custom column I wanted. It's not showing up though and I don't know why. I put the following piece of code just below where the comments on how to add custom columns appears and right above the code for comments.

<div><b>{_fandom1_label}:</b> {_fandom1}</div>

Is there someplace else I'm supposed to put it?
The lookup name you specified when you created the custom column was 'fandom1'? (Not the column name, the lookup name.)

What kind of column is fandom1?

Type the following in the search box:
Code:
#fandom1:True
Is the book you're converting listed?

G

Last edited by GRiker; 08-09-2012 at 07:09 AM.
GRiker is offline   Reply With Quote
Old 08-09-2012, 07:35 AM   #10
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,497
Karma: 424627
Join Date: Mar 2009
Device: iPad
I've reviewed the code (0.8.63). It works correctly, but the contents of the custom column are added only if there's a value in the custom column.

In other words, if you have a custom column whose lookup name is fandom1, and the column is empty, then nothing is added to the jacket template.

To review the steps for adding the contents of a custom column to a book jacket:
  1. Go to Preferences|Advanced|Miscellaneous. Click the Open calibre configuration directory button.
  2. Within your configuration directory, navigate to (or create) a subdirectory resources/jacket
  3. Go to your calibre program directory, navigate to the resources/jacket folder.
  4. Copy stylesheet.css and template.xhtml from resources/jacket in calibre's program directory to resources/jacket in your configuration directory.
  5. Edit the copy of template.xhtml in your configuration directory to add a custom column. The instructions are in a comment at the end of the file.
  6. Convert the book, selecting Insert metadata as page at start of book in the Structure Detection section of the Conversion dialog.

G

Last edited by GRiker; 08-09-2012 at 11:21 AM.
GRiker is offline   Reply With Quote
Old 08-09-2012, 10:56 AM   #11
BookJunkieLI
Addict
BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.
 
Posts: 273
Karma: 3136
Join Date: Jan 2010
Location: Long Island
Device: Nook, REB 1100, Ebookwise 1500, Jb-Lite, PRS-650, PB302, Asus T-90MT
Thanks for the help, GRiker. I think I figured out that even though I thought I was editing the copy of the file that was in the configuration directory under application data I think I was actually editing the version in the main Calibre program files directory. Which of course would mean that the configuration directory copy would override the file I was editing. <headdesk>

I am curious, are there any custom columns types that it won't work with? Or, so long as there's data in the field, it will work with any column type?
BookJunkieLI is offline   Reply With Quote
Old 08-09-2012, 11:18 AM   #12
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,497
Karma: 424627
Join Date: Mar 2009
Device: iPad
Quote:
Originally Posted by BookJunkieLI View Post
I am curious, are there any custom columns types that it won't work with? Or, so long as there's data in the field, it will work with any column type?
The code doesn't discriminate based on custom column type. I didn't test with every type of custom column, but text, Yes/No, date and composite should deliver reasonable results. With the others, you'll definitely get something, but the formatting of the value may be odd. If you run into a particular custom column type that doesn't seem to render as it should, post another comment with the column type you're using and what you expect to see, and I'll take a look at adding special formatting for that type.

G
GRiker is offline   Reply With Quote
Old 08-09-2012, 12:25 PM   #13
BookJunkieLI
Addict
BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.BookJunkieLI could sell banana peel slippers to a Deveel.
 
Posts: 273
Karma: 3136
Join Date: Jan 2010
Location: Long Island
Device: Nook, REB 1100, Ebookwise 1500, Jb-Lite, PRS-650, PB302, Asus T-90MT
Thanks. Those are pretty much the only columns I would want to use but if something comes up I'll let you know.
BookJunkieLI 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
Insert Metadata As Page At Start Of Book JayLaFunk Conversion 8 02-05-2011 02:44 PM
"Insert Metadata as Start Page" Error | Ticket #7238 carlyman Calibre 2 10-20-2010 11:30 AM
Bug? "Insert metadata as page at start of book" doesnt encode Comments field properly rollercoaster Calibre 2 04-24-2010 11:40 PM
Insert metadata as page at start of book economix Calibre 2 04-17-2010 02:20 AM
start a new page in an epub book ? NASCARaddicted ePub 9 08-18-2009 08:11 PM


All times are GMT -4. The time now is 10:48 AM.


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