View Single Post
Old 01-20-2012, 11:13 AM   #12
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,557
Karma: 93980341
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
Quote:
Originally Posted by BeccaPrice View Post
but it's not 02s, it's 0>2s - what is the greater-than sign for?

let's say i want the series name first,number, and then title of the book. would the rule then read:

mobi:any device = ([{series:|(| }{series_index:0>2s||)}{title}] -> title)

and I'm not sure what the last ->title means, or why it's out of the square brackets.
Firstly, the "-> title" isn't a part of the rule. If you look at how you define a metadata plugboard, there are three parts to it: the format/device, the rule itself, and which metadata field the result should be sent to. The "-> title" is just a way of saying "place the output in the title field". It's not a part of the rule. Look at how you enter a plugboard in Calibre, and it'll become clear.

The "0>2s" is a Python formatting description and means:

0: Use a "0" as a fill character.
>: Right align the output in the available space.
2: Make the field 2 characters wide.
s: Display the result as a string.

Given that there's a fill character, the ">" is, in fact, redundant. Had there not been a fill character, though, it makes, say, a "7" display as " 7" rather than as "7 ".

Hope this helps.

Last edited by HarryT; 01-20-2012 at 11:15 AM.
HarryT is offline   Reply With Quote