05-29-2017, 01:57 PM | #1 |
Groupie
Posts: 172
Karma: 158116
Join Date: Oct 2015
Device: Kobo Glo HD (landscape), Kobo Aura One
|
EPUB Catalogs with plain text
I know this is an old thread and it seems nobody is working on the catalog feature anymore, but I have the same issue as documented above ... only for epub format ... I like to ask shether there is a solution/patch as well.
In section_list_templates.py I added {comment} in the author section. The epub catalog shows the html tags around the text instead of the plain text only. |
05-29-2017, 05:58 PM | #2 |
null operator (he/him)
Posts: 20,818
Karma: 27405122
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Moderator Notice
@Katja-hbg - I moved this to its own thread because
BR |
Advert | |
|
06-05-2017, 01:02 PM | #3 |
Groupie
Posts: 172
Karma: 158116
Join Date: Oct 2015
Device: Kobo Glo HD (landscape), Kobo Aura One
|
I found a solution for my specific design for a catalog. Please find here some more details than only my workaround as I like the catalog function and hope I can help to encourage others to use it with getting their ideas solved.
If you don't know anything about catalog in calibre read this: https://manual.calibre-ebook.com/catalogs.html If you like to adjust more follow this: https://www.mobileread.com/forums/sh...d.php?t=118556 My final catalog should cover some specific information for each book. The focus is on the content than on the design. In the catalog dialog I select EPUB with Option: author and genres (being tags). To get a marker in front of each book prefix is "+" for read-pct being "any" and "-" for read-pct "undefined". My custom column #cataloginfo concatenate e.g. download-date, number of pages, read-date and own rating, ... My custom column #commentshort contain beginning of #mycomment resp. metadata-comment. In the ...\resources\catalog\section_list_templates.py some rows are updated to the following: # Books by Author by_authors_normal_title_template = '{title} ; {#cataloginfo}' by_authors_series_title_template = '[{series_index}] {title} ; {#cataloginfo}' # Books by Genre by_genres_normal_title_template = '{title} ; {#cataloginfo}; {#commentshort}' by_genres_series_title_template = '[{series_index}] {title} ; {#cataloginfo}; {#commentshort}' All looks and works well after creating the catalog beside that the comment is showing html tags e.g. <p>. To solve this goto Preferences -> Advanced -> Template functions and enter function: my_html2text with Arg count: 1 and Program code: (pay attention to the spaces) def evaluate(self, formatter, kwargs, mi, locals, text): from calibre.utils.html2text import html2text return html2text(text) #commentshort adjusted to: {#mycomment:'test(field('#mycomment'), ' {#mycomment:.100}', ' KLAPPENTEXT: {comment:.300:my_html2text()}' )'} Now it looks as I like. Nevertheless it is a workaround and I really hope that someone take over the good work started by GRiker. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convert hyperlinks to plain text | anleva | Recipes | 8 | 03-29-2017 08:16 PM |
How to paste as plain-text in Sigil? | elenderg | Sigil | 4 | 09-28-2016 05:27 PM |
New Software: convert plain text files to epub/mobi format | MobiEpubMaker | Workshop | 38 | 04-27-2015 05:52 AM |
CSV Catalogs with plain text | Maggie-Me | Library Management | 9 | 06-18-2011 09:21 AM |
convert plain text to other formats ? | Joebill | Other formats | 6 | 05-10-2010 11:10 PM |