Re: [docbook-apps] WebHelp and print

From
Kasun Gajasinghe <>
Date
2012-03-21T02:23:46+00:00
ID
CADg9GQYOWajkzinkBCk-=
Thread
Re: [docbook-apps] WebHelp and print
On Wed, Mar 21, 2012 at 3:13 AM, Bort, Paul <> wrote:

All,

 

I'm quite happy with the WebHelp option in 1.76.1, but I'd like to be able to print from it without having to turn off the TOC/Search each time. I've got this chunk of CSS that gets close:

 

@media print {

    body * {

        visibility:hidden;

    }

    #content, #content * {

        visibility: visible;

    }

    #content {

        position:absolute;

        left: 0;

        top: 0;

    }

}

 

(Based on http://stackoverflow.com/a/2618980.) But it still leaves blank space for the TOC along the left side. I tried "margin-left: 0px;" to counter the style set on the "content" div, but it didn't work, probably due to my lack of CSS knowledge.

You may just call showHideToc() _javascript_ function to hide the TOC. It's available in main.js file. If you still want to do this via CSS, understand how it hides the TOC, and  implement the same via CSS.

I tested it a little, and setting following CSS styles hides the TOC/Search. Mind that this is without your CSS styles. #sidebar stands for leftnavigation.

If you look closely, webhelp mainly has three div s inside <body>, ie #header, #content, and #sidebar. So, as you can see it's easier to deal with these separately rather than working appending CSS to body.

#content {

    margin: 0 0 0 0;

}

#sidebar {

    display: none;

}

Does this work for you? I tested this in latest snapshot, but showHideToc haven't changed logic-wise after the 1.76.1 release.

Regards,

--Kasun

 

Any suggestions?

 

Regards,

Paul Bort

Systems Engineer

TMW Systems, Inc.



 

-- 
~~~*******'''''''''''''*******~~~
Kasun Gajasinghe

Software Engineer; WSO2 Inc.; http://wso2.com,

linked-in: http://lk.linkedin.com/in/gajasinghe

blog: http://blog.kasunbg.org

 

twitter: http://twitter.com/kasunbg