Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 11-14-2023, 02:48 AM   #1
halloleo
Groupie
halloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 156
Karma: 12649
Join Date: Feb 2020
Device: iPad
Template function to strip HTML?

I have a question about templates (I guess with that I am in the correct lace her at "Library Management", right?):

How can I strip HTML tags from a field in a template? I had a look at The calibre template language, but could not find anything for stripping HTML...

Background: The comments field might contain a lot of HTML (crap) which I don't want to see when I show it in a library column.
halloleo is offline   Reply With Quote
Old 11-14-2023, 02:50 AM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,651
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
There are Comment cleaning plugins ==>> Index of plugins

BR
BetterRed is offline   Reply With Quote
Old 11-14-2023, 03:03 AM   #3
halloleo
Groupie
halloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 156
Karma: 12649
Join Date: Feb 2020
Device: iPad
That's certainly one way to go: Getting rid of the formatting altogether. But in the Book pane on the right the formatting might serve a purpose.

So I thought just getting rid of it for the display as a column might be the gentler approach.

Are there extensions for the template language?
halloleo is offline   Reply With Quote
Old 11-14-2023, 03:18 AM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,651
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
calibre User Manual

Template doco is in the Tutorials section.

BR
BetterRed is offline   Reply With Quote
Old 11-14-2023, 04:47 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,770
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by halloleo View Post
Are there extensions for the template language?
Yes. You can add your own template functions written in python (User-defined Python template functions), and you can write entire templates in python (Python Template Mode). Both of these can use whatever bits of calibre you wish, although I suggest you be very careful if the function/template changes calibre's database.

The documentation @BR is referring to is here.
chaley is offline   Reply With Quote
Old 11-16-2023, 03:08 AM   #6
halloleo
Groupie
halloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameterhalloleo can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 156
Karma: 12649
Join Date: Feb 2020
Device: iPad
Aha, yes, that's cool. Thanks heaps. A lot to study though: Good for the weekend!
halloleo is offline   Reply With Quote
Old 11-16-2023, 03:20 AM   #7
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,039
Karma: 6422750
Join Date: Sep 2020
Device: Calibre E-book viewer
I've never tried this plugin myself, but I think it can do what you want:

https://www.mobileread.com/forums/sh...d.php?t=333861
Comfy.n is online now   Reply With Quote
Reply

Tags
html attributes, template language, templates


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can Calibre Strip HTML links when exporting to epub? Dasun Calibre 6 03-03-2020 02:47 AM
Using built-in template functions in a custom template function ilovejedd Library Management 4 01-28-2018 12:20 PM
Problem with contains function in save template MicaOlaAdams Calibre 5 10-21-2016 10:25 AM
How to Clean/Strip HTML from epub file? Jimbo724 General Discussions 9 12-12-2012 11:22 AM
Save Template: Strip out spaces Agama Devices 3 03-17-2012 03:12 PM


All times are GMT -4. The time now is 06:35 AM.


MobileRead.com is a privately owned, operated and funded community.