The original to start with, see
A very short ebook.
Quote:
Originally Posted by PeterT
You don't use the XPATH settings in the regular search area.
Try clicking on Tools | Table of Contents | Edit Table of Contents and then there is a button Generate ToC from XPath
|
Or just use the button ToC (see
Button-Edit the Table of Contents). But this button (from general calibre window) is more for to see the ToC than to edit, even so possible.
So you are quite right to mention the 'path': without Edit book window we wouldn't know the correct 'key phrases' to use (see
Edit the ToC in ... (Start) after
Fix HTML + Beautify current file)
In a (very) small ebook creating the ToC its enough to fill the
libprs500 window only HTML tags with tag names (like a, br, div, h1, h2 etc.) and ignore the attribute and value inputs. That's probably in bigger ebooks not to ignore in order to obtain a really sophisticated ToC (at moment I don't know).
Here results the same if using only
//h:h1 or (full expression)
//h:h1[re:test(@class, "bookTitle", "i")] - tested.
See
Create ToC from XPath and the result
Edit the ToC in ...(vers A).
Note: The HTML tags div and h2 get
id-numbers (both h2 different ones), but the HTML tag h1 gets none. Can you say something about
?
It's possible to customize the ToC, see
Edit the ToC in ...(vers B)
Quote:
Originally Posted by phossler
|
and then comes Python. Probably more questions in future.
Quote:
... why you were looking to use XPath. Sorry, but maybe you could provide a little more about what you were looking to do?
|
I like to edit a fair amount of books. Success often has to do with proper, well-known tools (calibre and around).
As a sailor I like to navigate, preferably in new territories.
Quote:
Originally Posted by eschwartz
... the regex did not work because you were in normal mode, not regex mode. The S&R can take regexes, like the translation I supplied, if treated correctly. xpath is totally different.
|
As we are already a bit further! I would also like to know something about regex mode. Beside of what is described in
regular expressions - a practical aspect maybe. S&R??? Please!
Correct treatment, very important.
There are some between us you'll explain dozen times the theory or even better once the practice.
XPath Tutorial is great (as far as I can tell). Only a small but not unimportant hint is missing: where you can do something with it. ToC or 'Table of content' isn't mentioned even once.
My pictures show details, always different ones.