Keep-together macro

Comments

15 comments

  • Avatar
    Stefan Kleineikenscheidt

    Hi Graham,

    due to a restriction of our meta model (which is used to export content to multiple output formats) it is not easy to define a <div> and define a keep-together on it. However, I have talked about this to my colleagues, and we will add this in a future release (related JIRA issue: http://k15t.jira.com/browse/PDF-229).

    Do you have specific sections of text in your mind? E.g. for admonitions, line items, etc. some additional CSS rules might help. Let me know.

    -Stefan

    0
    Comment actions Permalink
  • Avatar
    Graham Mueller

    Hi Stefan,

    Thanks a lot for considering my request. If your team is interested, I would be willing to work with you on its development. I'm not sure what your stance is on that, but I thought it might help us to produce a product that is what we're hoping for.

    After further discussion with the folks I'm working with, it seems like the requirements are relatively (at least for now) simple.

    The main feature they are hoping to see is a sort of "intelligent page break" -- rather than just chopping a page where the content length exceeds the page length, perhaps break at a landmark (say a header, a table cell, or something like that). At the same time, we don't want to just randomly break after the end of a section, leaving a page with just a few lines on it.
    Similar to the idea of repeating table headers, they thought the option to repeat section headers (h1, h2, ...) might be useful.

    I'm attaching a couple of (edited) images showing what we are seeing as compared to what we think would be useful to see. I had a difficult time finding a good example page where the text was being broken mid-cell or a table, or a heading was left on its own, but I have seen it before. I guess what this really comes down to is less of a keep together macro and more of a re-think of page breaks.

    Let me know what you think of this

    0
    Comment actions Permalink
  • Avatar
    Stefan Kleineikenscheidt

    Hi Graham,

    I understand that you do not only want to define breaks after certain landmarks, but have finer control.

    Other than defining keep-togethers, you can also enter pagebreaks with this macro: {scroll-pi:type=pagebreak}  (FYI, PI stands for "processing instruction"). This will let Scroll Wiki PDF export enter a page break during export. For better usability this we recommend to add a user macro which outputs the above statement.

    Does this help?

    -Stefan

     

    PS: I can't see the images you've meant to attach. Let me know if you had troubles attaching the images.

    0
    Comment actions Permalink
  • Avatar
    Graham Mueller

    I think I may have forgotten to actually attach the images. I'm starting with that this time... Ok done.

    The type=pagebreak has been noted, and probably could have resolved some of the issues we are seeing on the page. However, this would require manually pagebreak additions for any page we see issues, which obviously isn't preferably. What other scroll processing instructions are available to us?

    Are you willing to consider the developmental changes I'm asking about? Again, I am willing to help with it if you need.

    Thanks for the help as always.

    Graham




    badbreak.png
    unnecessarybreak.png
    numberissue.png
    tablebreak.png
    0
    Comment actions Permalink
  • Avatar
    Stefan Kleineikenscheidt

    Hi Graham,

    thanks for the feedback.

    The processing instructions are mostly used for exporter specific features - e.g. in Scroll Office Word Exporter its possible to add a section break in the resulting Word file, or switch the page orientation to landscape. For PDF Exporter we currently support only the page-break instruction.

    For the examples you have attached, I think the following CSS rule should help for badbreak.png and tablebreak.png (the rule keep together list-items and tables, just add it to the text area on the content formatting panel in the template UI):

    ul li, table {
      page-break-inside: avoid;
    }

     

    For numberissue,png please check the wiki code. I think it might not start a new paragraph. (Also, have you considered using the numbered lists in Confluence.)

    For the unnecessarybreak.png, what is the desired behavior? (The default template enters a page break before each level-1 heading.)

    WRT to the development changes, what exactly do you mean? Repeating table headers? Also, I am not sure I fully understand how you want to help? If you want, we can take this one offline, just email me at stefan AT k15t DOT com.

    -Stefan

    0
    Comment actions Permalink
  • Avatar
    Graham Mueller

    The class you suggested seems to work for the table, but not really for li elements. I'll try looking at this more later on. It's certainly a good start though.'

    My bad with the number issue... It is an issue with the our writers harder coding numbers rather than using the wiki markup, I don't know why. I will have to bring that up with them.

    Thinking about it, you are probably right to have the extra page-break. In most cases it will look best. The example I gave was just another example of poor writing style, which again will have to be addressed internally.

    Lastly, in terms of development, it appears that we have been able to address most of the problems here (assuming I can get the li keep-together to work). I do still like the idea of having the control of page-breaks, but your solutions seem to fulfill my needs for the time being.

    Thanks again,
    Graham

    0
    Comment actions Permalink
  • Avatar
    Graham Mueller

    Notably, ol li,table seems to be the correct rule

    0
    Comment actions Permalink
  • Avatar
    Stefan Kleineikenscheidt

    Hi Graham,

    glad you figured it out.

    The missing rule for "ol li" is actually a "bug" in our very own K15t theme.

    -Stefan

    0
    Comment actions Permalink
  • Avatar
    Thomas Wendel

    Hi Stefan,

    We have the problem that Graham documented in the screenshot "unnecessarybreak.png". We would rather have the Scroll Wiki PDF Exporter not to insert a page break before each level-1 heading. I tried a couple of things in the Content Formatting of a template like:

    h1 {
        page-break-before: avoid !important;
    }

    But nothing seems to work. Its not easy if I can not use Firebug to snoop around the PDF as I normally would on a Confluence page to solve such a problem ;-) So I would be really grateful if you could tell me how I can get rid of the page breaks before the level-1 headings.

    Cheers,
    Thomas

    0
    Comment actions Permalink
  • Avatar
    Stefan Kleineikenscheidt

    Update: should be page-break-before: avoid; (not 'none')

     

    Thomas,

    this should do:

    div.section-1 {
        page-break-before: avoid;
    }

    see here: http://www.k15t.com/display/PDF/Content+Formatting

    FYI: Scroll Wiki PDF Exporter is adding additional div into the HTML before converting to HTML to allow for indentation based on the nesting depths

    -Stefan

    0
    Comment actions Permalink
  • Avatar
    Thomas Wendel

    Hi Stefan,

    Thank you very much for quick response and pointing me to the right page in the documentation.
    The export works like a charm now.

    Cheers,
    Thomas

    0
    Comment actions Permalink
  • Avatar
    Frank Breedijk

    Is there any way to do this for the export to word plugin?

    0
    Comment actions Permalink
  • Avatar
    Nils Bier

    Hi Frank,

    Thanks for your question - unfortunately it's currently not possible, however we have tracked this as an improvement in our JIRA system: https://k15t.jira.com/browse/EXP-1091.
    Please sign up at https://k15t.jira.com/secure/Signup!default.jspa to watch, comment on or vote for this issue. You'll then get a notification for every status update on the issue.

    As a workaround, you would need to control the pagebreaks either in your template settings, or by using the pagebreak macro and insert it before the section you want to keep together (see https://help.k15t.com/scroll-office/adding-pagebreaks-75367932.html).

    Hope that helps.

    Best,Nils

    0
    Comment actions Permalink
  • Avatar
    Michal Gregor

    Hello,

     

    any idea how to use page-break-inside: avoid; for .confluence-information-macro ?? The macro is broken really often after export (see. Img).

     

    Thanks for the help

    Michal




    Img.PNG
    0
    Comment actions Permalink
  • Avatar
    Nils Bier

    Hi Michal,

    unfortunately this is a known issue with our current PDF library (see issue https://k15t.jira.com/browse/EXP-528). The only workaround would be to place a scroll pagebreak macro before the affected macros.

    We're already evaluating a new library which should fix the issue, however I can't give you an ETA when this will be available in the Scroll PDF Exporter. Please sign up at https://k15t.jira.com/secure/Signup!default.jspa to watch, comment on or vote for this issue. We'll then send a notification for every status update.

    Best,Nils

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk