|
|
Thread Tools | Search this Thread |
07-08-2020, 09:43 AM | #61 | |
Bookmaker & Cat Slave
Posts: 11,495
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
You're a formatter, not a programmer, right? Perhaps in your experience as a formatter, a customer--who "lacked the technical competencies to do a specific thing that they wanted done," asked you to do something, assuming that it was simple to do, precisely BECAUSE they lacked those technical competencies? /done here. Hitch |
|
07-08-2020, 11:19 AM | #62 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
I really do not want to get into the middle of this as I have been tied up and have not been following this thread at all until now, but there does appear to be clear miscommunication innocently going on by all parties.
That said, please let me try to clarify things in the hope this does not degenerate further. 1. Assume you have an epub where the titles in the ncx or nav are correct and what you want. 2. Assume further that the actual headings tags in the xhtml files are either missing (they used p's) or not formatted in some sane way. (And yes this can be a common problem with Gutenberg and some other books). Now, the problem is if you want to regenerate the ncx or nav, using the Sigil tools because you want to later move, split, etc, you will not get back the ncx or nav entries that are there now. You will lose those "good" titles as they would be replaced during the regeneration of the ncx or nav with stuff taken from bad or missing heading tags. So what is being asked for here, is a plugin that will parse an existing ncx or nav and extract the link back and the title text. (Actually just supporting parsing an ncx would be enough as an ncx can be autogenerated from a nav on epub3). Then use that link to determine the destination file and in that file add a title attribute to the target heading tag that contains the title text extracted from the ncx/nav. If no target heading tag exists, then insert a new "no display" heading tag with the extracted title attribute. If working with title attributes is too hard, then instead simply add a comment tag with the title text immediately before the destination element. After this plugin was run then: If the title attribute on heading tags had been set, then regenerating the ncx or nav would preserve the good titles for the most part. If instead comments are added, then a follow-up regular expression search and replace can then be more easily done taking the title text from the just preceding comment. That is what is being asked for here. Hopefully, this will make everything clearer to everyone involved. Hope this helps. KevinH Last edited by KevinH; 07-08-2020 at 11:56 AM. |
Advert | |
|
07-08-2020, 11:35 AM | #63 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
FWIW, as everybody noted and that is evidently clear, miscommunication is the bane of IT support! The problem is that English words (any language really) are imprecise with many possible interpretations and meanings and what seems perfectly clear to one party is gobbledy-gook to the other and visa-versa.
This is why the true language of math and its supporting notation were developed (speaking as a just retired programmer and analytics/stats prof here!) because English words (even seemingly well defined) were simply not precise enough. The problem with teaching stats to students was that only one party understood the precise notation that most text books used and so my professor role really reduced to being that of a translator back to English with the hopes of still trying to be precise via lots of examples. That was not always fruitful and most people only learned things by rote and even more unfortunately good thinking (the forest) was typically lost in trees! To make matters worse, the overlap of domains of IT and English are less well structured than math and almost impossible to pin down (leaving lawyers as the only winners!). For IT/software, the advent of rapid protyping has helped, but obviously not fixed the issues. Last edited by KevinH; 07-08-2020 at 11:59 AM. |
07-08-2020, 12:04 PM | #64 | |
Bibliophagist
Posts: 40,555
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
I simply went from the first post wherein it was stated:
Quote:
|
|
07-08-2020, 12:06 PM | #65 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I guess I just don't follow why--given that the ncx (or nav) was already declared "good"--there would be any reason for regenerating the ncx from the text the proposed plugin took from that good ncx and plugged into the epub's html (utilizing attributes of h tags or contents of html comments that were later regexed into same).
Why insert non-rendering attributes into the html that can really only be used to regenerate the ncx if the ncx has already been declared sufficient? Is the whole point to make an already functional, textually satisfactory NCX/NAV regeneratable from the html? I could understand a desire for a plugin that truly reverses the html to ncx/nav process: namely making the various chapter/section headings in the html match the ncx/nav. But what I THINK I'm hearing, is a desire for a plugin that makes it possible to regenerate an NCX/NAV that doesn't need regenerated by inserting non-rendering html (or easily regexable non-rendering html comments) into the epub's xhtml. If done correctly, an ncx/nav generated from the attributes inserted into the html by the proposed plugin (from the original ncx/nav) would look and function exactly like the original ncx/nav, no? Last edited by DiapDealer; 07-08-2020 at 12:22 PM. |
Advert | |
|
07-08-2020, 12:15 PM | #66 | |
Bibliophagist
Posts: 40,555
Karma: 157444380
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
So, yes, being able to regenerate the NCX/NAV from the html is the whole point. |
|
07-08-2020, 12:17 PM | #67 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Yes, as any later use of Sigil tools (ie. split into chapters, or merging, or moves or ...) may force you to either hand edit the ncx or need to regenerate it. Regenerating it would be easiest but will lose content unless heading title attributes are first set.
Last edited by KevinH; 07-08-2020 at 12:19 PM. |
07-08-2020, 12:25 PM | #68 | |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Come to think of it, my ePub3-itizer plugin already has the code to parse an ncx and extract destination links and source text. You could convert those links to book paths, and use the plugin interface to open the correct destination file ... so a rough prototype should be doable.
If no one else wants to take a shot at this, I will ... but ... I am tied up for the two weeks or so. Quote:
|
|
07-08-2020, 12:28 PM | #69 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Seems like an overly Rube Boldberg-ian process to me, but I'll happily add it to the plugin index when somebody develops and uploads it.
|
07-08-2020, 04:03 PM | #70 | ||
Wizard
Posts: 2,304
Karma: 12587727
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Fantastic summary of what Mister L intends. Quote:
For example, the case I gave before of TOC: Code:
“Article Title” by First Last Code:
<h2>Article Title</h2> <p class="author">First Last</p> I have a perfectly good TOC already generated... so (theoretical) plugin should be able to: Code:
<h2 title="“Article Title” by First Last">Article Title</h2> <p class="author">First Last</p> |
||
07-08-2020, 04:34 PM | #71 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Sorry. I can usually at least comprehend someone else's use case for things like this, but I'm just not getting this one.
I think in terms of creating ebooks and fixing broken ebooks. That's about it. Turning someone else's ebook into something else (or multiple something elses) is simply not something I would bother doing. Why would one even want to split an omnibus ebook in the first place? The good news is that I don't have to "get it." |
07-08-2020, 08:12 PM | #72 | ||
null operator (he/him)
Posts: 21,002
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Financiers, merketeers and bureaucrats are the also destroyers of English. 'Bubble' being the latest overused fad word, yesterday I found myself typing '…a picket fence as a border bubble barrier…' Quote:
BR |
||
07-08-2020, 11:12 PM | #73 | |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Since I am not an author or epub developer, just an avid epub user, I rarely create new epubs. That said ... I often see almost this exact use case in older Gutenberg epubs. The missing headings (p tags used instead), a working ncx, and all chapters in one big file needing to be split at some point, horrible file naming, etc. I often find myself cleaning these up before adding them to my own library.
Quote:
|
|
07-09-2020, 05:00 AM | #74 | |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@Mister L...I've now discovered why no-one will be able to create the plugin you want from your spec. I continued working on the plugin, which is actually working now, more or less, according to your own spec(see below). But here is the point -- that plugin will only work for the epub that I used to test the plugin but it will never work for any other epub. Why? Well here's the problem with your spec:
Quote:
I also found a lone non-breaking space lurking in between the empty h1 tags in the Citation file in your test epub which unhappily screwed up the results. How did that get there? I didn't bother to fix that, no point since no one's going to use the plugin anyway. By that time, as you'll appreciate, I'd had enough. Last edited by slowsmile; 07-09-2020 at 11:57 AM. |
|
07-09-2020, 08:29 PM | #75 | |||
Groupie
Posts: 173
Karma: 91148
Join Date: Jun 2010
Device: Sony 350
|
Quote:
Quote:
Quote:
- splitting an omnibus - creating an omnibus from previously published individual books - adding new material to a previously published book (first chapter of a different book, as a preview; new introduction; etc.) - cleaning up a book (from Project Gutenberg) which was very badly formatted to begin with. As for the reason someone would have for doing any of these, in my case most of the time it's because that is what the client (a publisher) has hired me to do. |
|||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GUI Plugin "TOC View Generator" (was: Define Content) | Mick2nd | Plugins | 20 | 06-26-2024 04:19 AM |
V3 "Feature" Full Screen Add Book Dialog | johnelle | Library Management | 3 | 08-11-2017 03:43 PM |
A warning for Linux users: slow "Add Books", "Unknown" title and Author | rolgiati | Library Management | 8 | 07-24-2013 05:36 PM |
"Add existing files" doesn't show all directories | Ripplinger | Sigil | 5 | 02-23-2013 12:43 PM |
Feature Request - TOC Exclude "> My Books" | chrisparker | Library Management | 2 | 10-13-2012 12:44 PM |