Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 10-19-2021, 03:59 PM   #16
DyckBook
Morlock
DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.DyckBook ought to be getting tired of karma fortunes by now.
 
DyckBook's Avatar
 
Posts: 34
Karma: 2734796
Join Date: Oct 2021
Device: Kindle Paperwhite
Quote:
Originally Posted by lomkiri View Post
Code:
def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs):

    i = match.group(2)
    if i: 
        return match.group(1) + str(int(i) +1) + match.group(3)
    return  match.group(0)
@lomkiri Thanks for posting this solution to @Karellen's problem.

I needed to sync some endnotes with their refs. In the manual I found a template language function called BuiltinAdd, but am not skilled enough to make use of it. Then I came across your solution and it worked for me.
DyckBook is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Create new section.xhtml from Python dxcore35 Editor 2 03-02-2020 07:47 AM
Can I create a template for the xhtml files? Banjo Sigil 9 01-02-2019 07:37 PM
mkepub tool to create epub from xhtml sethportman ePub 0 02-03-2012 08:59 AM
PRS-T1 How to create a highlight across 2 pages? diddy Sony Reader 0 01-15-2012 02:16 PM
Python script: batch create mobi's from epubs (if they don't exist) jmeb Conversion 0 05-20-2011 01:14 PM


All times are GMT -4. The time now is 08:31 AM.


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