View Single Post
Old 10-18-2012, 02:28 PM   #5
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Quote:
Originally Posted by chaley View Post
The template goes into the display variable, which is JSON encoded. You can see what it should be by looking at the OPF for a book in your library. One example is
Code:
{"composite_template": "{:'approximate_formats()'}", 
"contains_html": false, 
"make_category": true, 
"composite_sort": "text"
}
I strongly recommend that you look at the OPF because there are several fields that can play a role.
Yeah, I've actually looked through the OPFs and created copies of custom columns reformatted to be human legible (" to " then prettied up the resulting JSON with Notepad++). Still trying to get the date format right before I try anything more complex.

Quote:
Originally Posted by chaley View Post
Regarding date formatting, this is also a JSON-encoded string. One example is
Code:
{ "date_format": "yyyy/MM/dd" }
This, I've actually kinda tried (on Windows XP CLI). I believe I used the following:
Code:
--display='{"date_format":"MM/dd/yy"}'
Will have to double-check the actual batch file I used when I get home but I remember getting a message saying "No JSON object found" or something. For some reason, the batch file automatically terminates in XP (even though I explicitly added pause) so it's difficult to get the complete error message.

Edit:
I believe calibredb custom_columns -d would also show the basic JSON structure. Shows everything in single-quotes, though, but easy enough to figure out which needs to be converted to double-quotes.

Last edited by ilovejedd; 10-18-2012 at 02:40 PM.
ilovejedd is offline   Reply With Quote