docbook-apps

  • 1.  WebHelp and print

    Posted 03-20-2012 21:43
    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.

    Any suggestions?

    Regards,
    Paul Bort
    Systems Engineer
    TMW Systems, Inc.
    pbort@tmwsystems.com<mailto:pbort@tmwsystems.com>




  • 2.  Re: [docbook-apps] WebHelp and print

    Posted 03-21-2012 02:23
    On Wed, Mar 21, 2012 at 3:13 AM, Bort, Paul <pbort@tmwsystems.com> 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 , 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.****
    >
    > pbort@tmwsystems.com****
    >
    > ** **
    >



    --
    ~~~*******'''''''''''''*******~~~
    *Kasun Gajasinghe*
    Software Engineer; WSO2 Inc.; http://wso2.com,
    *linked-in: *http://lk.linkedin.com/in/gajasinghe*
    *
    *blog: **http://blog.kasunbg.org* <http://blog.kasunbg.org/>

    *
    twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg>



  • 3.  RE: [docbook-apps] WebHelp and print

    Posted 03-21-2012 03:18
    It looks like adding {margins: 0 0 0 0;} to #content is all I was missing. Thank you for your help.

    Regards,
    Paul Bort
    Systems Engineer
    TMW Systems, Inc.
    pbort@tmwsystems.com<mailto:pbort@tmwsystems.com>
    440 721 2233 (voice)
    440 290 2662 (fax)

    From: Kasun Gajasinghe [mailto:kasunbg@gmail.com]
    Sent: Tuesday, March 20, 2012 10:23 PM
    To: Bort, Paul
    Cc: docbook-apps@lists.oasis-open.org
    Subject: Re: [docbook-apps] WebHelp and print


    On Wed, Mar 21, 2012 at 3:13 AM, Bort, Paul <pbort@tmwsystems.com<mailto:pbort@tmwsystems.com>> 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 , 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.
    pbort@tmwsystems.com<mailto:pbort@tmwsystems.com>




    --
    ~~~*******'''''''''''''*******~~~
    Kasun Gajasinghe
    Software Engineer; WSO2 Inc.; http://wso2.com<http://wso2.com/>,
    linked-in: http://lk.linkedin.com/in/gajasinghe
    blog: http://blog.kasunbg.org<http://blog.kasunbg.org/>


    twitter: http://twitter.com/kasunbg