Quote:
Originally Posted by chaley
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
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.