Skip to content

Instantly share code, notes, and snippets.

@jeremyzilar
Last active July 4, 2023 01:57
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jeremyzilar/17f001c999e234083796215ca79e26eb to your computer and use it in GitHub Desktop.
Save jeremyzilar/17f001c999e234083796215ca79e26eb to your computer and use it in GitHub Desktop.
Copy Trello Board as text or markdown

Copy Trello Board as text or markdown

Wouldn't it be nice to copy out your Trello board as plain text or markdown to be able to put it in a weekly memo, shipping notice or release notes? Now you can!

How to use this

Copy this line of JS and paste it into the CONSOLE in your browser. The results will be saved to your clipboard.

Option 1: Copy your Trello Board as Markdown

This will copy your columns + cards as markdown right to left

var s = []; s.push("# " + jQuery(".board-header").children()[0].innerText); jQuery.fn.reverse = [].reverse; jQuery(".list:has(.list-header-name)").reverse().each(function() {s.push("\n## " + jQuery(this).find(".list-header-name-assist")[0].innerText + "\n"); jQuery(this).find(".list-card-title").each(function() {s.push("* " + this.innerText); }); }); copy(s.join("\n"));
Option 2: Copy your Trello Board as Markdown

This will copy columns + cards as markdown, left to right

var s = []; s.push("# " + jQuery(".board-header").children()[0].innerText); jQuery(".list:has(.list-header-name)").each(function() {s.push("\n## " + jQuery(this).find(".list-header-name-assist")[0].innerText + "\n"); jQuery(this).find(".list-card-title").each(function() {s.push("* " + this.innerText); }); }); copy(s.join("\n"));
Option 3: Copy your Trello Board as Plain Text

This will copy your columns + cards as plain text, right to left

var s = []; s.push(jQuery(".board-header").children()[0].innerText); jQuery.fn.reverse = [].reverse; jQuery(".list:has(.list-header-name)").reverse().each(function() {s.push("\n" + jQuery(this).find(".list-header-name-assist")[0].innerText + "\n"); jQuery(this).find(".list-card-title").each(function() {s.push("- " + this.innerText); }); }); copy(s.join("\n"));
Option 4: Copy your Trello Board as Plain Text

This will copy your columns + cards as plain text, left to right

var s = []; s.push(jQuery(".board-header").children()[0].innerText); jQuery(".list:has(.list-header-name)").each(function() {s.push("\n" + jQuery(this).find(".list-header-name-assist")[0].innerText + "\n"); jQuery(this).find(".list-card-title").each(function() {s.push("- " + this.innerText); }); }); copy(s.join("\n"));

This is the full, expanded JS for Option 1
var s = [];
s.push("# " + jQuery(".board-header").children()[0].innerText);
jQuery.fn.reverse = [].reverse; // Copies columns starting from right to left
jQuery(".list:has(.list-header-name)").reverse().each(function() {
  s.push("\n## " + jQuery(this).find(".list-header-name-assist")[0].innerText + "\n");
  jQuery(this).find(".list-card-title").each(function() {
    s.push("* " + this.innerText);
  });
});
copy(s.join("\n"));
@jeremyzilar
Copy link
Author

jeremyzilar commented Aug 18, 2016

  1. Copy this line of JS and paste it into the CONSOLE in your browser.
  2. Hit enter
  3. You've just copied your Trello board as Markdown.

Note — It might be hard to get this to work via a Chrome extension for web/security reasons, but if you do, send me a note!
See -> https://twitter.com/jeremyzilar/status/766074858392457216
I use TextExpander and have set this up to easily paste upon a key command.

(code modified via http://www.secretgeek.net/trello_ws)

@Puliczek
Copy link

Option 5: Copy your Trello Board as Plain Text

This will copy your columns + cards + tags (tags text need to be visible) as plain text, left to right

var s = []
s.push(jQuery('.board-header').children()[0].innerText)
jQuery('.list:has(.list-header-name)').each(function () {
  s.push(
    '\n' + jQuery(this).find('.list-header-name-assist')[0].innerText + '\n'
  )
  jQuery(this)
    .find('.list-card-details')
    .each(function () {
        let tags = this.innerText.split("\n");
        let text = tags.pop();
        let tagsString = tags.length !== 0 ? ' [' + tags.join('][') + ']' : ''
      s.push('-' + tagsString + ' ' + text)
    })
})
copy(s.join('\n'))

@popo63301
Copy link

Thanks a lot !

@davidjeanneret
Copy link

I get the following message now for Option 4 (has worked for ages, but just stopped working this week):

Uncaught TypeError: Cannot read property 'innerText' of undefined at :1:57

Any clues?
Ta. David

@robsonrosa
Copy link

Option 6: Copy your Trello Board as Markdown
This will copy your columns + cards + member as markdown right to left (Option 1 + member)

var s = [];
s.push("# " + jQuery(".board-header").children()[0].innerText);
jQuery.fn.reverse = [].reverse; // Copies columns starting from right to left
jQuery(".list:has(.list-header-name)").reverse().each(function() {
  s.push("\n## " + jQuery(this).find(".list-header-name-assist")[0].innerText);
  jQuery(this).find(".list-card-title").each(function() {
    let title = "* " + this.innerText;
    jQuery(this).parent().find('.member-avatar').each(function() {
        s.push(title + ' - ' + this.alt.split('(')[0])
    })
  });
});
copy(s.join("\n"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment