Not logged in. · Lost password · Register
Forum: General Help and Support General Stuff RSS
export_html: ugly style, how to fix?
Avatar
postscripter #1
Member for a month · 2 posts · Location: Baikonur
Group memberships: Members
Show profile · Link to this post
Subject: export_html: ugly style, how to fix?
Hi!

Seems like export_html strips away a lot of unnecessary page elements. So, that the main text moves into the highest-level HTML tag, which is div class="dokuwiki export". But that div is not designed for text. It has a gradient background and zero margins, so the page looks... not good.

The question is: why there's no styles for .export class in the default template?

And if one (say, me) is going to write some rules for .export, where is the best place to put them?

I tried to patch "dokuwiki\lib\tpl\dokuwiki\css\content.less" and clean the cache. I can see my rules in the summary css.php, but can't see them in the browser.


content.less:
/*____________ changes to export html ____________*/

.export {
    margin: 2em !important;
    padding: 2em !important;
    background-image: none !important;
}
The author has attached one file to this post:
Безымянный 1.png 177 kBytes
You have no permission to open this file.
This post was edited on 2020-03-12, 06:36 by postscripter.
Avatar
postscripter #2
Member for a month · 2 posts · Location: Baikonur
Group memberships: Members
Show profile · Link to this post
Oh, I just had to restart the browser. Now the new style applies.

Now I have padding, but can't get rid of the background, cause it's in <body>.

Are there developers on this forum? There probably should be slight patches to Export.php and content.less focused on disabling the background and increasing paddings.
Avatar
schplurtz (Moderator) #3
Member since Nov 2009 · 517 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
Hi,

The question is: why there's no styles for .export class in the default template?
Because this is precisely an export; with no special usage in mind. So no special treatment, no modification. Just the text part (that is designed to fit into the whole wiki). You want to see the export on screen directly, others may want to do something completely different with the export. With a special style, that would not be an export anymore. If you want a custom style, you have to write it yourself in a userstyle.css file; the export class is here to let you do that easily.

I tried to patch "dokuwiki\lib\tpl\dokuwiki\css\content.less" and clean the cache. I can see my rules in the summary css.php, but can't see them in the browser.
You will loose your modifications when you upgrade DW. The upgradeproof method is to create
a userstyle.css or userstyle.less file. You can use less css in both files.

Are there developers on this forum? There probably should be slight patches to Export.php and content.less focused on disabling the background and increasing paddings.
Yes there are. I'm not one of them so can't talk for them.  but your request would probably be denied because, a special style would make the export not be an export anymore; and it is easy to create a custom style. That said, feel free to open a bug report on https://github.com/splitbrain/dokuwiki, that's the preferred way to reach them.

Now I have padding, but can't get rid of the background, cause it's in <body>.
And it's even in <html>, so it's not possible to get rid of it without affecting the standard, non exported pages :-(
html {
    body {
        > div.dokuwiki.export {
            margin: 2em;
            padding: 2em;
        }
        background: unset;
    }
    background: unset;
}
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-04-02, 21:35:38 (UTC +02:00)