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

Option to remove section pages #58

Closed
majkinetor opened this issue Nov 30, 2021 · 8 comments
Closed

Option to remove section pages #58

majkinetor opened this issue Nov 30, 2021 · 8 comments
Labels
question Further information is requested

Comments

@majkinetor
Copy link

majkinetor commented Nov 30, 2021

This quickly pile up on larger projects - I can have from 10-30 empty pages with this like it is now.

Here is an example:

image

Can we have an option to remove them ?

@timvink
Copy link
Owner

timvink commented Nov 30, 2021

Definitely. If you inspect the print page, you can see that the section heading has the following HTML:

<h1 class="nav-section-title" id="section-extra">
                            Extra <a class="headerlink" href="#section-extra" title="Permanent link"></a>
</h1>

I could include some extra CSS. For example try:

.nav-section-title {
 display: hidden !important;
}

But probably you just want to avoid that sections have their own page because it takes so much space. That's controlled by some CSS from this plugin:

/* PDF page breaks - separate title page for each section */
#print-site-page .nav-section-title {
page-break-before: always;
page-break-after: always;
align-content: center;
text-align: center;
vertical-align: middle;
padding-top: 150px !important;
padding-bottom: 0em;
padding-left: 0em;
font-size: 2.5em;
}

You could try overriding it by adding:

 #print-site-page .nav-section-title { 
     page-break-before: avoid !important; 
     page-break-after: avoid !important; 
}

@timvink timvink added the question Further information is requested label Nov 30, 2021
@majkinetor
Copy link
Author

majkinetor commented Nov 30, 2021

Mhm... that doesn't seem to be working right... page-break-before works, but page-break-after doesn't have any effect

details

image

I guess I should remove all breaks and eventually add them explicitly on sections I do want them. What is the easy way to remove them all, so that it looks like HTML one:

details

image

@timvink
Copy link
Owner

timvink commented Dec 2, 2021

Looks there are some other CSS classes you need to overwrite, I think vertical-align is the culprit:

 #print-site-page .nav-section-title { 
     page-break-before: avoid !important; 
     page-break-after: avoid !important; 
     vertical-align: baseline !important;
     padding-top: 1em !important; 
}

@majkinetor
Copy link
Author

Nah :)

You can see for yourself:

@majkinetor
Copy link
Author

majkinetor commented Dec 3, 2021

God damn, I experimented a lot with F12 tools in chrome, messing around with all CSS on that element, and I found some constellations would produce desired result, but I can't pinpoint exactly what CSS combination needs to be set for this.... freaking css...

@timvink
Copy link
Owner

timvink commented Dec 3, 2021

Yeah this is too clunky. I will add an option to not include the CSS stylesheets. You can then add them yourself and modify them directly.

@timvink
Copy link
Owner

timvink commented Dec 11, 2021

Released in v2.2

@timvink timvink closed this as completed Jan 9, 2022
@majkinetor
Copy link
Author

Works great.

Thanks m8 :)

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

No branches or pull requests

2 participants