librelist archives

« back to archive

Arbitrary Markdown

Arbitrary Markdown

From:
Jason Miller
Date:
2014-06-04 @ 17:25
Hi,

The version of org-trello in MELPA can't handle all possible markdown.

If the problem I describe below has already been fixed, let me know and
ignore the rest of the e-mail.  Otherwise let me know and I can submit
the patch for the issue that I currently use.

In particular it fails fairly catastrophically with cards that contain
top-level bulleted lists, since the markdown syntax for that would be:

* Item 1
* Item 2
* Item 3

If someone adds that to a card description, then you do a sync-from, it
ends up in the org mode like that, which gets interpreted as more
toplevel headings.  This means that the next "Sync to" will fail as the
new toplevel headings get interpreted as new cards (and they likely
don't have a valid todo keyword).

I hacked up a solution yesterday that solves the problem by:

1) When syncing *to* trello, detect the indent level of the first
line in the description; then strip thos columns from the rest of the
description

2) When syncing *from* trello, indent the description in org mode by 2
columns.

This allows a comfortable editing of descriptions (you can use whatever
indent you like) and also ensures that the description text stays the
same on a round trip.

Example:

* TODO Stuff
  :PROPERTIES:...
  * A bulleted list
  * This is not interpreted as an org-mode item
  * Since it is indented
  * The indentation will be stripped
  * When syncing to trello
  * So we have a pretty markdown list


Regards,
Jason

Re: [emacs.org.trello] Arbitrary Markdown

From:
ardumont
Date:
2014-06-05 @ 10:55
Hello Jason,

Jason Miller writes:

> Hi,
>
> The version of org-trello in MELPA can't handle all possible markdown.
>

Indeed, this has not been developed yet.

There is an issue opened about it 
https://github.com/org-trello/org-trello/issues/89.

> If the problem I describe below has already been fixed, let me know and
> ignore the rest of the e-mail.

It's not developed.

> Otherwise let me know and I can submit
> the patch for the issue that I currently use.
>

Feel free to share, I'm all for it and thanks for it!

> In particular it fails fairly catastrophically with cards that contain
> top-level bulleted lists, since the markdown syntax for that would be:
>
> * Item 1
> * Item 2
> * Item 3
>
> If someone adds that to a card description, then you do a sync-from, it
> ends up in the org mode like that, which gets interpreted as more
> toplevel headings.  This means that the next "Sync to" will fail as the
> new toplevel headings get interpreted as new cards (and they likely
> don't have a valid todo keyword).
>
> I hacked up a solution yesterday that solves the problem by:
>
> 1) When syncing *to* trello, detect the indent level of the first
> line in the description; then strip thos columns from the rest of the
> description
>
> 2) When syncing *from* trello, indent the description in org mode by 2
> columns.
>
> This allows a comfortable editing of descriptions (you can use whatever
> indent you like) and also ensures that the description text stays the
> same on a round trip.
>
> Example:
>
> * TODO Stuff
>   :PROPERTIES:...
>   * A bulleted list
>   * This is not interpreted as an org-mode item
>   * Since it is indented
>   * The indentation will be stripped
>   * When syncing to trello
>   * So we have a pretty markdown list
>
>
> Regards,
> Jason

This seems pretty neat!

Can you please report this here 
https://github.com/org-trello/org-trello/issues/89?

That way, this will rekindle the discussion.

Cheers,
--
@ardumont