Print/Export HTML style sheet options

First time needing this feature so spent some time today with the CSS sheet help found here: https://support.omnigroup.com/omnifocus-2-modify-print-stylesheet/

Trouble is OF seems to do something absurd here and use H2 to describe BOTH folders and projects… so there’s no way to easily differentiate via CSS. Any change to the H2 characteristics apply to both Folders and Projects. This makes the export pretty tough to comprehend within the context of folders.

Why can’t folders be attributed to H1 or H2 and then Projects can be H3 (since actions are H4). I don’t see that H3 is used at all.

Is there another reason or documentation source that I’m naive to?
Is there a workaround here? I considered exporting via TP format to another app that is more graceful with exports, but not luck there. OF is actually pretty nice for this except this one hiccup.

1 Like

Think I may have come up with a workaround. One of the things about the project folders is they don’t have a <span class="count"> element within, so you can use JavaScript to fix.

Replace:

<body><!--$BODY--></body>

With:

<body><!--$BODY-->
<script>
var headings = document.querySelectorAll('h2');
for (var i = 0; i < headings.length; i++) {
    if (!headings[i].querySelector('.count')) {
        headings[i].className = 'folder';
    }
}
</script>
</body>

And after that you can style folders specifically with h2.folder in your CSS.

Hope that helps!

2 Likes