View Single Post
Old 09-02-2012, 02:45 AM   #1
Confused N00b
slothful began at the beginning.
Posts: 7
Karma: 10
Join Date: Sep 2012
Location: USA
Device: none
Using Templates with ePub data?

I'm trying to understand Calibre's template system, and failing miserably.

I have epub files with ISBN fields like this:
<dc:identifier id="uid">2940011827945</dc:identifier>
<dc:identifier id="PrimaryID" opf:scheme="URN">urn:uuid:9780547601182</dc:identifier>

For the later, I can do {identifier:select(urn)} and have urn:uuid:9780547601182 show up as a custom column. For the former, I have no way of actually getting 2940011827945.

My question is... how can I get just the value of the identifier field? Also, how can I take something like urn:uuid:etc and use the standard python list methods to trim off the static length bit at the beginning there I don't need?

I'd assume this should be inanely simple; how can I just access the value of any of the dc:? fields? (Especially, of course, the ISBN one... which {isbn} works for less than 1/10th of my books on, and the Extract ISBN plugin seems to completely ignore the opf file altogether...)

The template tutorial doesn't seem to have any examples of accessing this, so help would be greatly appreciated.

slothful is offline   Reply With Quote