View Single Post
Old 02-28-2020, 07:11 PM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Firstly, the formats_paths function returns exactly what it is supposed to. It returns a list of the full paths for each format for the book with the format as a prefix. When using the Template editor, you can see the definition of each function by selecting the function lower half of the editor.

As to your template, I think you are after the name of the directory that holds the book. The following will do this:

Code:
{:'re(formats_paths(),".*\\([^\\]*?)\\[^\\]*?$","\1")'}
The only problem with this is if there are no formats for the book.

If you need to do this on a non-Windows box, the path separator will need to be changed.
davidfor is offline   Reply With Quote