WebToEpub icon indicating copy to clipboard operation
WebToEpub copied to clipboard

royalroad.com - add demarcation between author's note and chapter content

Open xypha opened this issue 3 years ago • 6 comments

Describe the bug Currently, there is no demarcation between author's note and chapter content when a epub is generated for a royalroad fiction. Author's note maybe be present before a chapter begins (above chapter content) or after it ends (below chapter content) or both.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://www.royalroad.com/fiction/34293/dimension-breakers/
  2. Click on WebToEpub button
  3. Uncheck "Remove Author Notes"
  4. Click on "Pack EPUB"
  5. Scroll down to Chapter II in the generated epub
  6. See error

Expected behavior There is a clear demarcation between an author's note and the chapter content, at the beginning and/or the end, whenever author's note is present.

Screenshots

Author's note at the top - Bug You will see that chapter content (3rd paragram) begins immediately below the end of the author's note.

--

What a possible solution might look like - possible solution (This is a quick and dirty edit in mspaint) Putting the author's note in a box, or alternatively, adding a section break or "----" line to show the start and end of author's note will help.

Desktop (please complete the following information):

  • Windows 10
  • Firefox 106.0 (64-bit)
  • WebToEpub 0.0.0.150

xypha avatar Oct 21 '22 09:10 xypha

@xypha If you open the "Advanced Options" and then add the following to the "Stylesheet" option,

div.author-note-portlet {
   border: 1px solid black;
}

You should get a box drawn around the author's note. Warning, I have not tested this.

dteviot avatar Oct 21 '22 10:10 dteviot

@dteviot Thank you! I tweaked your recommendation a bit and tried it on one. It worked well.

div.author-note-portlet { border: 1px solid black; padding: 10px; }

Although this fixed the issue for me, it won't for others. Will you consider adding this to the default stylesheet? (probably after more extensive testing)

Closing the issue for now. Thanks again :)

xypha avatar Oct 21 '22 20:10 xypha

@xypha

Will you consider adding this to the default stylesheet?

This isn't really the right general solution. It works for Royal Road, but it's a special case, exploiting the class attribute used by Royal Road. It doesn't work for other sites, e.g. (e.g. Webnovel)

This was intended as a quick solution for you. While I work on a better solution, that should work for all sites.

I think the correct solution is to add a border style rule to the default stylesheet, and inject the class attribute into the author note elements.

dteviot avatar Oct 21 '22 22:10 dteviot

@xypha

Test versions for Firefox and Chrome have been uploaded to https://drive.google.com/drive/folders/1B_X2WcsaI_eg9yA-5bHJb8VeTZGKExl8?usp=sharing. Pick the one suitable for you, follow the "How to install from Source (for people who are not developers)" instructions at https://github.com/dteviot/WebToEpub/tree/ExperimentalTabMode#user-content-how-to-install-from-source-for-people-who-are-not-developers and let me know how it goes.

You may need to press the "Reset stylesheet to default" button on the "Advanced Options" under the Stylesheet to apply the changes to the stylesheet.

For my notes: 99 minutes work

dteviot avatar Oct 24 '22 21:10 dteviot

Looks good. Thank you. 👍

xypha avatar Oct 25 '22 05:10 xypha

Reopen, so I know to notify you when Chrome and Firefox stores updated.

dteviot avatar Oct 25 '22 18:10 dteviot

@xypha

Updated version (0.0.0.151) has been submitted to Firefox and Chrome stores. Firefox version is available now. Chrome might be available in 1 to 3 weeks. If you can't wait, Test versions for Firefox and Chrome have been uploaded to https://drive.google.com/drive/folders/1B_X2WcsaI_eg9yA-5bHJb8VeTZGKExl8?usp=sharing. Pick the one suitable for you, follow the "How to install from Source (for people who are not developers)" instructions at https://github.com/dteviot/WebToEpub/tree/ExperimentalTabMode#user-content-how-to-install-from-source-for-people-who-are-not-developers and let me know how it goes.

dteviot avatar Jan 03 '23 21:01 dteviot