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

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-30-2013, 07:33 PM   #1
Hendrixxxxxxxx
Connoisseur
Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.
 
Posts: 67
Karma: 136594
Join Date: Jan 2013
Location: Hong Kong
Device: Kindle DX, Paperwhite, Paperwhite II, and Voyage
Help with Syntax please.....

I have been playing around with plugboard, and I have got most of the way to where I want to be, but, having zero experience with template language, I am a bit stuck on one small issue, which I was wondering if someone could help me with.

I have the following plugboard template:

{authors}{series_index:0>2s| - Book | of }{series}

which works beautifully, and gives me an output in the "authors" field on my paperwhite such as this:

J K Rowling - Book 07 of Harry Potter

I would like, if possible, the output to look like this:

J K Rowling - (Book 07 of "Harry Potter")

Using the following syntax:

{authors}{series_index:0>2s| - (Book | of }"{series}")

I can get the output I want if the book is part of a series, which is great. However, if the book is not part of a series (if the series field is empty), the output looks like this:

J K Rowling"")

rather than just

J K Rowling

Is, what I am trying to do possible, and if so, where am I going wrong with the syntax please? I have tried to use the calibre manual for clues as to what the problem is, but its all way over my head.

Thanks in advance

Hendrix
Hendrixxxxxxxx is offline   Reply With Quote
Old 01-30-2013, 09:56 PM   #2
Sabardeyn
Guru
Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.
 
Sabardeyn's Avatar
 
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
Wild guess, but you might need to escape the parenthesis and quotation characters.

If I'm correct, calibre is interpreting these as programming instructions for how it should process the equation. Not as output instructions for the plugboard.

Of course I could also be totally wrong.
Sabardeyn is offline   Reply With Quote
Advert
Old 01-30-2013, 10:39 PM   #3
Hendrixxxxxxxx
Connoisseur
Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.
 
Posts: 67
Karma: 136594
Join Date: Jan 2013
Location: Hong Kong
Device: Kindle DX, Paperwhite, Paperwhite II, and Voyage
Quote:
Originally Posted by Sabardeyn View Post
Wild guess, but you might need to escape the parenthesis and quotation characters.

If I'm correct, calibre is interpreting these as programming instructions for how it should process the equation. Not as output instructions for the plugboard.

Of course I could also be totally wrong.
That's what I suspected at first, but the fact that it works fine if the book is part of a series suggests that its my syntax which is the problem.
Hendrixxxxxxxx is offline   Reply With Quote
Old 01-30-2013, 11:20 PM   #4
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,117
Karma: 73448614
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Does
Code:
{authors}{series_index:0>2s| - (Book | of}{series:| "|")}
work?
PeterT is offline   Reply With Quote
Old 01-31-2013, 12:17 AM   #5
Hendrixxxxxxxx
Connoisseur
Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.Hendrixxxxxxxx knows how many angels can dance on the head of a pin.
 
Posts: 67
Karma: 136594
Join Date: Jan 2013
Location: Hong Kong
Device: Kindle DX, Paperwhite, Paperwhite II, and Voyage
Quote:
Originally Posted by PeterT View Post
Does
Code:
{authors}{series_index:0>2s| - (Book | of}{series:| "|")}
work?
Beautifully!!

Thank you very much Peter.
Hendrixxxxxxxx is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax tags MMAC Library Management 1 02-29-2012 03:51 PM
Help with plugboard syntax, please Ptarmigan Library Management 3 02-15-2012 05:44 AM
Help with search syntax please. rwelbourn Library Management 3 04-16-2011 02:07 AM
Markdown Syntax in Comments itimpi Calibre 11 01-25-2011 11:28 AM
Removing header syntax. boromirofborg Calibre 0 07-21-2010 12:33 AM


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


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