Printing with style (or copy-as-Markdown/HTML)


#1

I’m a new TaskPaper user, and I’m still getting my head around what it offer (but I’m loving it already).

Two things that I’m hoping might be on the cards are greater control over printing, and (or) some way to get styled text out. For example with respect to the latter, it’d be great to be able to ‘copy-as-Markdown’ (to manipulate further elsewhere) or ‘copy-as-HTML’ (to, for example, paste into an email and send. Or even just the ability to share via a styled email.

I’m not talking about extensive formatting, either - bolded project headings, appropriate indenting, etc., rather than plain text. The default ‘look’ of TaskPaper documents, in a way that can be shared with non-TaskPaper (or non-Mac) users for greater readability than plain text.

Oh, and I know about scripts, and checked out the TaskPaper-to-Marked2 script, for example - couldn’t get it to work, though, (I gather I’m not the only one, from the discussion on the Extensions page). And I think that it might be overkill for what I’m looking for.

The issue of printing is probably less important to me as TaskPaper already prints using the nice, neat default style.

But - and I might be missing something obvious here, and perhaps this is already built in… I assumed that when I was playing with StyleSheets, changes I see on screen would translate to documents I print. So, if the selected stylesheet makes things tagged @priority(1) red, this would carry over when printing. That hasn’t been the case in practice (with the few styles I’ve downloaded to play with), but I’ve yet to fully explore the scope of what can be done with StyleSheets, and how to use them. Apologies if I’ve missed it.


#2

I was thinking that something like this would be great. Using something like the CSS that is used to implement the styles, but super simplified might work great.

So that you could format things according to the type (Project, task, note) and the depth.

In that way, if you have a project, you add whatever markup language accordingly. For example for markdown,

//This would be the default markup for all projects
item[data-type="project"] {
    begin:'#### '
}

item[data-type="project"][depth='1'] {
    begin:'# '
}
item[data-type="project"][depth='2'] {
    begin:'## '
}

item[data-type="note"] {
    begin:'*'
    end:'*'
}

item[data-type="task"]
    begin:'* '
}

The problem is that I am not very good at JavaScript. Maybe if we request this feature, someone might be able to work out some magic.

I also see that this could get complicated very easy, because if you have nested tasks, it would be difficult to translate that thought in some markup languages and you might end up with some surprises. Anyway. All we can do is ask, right??

@jessegrosjean, @macdrifter


#3

For export to HTML I think you will need some sort of script for the foreseeable future. Here’s one that I remember from a while back:

If I understand correctly I think this is possible now. The issue is that TaskPaper allows you to use a different stylesheet for viewing and printing. So I think you’ve just been modifying the “view” stylesheet. To change the one that you use for printing:

  1. File > Print

  2. Click the “Show Details” button so that you see the full print sheet

  3. In the TaskPaper section (to the right of the print preview document) you should see a popup control that allows you to choose the stylesheet for printing in addition to background color and header and footer options.


#4

I have been trying to use this Library to export to Markdown. The problem is that TaskPaper is very flexible in nature and it is hard to describe the parent-children relationship in some cases. For example,

Item1
|-Item2
|-----Item3
|—Item4
|-—Item5
|-—Item6
|--—Item7
|-—Item8
|-—Item9
|-----Item10
|—Item11
|—Item12
|-----Item13

It is very hard to export this to Markdown while keep some sort of hierarchy. I think that if one could move all the elements without kids first, something could be done to better translate this.

Item1
|—Item11
|-Item2
|-----Item3
|—Item4
|-—Item5
|-—Item8
|-—Item6
|--—Item7
|-—Item9
|-----Item10
|—Item12
|-----Item13

If someone knows any Ruby and is willing to help with this, it would be much appreciate it!