![]() |
#1 |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2022
Device: kindle kwp4
|
![]()
I want to modify the ebook to bionic reading using CSS styles, but I can't write the regex.
Code:
p{ font-weight: bolder; } Code:
=ROUNDDOWN(LEN(A1)/2,0) Code:
Sub bold() For i = 1 To [a65536].End(xlUp).Row Cells(i, 1).Characters(1, 5).Font.bold = True Next End Sub pls help me Finish that Additional CSS |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,509
Karma: 78910112
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
If people want some background on this see https://www.mobileread.com/forums/sh...d.php?t=346904
Sent from my Pixel 4a using Tapatalk |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
As mentioned in the other thread, you could do it using a regex function in the editor. A quick and dirty one would be:
Code:
import math def replace(match, number, file_name, metadata, dictionaries, data, functions, *args, **kwargs): boldlen = math.ceil(len(match[0])/2) boldedword = '<b>' + match[0][:boldlen] + '</b>' + match[0][boldlen:] return boldedword |
![]() |
![]() |
![]() |
#4 | |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2022
Device: kindle kwp4
|
Quote:
|
|
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2022
Device: kindle kwp4
|
Quote:
Code:
p{ font-weight: bolder; } |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
As to my code, that is used in the calibre editor. It would allow you to change one book at a time to see if it works for you. It is a regex function that is used as part of the search and replace. With it, you do a search using the regex specified, and the function doe the replace side of. I would suggest you look at the help for the editor to see how to use it. If you still have problems after that, then ask questions. And my code is just a sample. It is what I thought of when I saw the page that is referred to above. It is an simplistic implementation that would only be good to get an idea of whether the Bionic Reading would work for you. Which I only did as a I was curious about whether I could. And I see lots of problems that I have no interest in solving as I don't have an interest in reading in that way. If this was to be done "properly" it would probably need to be in a plugin. And, as the Bionic Reading clearly states, there are Patents around it, so it should be licensed to use their API. Maybe someone will be interested in doing that. |
||
![]() |
![]() |
![]() |
#7 | |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2022
Device: kindle kwp4
|
Quote:
|
|
![]() |
![]() |
![]() |
#8 | |
Junior Member
![]() Posts: 7
Karma: 10
Join Date: May 2022
Device: kindle kwp4
|
Quote:
Code:
>[^<]+< Code:
\b(\w+)\b |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bionic Reading implementation on Kobo? | jeff47 | Kobo Developer's Corner | 28 | 06-03-2022 09:54 AM |
pdf regex question - regex that wraps to a new line | flyash | Conversion | 1 | 09-05-2021 09:00 AM |
Regex question | theaccountant | Library Management | 0 | 11-07-2016 02:29 PM |
Regex help on reading Metadata from file name. | JohnnyBook | Library Management | 11 | 03-05-2015 07:35 PM |
RegEx question (again) | phossler | Sigil | 12 | 01-20-2013 02:37 PM |