03-01-2015, 02:28 AM | #1 |
The Leprechaun
Posts: 8
Karma: 10
Join Date: Feb 2015
Location: Chapel Hill, NC
Device: none
|
XPath Expression Coding
I am trying to do a code for xpath in calibre that will make an images be content in the table of contents with a "name" but not the image because my ebook is a jpeg.doc in its content. Does anyone know the code which will work that? My images go something like this. My image file for page five is image-5. jpeg. Page six, image-6.jpeg and so on. Would anyone like to take a crack at this. After I get the new name for each file then I want to make that name a link from the TOC to its page. It is a little to challenging for someone who has had only a few programming classes and definitely not one in XPath Expressions.
|
03-01-2015, 01:44 PM | #2 |
Well trained by Cats
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Craaack
A Naked image Images should be place upon a page(s) using a H#/Div/P tag You index (List of Illustrations or Figures section) locations on pages Some things are best done with the editor (and a little TOC generator hand work) If you choose to use the automated tool: You should locate the Paragraph with the image (img) tag and make it a H# tag if you add to the <h3 title="foo on a stick"> that will be the label in the TOC The TOC edit (the white block with a T) allows lots of additional options, including a Move (this only affects the index, not the file view order) eg. List of illustrations Map 1
Map 2 Foo on a Stick |
03-02-2015, 01:11 AM | #3 |
The Leprechaun
Posts: 8
Karma: 10
Join Date: Feb 2015
Location: Chapel Hill, NC
Device: none
|
I will give it a try. Thank you for your input. If anyone else has other ideas let me know.
|
03-02-2015, 05:57 AM | #4 |
The Leprechaun
Posts: 8
Karma: 10
Join Date: Feb 2015
Location: Chapel Hill, NC
Device: none
|
Didn't work the first time. Calibre does its own structuring of XPath. I will try it a few different ways when I get a little more of a chance. I'm having two days off and I am not going to waste them. Probably on Wednesday night I try again. If anyone else has any thoughts feel free to write.
|
03-02-2015, 10:57 AM | #5 | |
Well trained by Cats
Posts: 29,782
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
In the Editor S&R, it is just REGEX It is easy to get which searches twisted FWIW I only use code view to make my TOC, so I can't further help with the XPATH |
|
03-02-2015, 07:33 PM | #6 | |
Wizard
Posts: 1,071
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
I always do like theducks says ...
Quote:
and make the TOC using [Generate TOC Using Major Headings] instead of XPath The ...title=" " shows in the TOC but not the image IMHO it's just easier that way, but then again I never do anything complicated either |
|
Tags |
coding, images, links, table of contents, xpath |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Xpath Expression list | JimLL | Conversion | 4 | 04-08-2012 02:29 PM |
Xpath expression for detecting chapter marks | p3aul | Calibre | 5 | 11-14-2010 11:14 PM |
Xpath TOC Expression | Agama | Calibre | 2 | 07-12-2010 02:24 AM |
XPath Expression wizard?? | tonyx3 | Calibre | 1 | 01-26-2010 04:49 AM |
XPath Expression Wizard Error | Crusader | Calibre | 4 | 12-27-2009 12:09 PM |