-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: better handling of adding the title to print and export to PDF #1744
Conversation
Hmm, I think we need a more permanent fix as this will break if the theme changes. In noteStyle.js, the styles for Markdown rendering are defined, in particular for h1. We could add to the list a new class like |
Ok, I'm genuinely confused now. This makes no sense to me. Printing should ignore the theme css anyway. Or do you want people to print black/blueish pages with grey/white text? |
@laurent22 did you see my comment? I really want to understand why supporting themes is needed for printing/exporting to PDF. |
Sorry I don't have time to look into this now, I'll check later. |
The style in noteStyle.js doesn't just define the colour but also padding, margin, font size, etc. I don't see why this particular element shouldn't have a CSS class like the other elements. Then that class can be easily styled in noteStyle.js, for example by making it an alias to h1 |
I see what you mean. However, I actually wanted to change the size depending on the length of the title. I currently use 2em. h1 uses 1.5em. But IMO it should be bigger than h1. It's the title after all. Anyway, I'll try to use a css class. Let's see how it turns out. |
Ok let's merge for now and we can improve if later we notice that it's causing issues. Thanks for the update. |
I will still work on a follow-up PR to implement a new css class. It's just my sis is in town, so it could take a bit longer. |
fixes #1743
When a document is printed or exported to PDF, a header 1 is prepended to the document with the title (internally adding a
# Title
).This also adds an additional entry to the TOC with the title of the document. This PR fixes this behavior. I've also added a helper function to change the appearance in the future.