Skip to content

Conversation

@micgro42
Copy link
Contributor

dw2pdf uses the print.css if there is no pdf.css available. It also allows the usage of the style.css for configured plugins. However, wrap's print.css removes the left margin from note boxes and causes the text to be displayed above the icon in the resulting pdf.

Adding a pdf.less fixes that problem and allows for feature changes affecting pdf only.

To work its magic, this pull request depends on the bugfix in splitbrain/dokuwiki-plugin-dw2pdf#325 .

dw2pdf uses the print.css if there is no pdf.css available. It also
allows the usage of the style.css for configured plugins. However wrap's
print.css removes the left margin from note boxes and causes the text to
be displayed above the icon in the resulting pdf.

Adding a pdf.less fixes that problem and allows for feature changes
affecting pdf only.
@selfthinker
Copy link
Owner

I finally had a look at this and am nearly happy to merge. I would make two changes:

  • I think it makes more sense to keep the spoiler styles out of this so they look like they look on the screen.
  • The styles overwriting the screen styles for .wrap_onlyprint are missing. This works:
.dokuwiki div.wrap_onlyprint {
    display: block;
}
.dokuwiki span.wrap_onlyprint {
    display: inline;
}

I would also add some comments so it matches the commenting style of the other CSS files and adds information on how and when the file is used and that it's usually used together with style.css. But I can do that in a separate commit.

Slightly related, what do you think of #130?

Pdf is often just a step in between to printing and as such often used
for archiving content. Hence content which should only be displayed in
print should also be displayed in pdf.

This is also consistent with hiding item that are marked as no-print.
@micgro42
Copy link
Contributor Author

Implemented your comments.

Since we now should have working onlyprint and noprint, I don't really see the use-case for having an additional onlypdf class as requested in #130. I would advice against it. Further, they could still manually implement it with userstyles, if they really need it in addtion to the existing classes.

@selfthinker
Copy link
Owner

Thanks. I've squashed your commits and made some more changes to avoid duplication. After using Less everywhere (#166), I created a shared LESS file in 9c20817.

@micgro42 micgro42 deleted the addPdfDotLess branch March 29, 2018 14:55
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

Successfully merging this pull request may close these issues.

2 participants