Sort Markdown Task List

Just wondering. Don’t know that this is a fitting use for EDT. I am wondering about sorting MD tasks lists, something many MD editors struggle with. Given, for example..

- [ ] Task 1
  - [ ] 1.1
  - [ ] 1.3
  - [ ] 1.2
- [ ] Task 3
  - [ ] 3.2
  - [ ] 3.1
- [ ] Task 2
  - [ ] 2.2
  - [ ] 2.1

Is EDT able, and is it an appropriate tool to sort/move the subtasks and to sort/move the main tasks?

Thank you

I am not entirely sure what is your question. :slight_smile:

I have used EDT to create .md tables. It does a better job of creating markdown than many dedicated markdown editors! Plus, it enables easier manipulation of the table along the way.

Seems appropriate to me. Was that the query?

Thank you Monotone94. I am new to EDT. I can import the MD file as text. But I do not see which transforms to use to sort the tasks, both the tasks themselves keeping each subtask intact; and how to sort the subtasks. I would like to figure out most of this but I would appreciate some general direction to get started. Thank you again!

You can do it relatively easily:

  • input the .md as plain text
  • use regex to create a new sort key column
  • Sort on this new column
  • remove the new column
  • write back out as plain text

sort-md.transform (3.4 KB)

Thank you Andy! I will study that. But I was able to use the transform on a new file.

Is it possible somehow to do a manual sort? This would not normally be for something like that example. But if, using that example, I wanted the output (for Task 3) as follows..

  • Task 3
    • 3.2
    • 3.1

A more typical example might be as something like:

  • Task Group 1
    • Build This
    • Build That
    • Build One

Say you wanted the output to be

  • Task Group 1
    • Build One
    • Build This
    • Build That

So a manual sort, not alphabetical or numeric? Seems like a lot, but wanted to ask.

Thank you again.

No. Easy Data Transform does everything using transforms. If we allowed manual edits, they would be lost next time anything upstream was run.

If you want to manually sort a hierarchy of elements, you were probably better off with dedicated outliner software.

Yes, of course, makes perfect sense. Just wanted to check. Thank you again.