09-01-2018, 11:46 AM | #1 |
Member Retired
Posts: 61
Karma: 47166
Join Date: Sep 2018
Device: a lot
|
故事主要描述當伐木
故事主要描述當伐木
Last edited by PenguinCEO; 04-16-2020 at 06:37 AM. |
09-01-2018, 11:30 PM | #2 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
XPath is fully function as well, not to mention that you can use regex inside XPath expressions. Your XPath expression should be
//h:meta[@name="mainsection"] |
09-02-2018, 04:59 AM | #3 |
Member Retired
Posts: 61
Karma: 47166
Join Date: Sep 2018
Device: a lot
|
故事主要描述當伐木
Last edited by PenguinCEO; 04-16-2020 at 02:04 AM. |
09-02-2018, 05:31 AM | #4 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you want to generate a ToC with an XPath expression, your XPath expression has to end with a tag the toc entries will point to the matched tags. ToC entries cannot point to attributes.
|
09-02-2018, 05:32 AM | #5 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
And for that matter, toc entries must point to tags in the body not tags inside the <head> like <meta>
|
09-02-2018, 05:49 AM | #6 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
@Kovid: I think in this case they want to generate the text to be used in the ToC entry when pointing to the file. There might not be something near the start of the file that is suitable. I know that I sometimes add a heading with a "hidden" class to achieve this. But, if there was something suitable in the <head> section, I would use it. For example, using the contents of the <title> tag would make sense.
In the OPs case, it looks like they wants to use the <meta> to specify which files have a ToC entry, and what the entry text is. I can see the point, but I'm not sure if would be a common use case. Especially as I tend to the opinion that all the files should have a ToC entry. |
09-02-2018, 06:10 AM | #7 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The way the ToC wizard works is that it generates both the text and the link for each toc entry, you cannot use it just to generate text. So therefore it requires a tag in the body with text included. If for some reason you dont want that text displayed, the way to do it, as davidfor mentioned is to simply hide it with CSS, the the ToC wizard will read it and link to it, but it wont be visible when the book is read.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Feature Request: Non-modal Metadata Editor Window | Katsunami | Calibre | 3 | 03-20-2018 06:19 PM |
Feature Request for Editor | therealjoeblow | Calibre | 3 | 05-13-2016 04:12 PM |
WriteItNow 5 - now has a StoryLine Editor (a timeline feature) | Dr. Drib | Writers' Corner | 2 | 07-06-2015 07:10 AM |
yet another feature request | arslonga | Marvin | 0 | 11-15-2014 01:41 AM |
Feature request | iridius | Library Management | 1 | 02-22-2011 09:57 PM |