paperoni icon indicating copy to clipboard operation
paperoni copied to clipboard

Include title in document

Open gdetrez opened this issue 2 years ago • 6 comments

Would it be possible to include the page title (the first header) in the epub chapters? Maybe as an option?

I'm using --merge more now but it's a bit confusing at time when I'm reading the generated epub and a new "chapter" starts without the original title for context. Even in single-url ebooks, I'm sometimes missing the title at the top of the document.

gdetrez avatar Dec 28 '21 11:12 gdetrez

Hello @gdetrez. I've added that in on the dev branch to just work by default. I hadn't planned on making a release until around late January 2022. Will you be able to compile a version from the dev branch just fine so you can use it? If not, then I can still publish a release so you can use it.

hipstermojo avatar Dec 30 '21 05:12 hipstermojo

Thanks @hipstermojo (and happy new year!)

Building the dev branch right now to test the new feature :smile:

gdetrez avatar Jan 02 '22 17:01 gdetrez

Built and tested, and it works great! Thx! I noticed you used the page title (the content of <title> in HTML) and not the first heading (usually <h1>) as the title, any particular reason?

gdetrez avatar Jan 02 '22 17:01 gdetrez

Hi @gdetrez . Happy new year to you too! The reason for that is actually trying to remain consistent with the original mozilla readability JS version. It first checks for the title from the <meta> tags, the <title> tag and then goes looking for it in the header tags <h1> and <h2> tags. If you're running Firefox, you can try opening the same article in reader view and you should see the same effect over there. If not, please send me the links because that might be a bug in paperoni instead.

Also note, the current commit has some unfinished work that will cause paperoni to panic/crash if your article can't be extracted. Please keep that in mind :sweat_smile:

hipstermojo avatar Jan 02 '22 18:01 hipstermojo

Thanks for the explanation. That makes sense. (dev paperoni hasn't crashed on me so far :crossed_fingers:)

gdetrez avatar Jan 02 '22 21:01 gdetrez

Alright then. I'll keep this open until I merge all the new changes.

hipstermojo avatar Jan 03 '22 04:01 hipstermojo