Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include title in document #22

Open
gdetrez opened this issue Dec 28, 2021 · 6 comments
Open

Include title in document #22

gdetrez opened this issue Dec 28, 2021 · 6 comments

Comments

@gdetrez
Copy link

gdetrez commented Dec 28, 2021

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.

@hipstermojo
Copy link
Owner

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.

@gdetrez
Copy link
Author

gdetrez commented Jan 2, 2022

Thanks @hipstermojo (and happy new year!)

Building the dev branch right now to test the new feature 😄

@gdetrez
Copy link
Author

gdetrez commented Jan 2, 2022

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?

@hipstermojo
Copy link
Owner

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 😅

@gdetrez
Copy link
Author

gdetrez commented Jan 2, 2022

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

@hipstermojo
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants