Skip to content

Instantly share code, notes, and snippets.

@bsoist
Last active December 20, 2015 15:09
Show Gist options
  • Save bsoist/6152288 to your computer and use it in GitHub Desktop.
Save bsoist/6152288 to your computer and use it in GitHub Desktop.
This Fargo script takes the whole file and converts it to a format readable by TaskPaper. See http://4a.bsoi.st/ for more information.
/*
See http://4a.bsoi.st/ for more information
and an updated version of this.
*/
Task Whole Outline
var taskdata = "";
var bsoist_prefix = "";
var bsoist_suffix = ":\r\n";
op.firstSummit();
op.visitSubs(
function(headline,levelnum) {
taskdata += bsoist_prefix + headline.getLineText() + bsoist_suffix;
},
function(levelnum) {
bsoist_prefix = "- ";
bsoist_suffix = "\r\n";
},
function(levelnum) {
bsoist_prefix = "";
bsoist_suffix = ":\r\n";
}
);
file.writeWholeFile(file.getCurrentFilePath().split('.')[0] + '.todo',taskdata);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment