From 7a3f62fe60d999cd45a2b08f4d89616e2895056a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Wed, 10 Jan 2018 17:33:35 +0100 Subject: [PATCH 1/3] feat: add pdf.less for export with dw2pdf 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. --- pdf.less | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 pdf.less diff --git a/pdf.less b/pdf.less new file mode 100644 index 0000000..e1f8196 --- /dev/null +++ b/pdf.less @@ -0,0 +1,20 @@ +.dokuwiki .wrap_spoiler { + visibility: hidden; +} + +/*____________ pagebreak ____________*/ + +.dokuwiki .wrap_pagebreak { + page-break-after: always; +} + +/*____________ avoid page break ____________*/ +/* not yet supported by most browsers */ + +.dokuwiki .wrap_nopagebreak { + page-break-inside: avoid; +} + +.dokuwiki .wrap_noprint { + display: none; +} From 5fadf743ab524b9e9e44d749f5599a7f7dd4a966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Wed, 28 Mar 2018 15:34:04 +0200 Subject: [PATCH 2/3] fix: hide spoilers in pdf --- pdf.less | 2 -- 1 file changed, 2 deletions(-) diff --git a/pdf.less b/pdf.less index e1f8196..6e8fd6a 100644 --- a/pdf.less +++ b/pdf.less @@ -1,5 +1,3 @@ -.dokuwiki .wrap_spoiler { - visibility: hidden; } /*____________ pagebreak ____________*/ From 51e80b509ec7a368a928d93aeb49fea2c5cbdc3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Wed, 28 Mar 2018 15:34:42 +0200 Subject: [PATCH 3/3] fix: show onlyprint in pdf 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. --- pdf.less | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pdf.less b/pdf.less index 6e8fd6a..c6a4e4a 100644 --- a/pdf.less +++ b/pdf.less @@ -1,3 +1,9 @@ + +.dokuwiki div.wrap_onlyprint { + display: block; +} +.dokuwiki span.wrap_onlyprint { + display: inline; } /*____________ pagebreak ____________*/