Home

Awesome

This plugin is a toolbox for working with completed tasks in your markdown files. It brings some of org-mode's features to Obsidian.

Contribution

If you noticed a bug or thought of some way to improve the plugin, feel free to create an issue: https://github.com/ivan-lednev/obsidian-task-archiver/issues.

Pull-requests are also welcome! If you want to contribute but don't know where to start, you can create an issue or write me an email: bishop1860@gmail.com.

You can also support me by buying me a coffee:

<a href="https://www.buymeacoffee.com/machineelf" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

Commands <a id="commands"></a>

<details> <summary>Archive tasks in this file</summary>

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
</details> <details> <summary>Archive tasks including nested tasks in this file</summary>

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
</details> <details> <summary>Delete tasks in this file</summary>

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

</details> <details> <summary>Archive heading under cursor</summary>

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
</details> <details> <summary>Sort tasks in list under cursor</summary>

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
</details> <details> <summary>Toggle task under cursor done and archive it</summary>

When the cursor is on a task, this command completes the task and archives it at once.

</details>

Settings

There are a lot of settings to help you build a suitable workflow.

Placeholders

You can use several placeholders throughout the settings to build cool workflows. Those get resolved to different values when you run the archiver:

Archive file path

You can send tasks to the same file or to a separate file, say, to a daily note, or to some path based on the name of the file you're in.

Replacing text before archiving

A regular expression for replacing the contents of the task during archiving; this is useful if you want to strip tags from archived tasks.

Append stuff before archiving

This might be useful if you want to see what you accomplished in a day:

Additional patterns to detect completed tasks

This way you can archive only those tasks that match a pattern and leave the rest of them alone. Say, you only want to archive tasks with a global filter used by the obsidian-tasks plugin (like the tag #task).

Heading & list hierarchies

You can create arbitrary hierarchies with placeholders both with headings and with list items. New archived tasks are going to be merged into existing trees.

You can use this feature to create a date tree in your archive:

Or you can create a single archive file with links to sources in headings:

Rules

Rules allow you to customize how you treat tasks that match certain conditions:

Potentially rules can specify any custom workflow for any set of tasks that match certain conditions. If you'd like to see some additional features here, feel free to create a feature request!

Usage

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

Acknowledgements

This plugin is an implementation of some features of org-mode for Emacs.

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

Contributors

Development