View Single Post
Old 06-29-2013, 05:17 AM   #1
glos
Zealot
glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.glos ought to be getting tired of karma fortunes by now.
 
glos's Avatar
 
Posts: 132
Karma: 1070185
Join Date: Mar 2013
Location: Italy
Device: Kobo Aura HD
Am I doing it right?

Hello, everyone, I hope someone can help me with a small problem re custom columns/plugboards/template language

This is what I wanted to do:
As I'm using eBooks reader app (same as bluefire reader) on my 1st gen iPod Touch to read, I needed to do something that would make me see the series on the title, because there's no series sorting/info there, so following instructions here on MR (general metadata part) I did this (and it worked, keep reading ! ):

created custom column:
Code:
lookup name: initials
column heading: initials
column type: column built from other columns
template: {series:re(([^\s])[^\s]+(\s|$),\1)}
created 2nd custom column:
Code:
lookup name: shortened
column heading: shortened
column type: column built from other columns
template: {series:shorten(4,-,4)}
then, I put this

Code:
{series:lookup(.\s,#initials,.,#shortened,series)}{series_index:0>2s| [|] }{title} - {authors}
on the save template space of the "saving books to disk" in preferences.

and I put this:

Code:
{series:lookup(.\s,#initials,.,#shortened,series)}{series_index:0>2s| [|] }{title}
in metadata plugboard, with format "any format" device "save to disk" and destination field "title".

Now, it seems like it's working, so when I save an Epub to disk I have it neatly as
PFRWibo [16] Ink and Honour - moonblossom.epub
because it's book 16 of the "Prompt Fills, Remixes, Works inspired by others" series
and also when I drag and drop it to the documents folder of my reader app it shows as "PFRWibo [16] Ink and Honour"
which is awesome.

I have only a few problems with determinate shortened / initials series names, like, for instance: (yes yes it's all in my sherlock fanfic library) ^_^

1) Sherlock: With A Thousand Lies (And A Good Disguise)
becomes
initials: SWA TL(A GD
shortened: Sher-ise)

2) Sherlock and Mycroft - early years
initials: SaM- ey
shortened: Sher-ears

3) This is where I began
initials: TiwI b
shortened: This-egan

4) El sueño de la razón (The dream of reason)
initials: Esdlr(dor
shortened: El s-son)

5) A Cure for Boredom Universe
initials: A CfBU
shortened: A Cu-erse

and so on, so, the problem is for
a) single letters and symbols like "A" "I" "-" because they then have spaces after them (like "A CfbU")
b) parenthesis that are treated like part of the next or previous word (like: "Esdlr(dor"

is there a way to fix this? a way to have, for instance, for the initials:
1) SWATL(AAGD)
2) SaM-ey
3) TiwIb
4) Esdlr(Tdor)
5) ACfBU
and the likes?
(as for the shortened version, I can live with small imprecisions, nevermind)

I should mention that the instructions here had another custom column to build first, that was the strip_series one, so that we could avoid the various "The" "A" "An" words when building the initials and shortened versions, BUT I've always wanted to keep them, I don't like when series/titles are "Cure For Boredom Universe, A" … I hate it. Probably because it's not my first language, and when I think of a title, I start with the "A" part :P
So, I tweaked my calibre to my likings and put "strictly alphabetic" in Control formatting of title and series when used in templates and also in the library display.

So when building the custom colums, I skipped that first strip series one and only did the other 2, putting "series" instead of "stripped series" and as I said, it works. I only have those small problems

Anyone knows how to do this? I was only able to reach this far because of the detailed instructions, I don't understand this language very much

Thank you
and thank you Kovid (& everyone working on it) for Calibre, it totally changed the way I read and made it much better and easier to organize and keep track of things. And I can customize it so much, I changed the date display, use multiple colors, created custom columns, use plug-ins, nested tags, edit the TOC, polish books, convert books (now even docx, that was lovely), use the virtual libraries a lot, and multiple libraries... and I've barely scratched the surface, right? I love it. It's going to make me coffee next

I'm sorry for the vague title, but I didn't know if this was pertinent to plugboard, custom columns, template language... or what
glos is offline   Reply With Quote