Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 03-15-2017, 12:50 PM   #1
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
How to convert ''Headings'' to ''HEADINGS''?



Yesterday you helped me to solve a remotely similar issue! But try&error (with superficial knowledge) isn't the right approach to something serious like that, I think!

How to convert 'fully wrapped' headings to upper case? Please consider the richness of German: that is the existence of äöüß (apart from »«!? plus digits).

Code:
<h3 id="uoiDbz7uDaeECwRVEqYwYE5"><a href="Inhalt.html#Die 9 »weißen« Städte!">Die 9 »weißen« Städte!»</a></h3>
Wanted result: <h3...>DIE 9 »WEIßEN« STÄDTE!</a></h3>

Last edited by chaot; 03-16-2017 at 11:11 AM. Reason: add: Wanted
chaot is offline   Reply With Quote
Old 03-15-2017, 01:35 PM   #2
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Using the predefined function (in the editor of Calibre): Upper-case text (ignore tags)

Search:
<h3.+</h3>

Last edited by jbacelar; 03-15-2017 at 01:40 PM.
jbacelar is offline   Reply With Quote
Old 03-15-2017, 01:35 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,094
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
try a search and replace:
search:<h3(.*?)><a(.*?)>(.*?)</a></h3>
replace:<h3\1><a\2>\U\3\E</a></h3>
Turtle91 is offline   Reply With Quote
Old 03-15-2017, 06:37 PM   #4
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
You can also do this via css without changing the actual xhtml:

h3 { text-transform: uppercase; }
jhowell is offline   Reply With Quote
Old 03-15-2017, 06:57 PM   #5
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Quote:
Originally Posted by jhowell View Post
You can also do this via css without changing the actual xhtml:

h3 { text-transform: uppercase; }
Unfortunately text-transform does not work with Adobe RMSDK, the most extended render for epubs.
jbacelar is offline   Reply With Quote
Old 03-16-2017, 12:14 PM   #6
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Quote:
Originally Posted by jbacelar View Post
Using the predefined function (in the editor of Calibre): Upper-case text (ignore tags)

Search:
<h3.+</h3>
(with Regex-Function) Unfortunately → Find marks & Replace deletes the whole heading.

Quote:
Originally Posted by Turtle91 View Post
try a search and replace:
search:<h3(.*?)><a(.*?)>(.*?)</a></h3>
replace:<h3\1><a\2>\U\3\E</a></h3>
(with Regex) Find marks the whole heading & Replace throws an error message:

error: incomplete escape \U at position 14
Spoiler:
Code:
calibre 2.81  embedded-python: True is64bit: True
Linux-4.4.0-64-generic-x86_64-with-debian-stretch-sid Linux ('64bit', 'ELF')
('Linux', '4.4.0-64-generic', '#85-Ubuntu SMP Mon Feb 20 11:50:30 UTC 2017')
Python 2.7.9
Linux: ('debian', 'stretch/sid', '')
Successfully initialized third party plugins: DeDRM (6, 0, 8) && Diaps Editing Toolbag (0, 3, 4) && Wiki Reader (2, 1, 0) && Hello World Plugin (1, 0, 0)
Traceback (most recent call last):
  File "site-packages/calibre/gui2/tweak_book/boss.py", line 959, in search
  File "site-packages/calibre/gui2/tweak_book/search.py", line 1501, in run_search
  File "site-packages/calibre/gui2/tweak_book/search.py", line 1425, in do_replace
  File "site-packages/calibre/gui2/tweak_book/editor/widget.py", line 303, in replace
  File "site-packages/calibre/gui2/tweak_book/editor/text.py", line 595, in replace
  File "site-packages/regex/__init__.py", line 652, in _compile_replacement_helper
  File "site-packages/regex/_regex_core.py", line 1714, in _compile_replacement
  File "site-packages/regex/_regex_core.py", line 1782, in parse_repl_hex_escape
error: incomplete escape \U at position 14


@jhowell & @ jbacelar: The non-rendering of text-transform I experienced already practically & unpleasantly enough. Therefore I look now for other solutions.

Issues removed
Off topic!

Last edited by chaot; 03-17-2017 at 03:05 PM. Reason: add: :) correcting code: ">Immer seltener... / Issues removed/Off topic!
chaot is offline   Reply With Quote
Old 03-16-2017, 12:58 PM   #7
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
With your sample code:

Code:
<h3 id="uCmGQHCT4I2zAoOwD2nYQT3"><a href="Inhalt.html#Immer seltener werden in dieser Welt ... (undat.)>Immer seltener werden in dieser Welt ...</a></h3>
Search:
<h3.+</h3>
And Regex-Function: Upper-case text (ignore tags)

I get:

Code:
<h3 id="uCmGQHCT4I2zAoOwD2nYQT3"><a href="Inhalt.html#Immer seltener werden in dieser Welt ... (undat.)>IMMER SELTENER WERDEN IN DIESER WELT ...</a></h3>
jbacelar is offline   Reply With Quote
Old 03-16-2017, 01:23 PM   #8
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Funny! Here not. As I described: Find marks & Replace deletes the whole heading.
chaot is offline   Reply With Quote
Old 03-16-2017, 01:24 PM   #9
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by chaot View Post
(with Regex) Find marks the whole heading & Replace throws an error message:
Turtle91's regex does work, but only with PCRE-enabled editors such as Sigil. (Calibre uses the Python regex engine which is not PCRE compatible.)

With Turtle91's regex expressions you'll end up with the following in Sigil:

Code:
<h3 id="uoiDbz7uDaeECwRVEqYwYE5"><a href="Inhalt.html#Die 9 »weißen« Städte!">DIE 9 »WEISSEN« STÄDTE!»</a></h3>
As you can see, the PCRE engine is smart enough to replace the ß ligature with SS, which is probably what you want.

BTW, your fragment URL (Inhalt.html#Die 9 »weißen« Städte!) is invalid because it contains spaces and non-ASCII characters.

Last edited by Doitsu; 03-16-2017 at 06:38 PM.
Doitsu is offline   Reply With Quote
Old 03-16-2017, 01:38 PM   #10
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Quote:
Originally Posted by Doitsu View Post
As you can see PCRE engine is smart enough to replace the ß ligature with SS, which is probably what you want.
... weissen ... is the original spelling. I manipulated the example ''for every eventuality''.
I will not do that again. It's silly!
Quote:
BTW, your fragment URL (Inhalt.html#Die 9 »weißen« Städte!) is invalid because it contains spaces and non-ASCII characters.
Yes, you are right: now I recognize it. I didn't test and what you found faulty is just a by-product of my manipulation.

OK! I will now try to load the book in sigil to let the capitalisation done there.

Last edited by chaot; 03-16-2017 at 01:45 PM. Reason: result→by-product
chaot is offline   Reply With Quote
Old 03-16-2017, 01:51 PM   #11
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Does your search box have the same settings as the image?
Attached Thumbnails
Click image for larger version

Name:	Captura.JPG
Views:	287
Size:	61.9 KB
ID:	155687  
jbacelar is offline   Reply With Quote
Old 03-16-2017, 02:17 PM   #12
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
@Doitsu Quick and easy! My first attempt ever (or seriosly nearly ever) to sigil. I got it.

@Turtle91 regex (#3) functions (in sigil).

@jbacelar Sorry! That ... weisse Städte ... example doesn't exist anymore. It's already configured.
Please let me give you two ''real'' examples (which doesn't function → as described in #6).

Code:
<h3 id="uocwg8XafqRu2zVi8aZ2TH6">Rechts und Links</h3>
Code:
<h3 id="uwSzW8DWUPEK6RzzmX5nCi4"><a href="Inhalt.html#u2BtpeVxwIEyIFtCSZ7oQU6">Golkonda</a></h3>

Last edited by chaot; 03-17-2017 at 11:38 AM. Reason: add: → as described in #6 add: in (sigil)
chaot is offline   Reply With Quote
Old 03-16-2017, 02:43 PM   #13
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Luck and to the bull!
Attached Thumbnails
Click image for larger version

Name:	Captura2.JPG
Views:	297
Size:	63.1 KB
ID:	155689   Click image for larger version

Name:	Captura3.JPG
Views:	317
Size:	103.0 KB
ID:	155690  
jbacelar is offline   Reply With Quote
Old 03-16-2017, 03:32 PM   #14
chaot
Head of lunatic asylum
chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.chaot will give the Devil his due.
 
chaot's Avatar
 
Posts: 349
Karma: 77620
Join Date: Jun 2012
Location: UTC +1
Device: Tolino Vision 3HD
Exactly the same!

Click image for larger version

Name:	Golkonda.png
Views:	290
Size:	44.1 KB
ID:	155693
Golkonda

Last edited by chaot; 03-16-2017 at 03:38 PM. Reason: upgrading image
chaot is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Headings Hyperlinked? PhotonJohn ePub 5 04-05-2013 10:18 AM
Headings going awry MikeMJ Conversion 7 04-26-2012 04:19 PM
Chapter Headings Paxman53 Conversion 3 10-12-2011 12:31 PM
Why H1 and H2 Chapter Headings? Ransom Calibre 11 08-10-2011 04:29 PM
Different font for headings bremler ePub 4 03-11-2010 06:03 AM


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


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