Skip to content

Archive completed tasks in your Obsidian vault (plus other org-mode-like features)

License

Notifications You must be signed in to change notification settings

wealthychef1/obsidian-task-archiver

 
 

Repository files navigation

This plugin is a toolbox for working with completed tasks in your markdown files. It brings some of org-mode's features to Obsidian. It provides features such as archiving, deleting and sorting tasks and document sections.

Commands

Archive tasks in this file

Here is what it looks like:

- [ ] This one I haven't done yet
- [x] Water the dog
    - Some task details
- [x] Feed the plants

Turns into:

- [ ] This one I haven't done yet

# Archived

- [x] Water the dog
    - Some task details
- [x] Feed the plants

Or, with date tree enabled:

- [ ] This one I haven't done yet

# Archived

- [[2021-09-W-38]]
    - [[2021-09-16]]
        - [x] Water the dog
            - Some task details
        - [x] Feed the plants
Delete tasks in this file

This one is the same as 'Archive tasks in this file', except that the tasks get discarded.

Archive heading under cursor

Grab the whole section under the heading under cursor, including all the child sections and move it to the archive.

This:

Some top-level text

# H1 heading

Some text

## H2 heading

More text

Turns into:

Some top-level text

# Archived

## H1 heading

Some text

### H2 heading

More text
Sort tasks in list under cursor

Grab the whole list under cursor and recursively reorder all the items based on completeness:

  1. Plain list items first
  2. Then, incomplete tasks
  3. And finally, completed tasks

This list:

- [x] Task
- Item
- [ ] Incomplete
    - [x] Task
    - Item More notes
    - [ ] Incomplete
- Item 2
- [ ] Incomplete 2
    - [x] Task
    - Item
    - [x] Task 2

Turns into:

- Item
- Item 2
- [ ] Incomplete
    - Item More notes
    - [ ] Incomplete
    - [x] Task
- [ ] Incomplete 2
    - Item
    - [x] Task
    - [x] Task 2
- [x] Task
Turn list items at this level into headings

Grab the list under cursor and turn every list item at and above the level of the item under cursor into a heading.

This:

- li 1
    - li 2 | <- cursor
        - li 3

Turns into:

# li 1

## li 2

- li 3
Archive tasks including nested tasks in this file

Same as simple archiving, except that now completed nested tasks also get archived, with their sub-items.

This:

- [ ] Incomplete task
    - [x] Completed subtask
        - Task details
    - [ ] Incomplete subtask

Turns into:

- [ ] Incomplete task
    - [ ] Incomplete subtask
  
# Archived

- [x] Completed subtask
    - Task details

Configuration

The plugin lets you configure the following:

  • what text makes a heading an archive;
  • whether to add newlines around headings when moving stuff around;
  • moving tasks to the current file or to a separate file.

Date tree

Each checked date tree option (weeks, days) will create an additional level in the archive hierarchy with a link to the corresponding periodic note.

Usage

Open the command palette and run one of the archiver commands.

Roadmap

  • Move completed tasks to a separate archive file
  • Delete completed tasks
  • Archive any document section
  • Archive sublists per list item
  • Per-file configuration through front-matter
  • More options for the date tree
    • Days
    • Months
    • Years
  • Multiple archive subheadings per file

Acknowledgements

This plugin is a simple & incomplete (for now) implementation of the archiving features of org-mode.

Also, I relied on the code from these excellent plugins:

About

Archive completed tasks in your Obsidian vault (plus other org-mode-like features)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 53.2%
  • JavaScript 46.8%