Skip to content

Instantly share code, notes, and snippets.

@rdhyee
Created January 4, 2014 03:41
Show Gist options
  • Save rdhyee/8251338 to your computer and use it in GitHub Desktop.
Save rdhyee/8251338 to your computer and use it in GitHub Desktop.
I use this script to print out the textual content of a fargo.io subtree to the JavaScript Console, numbering each subitem. Example output: 1. A 1.1 A1 1.2 A2 2. B 3. C See http://outliner.smallpicture.com/fargoVerbs.js for more background.
(function(){
var t = Array();
t.push(0);
op.visitSubs (
function (headline, levelnum) {
t[t.length-1] += 1;
console.log(t.join(".") + ". " + headline.getLineText ());
},
function (levelnum) {
t.push(0);
},
function (levelnum) {
t.pop();
}
);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment