Brett on 28 Nov, 2012 02:22 PM
@print isn't recognized in the current version of webkit that Xcode uses, use media queries instead. I don't know how much luck you'll have with orphans and widows, either, but page-break-after and page-break-before will work. There's a setting in preferences to make headlines start on new pages automatically, too.
I'm using the @media query, sorry for the confusion there, meant
I use the setting to make headlines start on a new page. But
this is only something I wan't to apply to h1. For h2 and so forth
I need them to start on a new page only if it otherwise means they
will be orphaned (ie on the bottom of a page).
Brett on 28 Nov, 2012 08:04 PM
I'm afraid I don't have enough time right now to do extensive CSS experimentation on this. I can tell you that Marked is using the standard webkit rendering system and printing is all done through the webkit system. If you can get it to work in Safari, it should work in Marked. If I have time to look into this particular use case further, I definitely will.
Hi Bret! I understand that your time is limited. And I also
realize now that this is mainly a problem with webkit.
What I like to suggest though is this, and you yourself has also
pointed this out: A large portion, maybe even a majority of marked
users is not bloggers first and foremost. A lot of your users is
actually writers in other capacities.
To further develop marked to accustom the needs for print/pdf
would be something really great.
Hence I'd like to give some suggestions:
To solve the widow and orphan problem. It would mean a lot. And
I mean A LOT. If marked could be able to define the number of lines
on the start as well as the end of a page (or else apply
To have some elements not only begin with a page-break, but also
some elements to properly have a page break before them, if and
only if, they otherwise would be orphaned. This applies to heading
(for instance h2) that need to be at the same page as their
following paragraphs but where you don't wan't them to allways
appear at the start/top of a page.
To be able to set different margins for headers depending on if
it's margin relative to a a paragraph or the top of a page.
This types of settings, as I see it, is crucial to decent
typography for print. And would be a real killer to see in
I hope you understand we're I'm getting although me not having
english as my native language. I love marked. A lot. But I also see
tremendous potential for marked becoming a crucial companion app
for writers hooked up on the beauty of markdown.
Brett on 05 Dec, 2012 10:19 PM
I understand what you're asking for, but this is typesetting and page layout and not something that I imagine Marked or Markdown ever being capable of. If you need this level of fine-grained control, you're going to need to use a word processor, that's just the reality. I'm working on a new print system, but I can't make any promises that these requirements will be met.
Shoot! I really need this to work as well. I know you didn't
plan on using this as a typesetting sort of thing, but perhaps it
has grown there? I too can't get the page-break-after:avoid css to
work...is there any chance you could look into this?