WebToEpub
WebToEpub copied to clipboard
[Feature Request] Resort Chapters Based on Numbers to Automatically go in Chronological Order
Hello!
I was wondering if I could request for a new feature to WebToEpub. Sometimes, there are websites where the Table of Contents is formatted in columns and looks like this:
When that happens, and the links are then processed and generated into WebToEpub, the chapter links would be completely out of order based on the columns, like this:
Is it perhaps possible to maybe add a new button (i.e. "Reorder Chapters" or "Sort Chapters") beside the row of buttons wherein the included chapter links can be automatically sorted out by number sequentially from chapter 1................chapter 100 (in chronological order)? Next to these buttons:
The above images and example doesn't include any chapter titles, but could the feature to resort chapters possibly factor in the text for chapter titles, but focus on only the numbers itself when resorting the chapters?
Really sorry for my poor explanation... Thank you again for this very miraculous tool!
@vanessabluellie I've run into this in the past. Unfortunately, it's hard to fix, due to the number of different combinations I can run into. Let me explain:
- If I just sort the chapters alphabetically, they go, "chapter 1", " chapter 10", "chapter 100", "chapter 11", etc.
- So, I'd need to parse the chapter titles and extract the chapter number. Which then runs into problems when they start going: "chapter X, part 1", "Chapter X, part 2", "Side story 2", etc.
- They don't always start with chapter, either. Sometimes it's C1, C2. Or even just "1", "2".
- And what happens when the chapter title has a number in it?
So, I'd love to do what you ask, but I have not been able to figure out a way to do it reliably. I'm open to suggestions. Possibly some way for users to tell WebToEpub that chapters are in X vertical columns? But I'm not sure how to communicate that to users in an easy to understand way.
@dteviot
Hello! My apologies for the late reply. But thank you so much for your detailed answer. I hadn't known that the process to do this would be rather complex. I apologise for the trouble. It does seem to be something that would require numerous factors to account for. There's no hurry at all for this, hopefully there will be a simpler solution to solve it in the future. Again, thank you very much and hope all has gone well for you!
@dteviot
For this kind of case, I usually use the link of the first chapter of the novel as a reference, then my scripts will detect elements containing next-chapter
or the like that should definitely go to the next chapter, then my scripts will scrape the next chapters with that method.
Well, this only works for my manual scripts. I don't know if this will work for browser extensions.