I have a mediawiki template for a photo "gallery" - basically 2 images sized to span the width of the page. I am using mwlib / rl reports to generate pdfs from the wiki.
I need to have one format / size of the images for screen display and one for the pdf to make it appear correctly.
I have tried using various combinations of <div media="print" display="none"> and so on and it either displays in both screen and reports or neither.
Is anyone using mwlib / reportlab to create pdfs with different screen and report formatting? How do I tell reportlab to ignore certain sections?
Thanks!
On 11/29/2013 07:57 AM, Yan Seiner wrote:
I have a mediawiki template for a photo "gallery" - basically 2 images sized to span the width of the page. I am using mwlib / rl reports to generate pdfs from the wiki.
I need to have one format / size of the images for screen display and one for the pdf to make it appear correctly.
I have tried using various combinations of <div media="print" display="none"> and so on and it either displays in both screen and reports or neither.
Is anyone using mwlib / reportlab to create pdfs with different screen and report formatting? How do I tell reportlab to ignore certain sections?
I've made some progress but I'm still struggling with reportlab.
For mediawiki, the following gives the results I want, but reportlab prints both paragraphs:
Test page:
== Print ==
<div style="media:print" class="ys_print"> Lorem ipsum.... </div>
== Screen == <div style="media:screen" class="ys_screen"> Lorem ipsum.... </div>
Common.css:
@media screen { div.ys_print { display: none; } }
Print.css:
@media print { div.ys_screen { display: none; } }
How do I get reportlab to respect the media and display css?
Don't use an explicit @media in Common.css and Print.css, those are implicit. You don't need the div portion of the selectors, just use .ys_print and .ys_screen. Get rid of the style="media:*", those are completely invalid and meaningless.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
OK, thanks. That cleared it up a bit.
setting "display: none" in Common.css turns off display for printing as well; how do I get it to turn on for printing?
I tried
.ys_screen { display: none; } .ys_print { display: inline; }
in Print.css but it has no effect; neither paragraph prints.
On 11/29/2013 09:21 AM, Daniel Friesen wrote:
Don't use an explicit @media in Common.css and Print.css, those are implicit. You don't need the div portion of the selectors, just use .ys_print and .ys_screen. Get rid of the style="media:*", those are completely invalid and meaningless.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:5298cd41127262068343206!
mediawiki-l@lists.wikimedia.org