GithubHelp home page GithubHelp logo

mvgrimes / obsidian-todotxt-plugin Goto Github PK

View Code? Open in Web Editor NEW
45.0 3.0 4.0 1.5 MB

Obsidian plugin to manage todotxt files

License: MIT License

JavaScript 37.18% TypeScript 55.70% CSS 7.12%
obsidian-plugin todotxt todotxt-cli

obsidian-todotxt-plugin's Introduction

Obsidian TodoTxt Plugin

Manage *.todotxt files in Obsidian.

Sample TodoTxt file in Obsidian

Install the plugin and put your todo file in your Obsidian vault with the .todotxt extension (ie, TODO.todotxt).

Creating a .todotxt file from within Obsidian can be a bit tricky. When you create a new note Obsidian will automatically append the .md extension, so TODO.todotxt becomes TODO.todotxt.md. To fix this, you can right-click on the file in Obsidian sidebar, select Reveal in Finder/File Explorer, and then change the file extension to .todotxt. If you are successful, the file will be listed in the Obsidian sidebar followed by a TODOTXT badge.

Additional Features

The TodoTxt Plugin supports some extensions to the basic todo.txt spec:

Due Dates

Due dates can be specified by including due:yyyy-mm-dd in the text of the task item. The plugin will highlight the due date and shift to orange as the date nears then red when the due date is missed. The date must be specified in the yyyy-mm-dd format (including padding the month or day with a 0 if needed) and no whitespace may be included.

Preserving Priorities on Complete

EXPERIMENATL: This feature is experimental and needs to be enabled in the settings.

As described in the todo.txt spec, priorities are typically discarded when a task is marked as complete. This extension to the spec will preserve the priority in a pri:X tag. It will also restore the priority if the task is later marked as uncompleted.

Recurring Tasks

EXPERIMENATL: This feature is experimental and needs to be enabled in the settings. This is not part of the todo.txt spec.

Recurring tasks can be specified by including the rec: tag. When such a task is marked as complete a new task will created with a due: tag based on the value in the rec: tag.

See further documentation of recurring tasks.

Threshhold Dates

Threshold dates are indicated by the t:YYYY-MM-DD tag. Tasks with a specified threshold are not considered ready to be undertaken until the threshold date. The Todotxt Plugin will display tasks with threshold dates in the future with a subtlely muted text.

How to Install by Hand

  1. Clone this repo.
  2. yarn install to install dependencies
  3. yarn run dev to start compilation in watch mode.

Manually Installing the Plugin

Copy main.js, styles.css, manifest.json to your vault VaultFolder/.obsidian/plugins/todotxt-plugin/.

cp dist/* VaultFolder/.obsidian/plugins/todotxt-plugin/

Keyboard Shortcuts

Use tab and shift-tab to navigate through your todos.

  • ctrl-n to create a New todo task
  • ctrl-/ goto filter input
  • e or enter to Edit the current todo task
  • d to Delete the current todo task
  • space toggle done

Future Development

  • Delete a Todo
  • Edit a Todo
  • Keyboard shortcut to create new Todo
  • Keyboard navigation through TODOs
  • Priority colors are a bit bright
  • Better handling for Todo.parse() errors
  • Global keyboard shortcut to create new Todo
  • Command palette command to create new Todo
  • Config menu set the default .todotxt file
  • Command palette to create a new .todotxt file

Development

Helpful commands to run while developing:

yarn run dev # compile typescript to ./dist via esbuild
yarn run css # compile css to ./dist via postcss
yarn run cp # copy files from ./dist to Obsidian plugins dir
yarn run parser:watch # compile .peggy grammar to parser.js
yarn run test:watch # run tests in watch mode

We are using the moment package because Obsidian already requires it. Otherwise would use something lighter weight (like date-fns) or built-in.

Thanks

  • Thanks to the authors of todotxt.
  • Thanks to the authors of SwiftoDo for documenting the due and recurring extensions to the spec.

Support

I've been asked if there are ways to support this plugin. I created it to scratch my own itch and am just happy that others find it useful. Giving it a star on github would be appreciated. If you are feeling extra generous, you can buy me a coffee ☕.

Buy Me A Coffee

obsidian-todotxt-plugin's People

Contributors

mvgrimes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

obsidian-todotxt-plugin's Issues

QoL improvements`

Hi @mvgrimes ,

Thanks for much for your work on this plugin. It's great for my use case.

I have a couple of QoL suggestions which would improve the quality of the plugin for me; though, of course, it may not suit your needs as well.

  1. When clicking to edit a task using the plugin, it interprets this also as "completing" the task and opens up the edit dialog. My expected behaviour would be that is doesn't complete the task too, but only opens up the edit dialog.
  2. When clicking a link in a task on the plugin page, it also completes the task. When I click a link, the expected behaviour is to just open the link and not complete the task.
  3. When resizing the window or tab that holds the open .todotxt file the plugin always stays at three columns, the number of columns should vary in response to the size of the window - there must be CSS already written that completes this for you.
  4. Give the option to also not separate out tasks by project/context, so it's just one list.

Thanks again, and let me know your thoughts. In summer I may have time to have a go at these myself, though I've never used typescript before.

Alex

Set a default Context

Creating a second issue per request, as the first feature mentioned was completed.

The ability to set a default Context would be nice, by that I mean adding to the todo task that did not have a context defined the to a predefined “default” context.

Example: All task by default are added to work unless context is defined by user input. There is no context called default unless created by the user.

I can’t overstate how much I enjoy using this plugin. Thank you again.

A new "by-context" visualization to switch to when needed

I'd like to have the ability to switch the default view to a view that shows my tasks grouped by context and with the project name as a task detail'.

In this way, I could use the context to specify which is the GTD list the task belong (next actions, waiting for etc...) and toggle the visualization of my system between the default by-project view and the by-context view.

Thanks for you time and for this great plugin.

'not parsed: ' Error in .todotxt files modified with external editor.

Problem Statement

When .todotxt file is saved using another TodoTxt-aware editor and then opened in Obsidian (with the Obsidian-TodoTxt-Plugin) the items are shown all in the +Default group pre-pended with the text not parsed: .

Environment

  • Windows 11
  • Obsidian for Windows

Research

I was able to edit the individual lines in Obsidian removing the text not parsed: and the items returned to the normal behavior, with the context and project data intact.

Opening the .todotxt file in a plain-text editor revealed that the plugin-saved file had the UNIX EOL characters (/n), while the file saved by the external editor had Windows EOL characters (/r/n).

Globally switching back to the UNIX format seemed to 'fix' the entire file all at once.

Proposed Solution

  • Allow JavaScript/TypeScript to interact with text files using the Windows EOL characters (if possible).
  • On reload/refresh of modified .todotxt file, automatically strip out the Carriage Return (/r) character, returning the file to the UNIX-compliant format.

Add auto-delete for completed tasks after a given time

Hi,

Another idea for a possible improvement of your great plug-in : adding auto-delete for completed tasks after a given time (1 week for instance) so that the todo lists can keep tidy and not get cluttered without having to manually delete each task, which can be cumbersome.

Thanks again for your great work !

colors hardcoded?

Hello,

thanks for investing time into writing this plugin!
I just installed it and realised that you might have hardcoded the bg-colors of the widgets ("new ToDo" etc.). Since I need to use light mode, text renders almost invisible... (see attached screenshot)

Screenshot 2023-08-14 at 19 46 44

FR: Render links

Hi

It would be very nice if this plugin actually renders regular markdown links. I know these are .txt but it can maybe render links as a link so that they do not look uggly in the todos.

For instance this would be rendered as "link" [link](https://github.com/mvgrimes/obsidian-todotxt-plugin)

Allow display of projects / contexts inline

I often write tasks with projects and contexts 'inline' as verbs and nouns:

(B) 2023-10-17 Tell @wife that I need to fix my +bike this afternoon

It would be nice if these showed up inline.

Having them show up inline and called out would be fine too.

Priority D and Default Context

First off I wanted to take the time to thank you for working on this project.

TodoTxt is amazing.

I would like the ability to be able to use priority D and have the bold icon show on the left hand side of the task for it.

Just and idea.. but

The ability to set a default Context would be nice, by that I mean adding to the todo task that did no have a context defined the "default" Context name. Example: All task by default are added to work unless context is defined by user input. There is no context called default unless created by the user.

thank you again for your wonderful work, if not another change was pushed to this project I would still use this every day.

Completed Tasks

Reading the documentation on the todo.txt I'm seeing it has the ability to move completed tasks to a file called done.txt
Currently I'm manually copying relevant completed tasks to a note in obsidian to reference later for my weekly productivity reports to my supervisor. An option to move completed tasks to another file, note, or even context would be very useful as well.

I'm very sorry for all of the feature request. I'm just throwing things out there for you.
Please don't think I don't appreciate the work you have done.
This is my favorite obsidian plugin and I will use it regardless of the status of these feature request.

If I had the ability to help with this project I would be more than willing..
Currently, this is a bit too far out of my scope..

it opens all txt files

Hi

It looks like I need to put "txt" as an extension to open the todo.txt file as todotxt which is fine, but then this plugin opens "all" .txt files and renders them as todotxt. If I delete the .txt extension from settings then the plugin is not activated when I click on it.

Is there a way to let this plugin to recognize todo.txt inherently like it does with todo.todotxt (which is less standard)?

[Feature Request] Custom File Extension

I want to use this Obsidian plugin to manage my existing todo.txt files. Some of them can not be renamed to .todotxt extension. I think it is better to provide an option to custom file extension, or just choose some specific files, to be managed by this plugin.

Not Working on iPhone or ipad

The plugin is working great on my desktop.

It just doesn’t work on iPhone and ipad. On both the plugin refuses to “enable” and gives the error message “Failed to load plugin todotxt”.

I’ve uninstalled and reinstalled - but it gives the same error. (I’ve not done a manual install, though.)

Not working

Install the plugin and put your todo file in your Obsidian vault with the .todotxt extension (ie, TODO.todotxt).

Screenshot_2023-11-13-15-37-54-621_md obsidian
Screenshot_2023-11-13-15-37-36-466_md obsidian

export/import obsidian tasks format

what would be great is to be able to read a todo.txt file and create an obsidian tasks formatted note and to export the items from an obsidian formatted tasks to a todo.txt file. being able to use an obsidian query to select items to export would be terrific.

Change default action when clicking the name of a task

Hi,

By default, clicking the name of a task marks it as complete, but I personally find it a bit misleading and confusing. What about changing the default behavior from marking as complete to just editing it ?

That way, if we want to mark a task as complete we can still click the checkbox but we can also edit the task by clicking on its name.

Thanks again !

allow parser to pick up scheduled and start date from obsidian tasks format

obsidian tasks uses a character to specify the scheduled date and the start date (t in todotxt). If you can pick these up in parsing and use them in the todotxt display it will make transitioning /interoperability with the obsidian todo plugin much easier. since many other plugins (time ruler is one example) pick up this format, it allows alternate displays uses of the todotxt file.

[QUESTION] how to open todotxt?

(sorry for asking a question as an Issue but I did not see any Discussions available)

I installed the plugin as described but I must be missing something: how to actually start the plugin? 😶

Due date support

It would be great if this plugin supported the "due:" syntax, to specify a due date, showing in red the tasks that are passed without being completed.

Problems with tasks, projects and contexts in a language other than English

Hello!

  1. The extension is not able to recognize contexts and projects in languages other than English. From my old todo.txt list, only those that were in English were recognized. The file encoding is UTF8. Please fix this problem in the next version.
    Because now the text of tasks with contexts and projects created in another language is visible, but it is all in the "Default" column.

  2. When trying to mark a task in another language by single click on its text, the overview jumps from line to line and sometimes the task is duplicated in the output in Obsidian, but not in the file itself.
    At the same time, if you edit a task by clicking on the pencil button, it will save and display perfectly. Marking a task completed via a checkbox also works fine.

Thank you in advance!

Support some of the common keys

many todo.txt implementations add keys and two common ones are:

r:value - r means recurring. the value is an integer followed by one of d,w,m,y for days, weeks, months, years. the increment is added to the done date. so r:2d means create a new item with a due date of 2 weeks from when done. some implementations use a + before the value to mean "strict" which says use the original due date if the done date is past then original due date.

t:value - t means start and value is YYY-MM-DD. this gets incremented in new items created by recurring tasks.

Add +project auto-completion

Hi,

Would it be possible to implement an auto-complete for project tags when one starts typing the first letters ? It would be very convenient for long project tags so that we don't have to write them entirely.

Thanks again for your great work !

Plugin does not work on MacOS 14.4.1 (23E224)

Hi,

I would like to use this plugin. Though, I can't get it work on my system.

Description of my system and steps taken:

  • System: MacBook Air 2023 with Apple M2 Chip, Version: 14.4.1 (23E224)
  • Obsidian Version: V1.5.12
  • Todotxt Version: 2.0.2
  • Plugin installed via Obsidian Extensions User Interface
  • I activated the plugin inside Obsidian
  • I opened my Obsidian vault inside Finder (MacOS file browser).
  • Inside the file browser I created a file "todos.todotxt"
  • I restarted Obsidian and opened the file.
  • The file opens as a normal obsidian note, though I cannot use any features of the plugin, nor I can see any user interface of the plugin.

Thanks for your help.

Kind regards,
David

Priority tag on completed tasks breaks filtering, rendering

This may be intentional, but I've noticed that the priority of a ToDo item is saved as a tag pri: and removes it from how I had originally set it (ex: (A)), which seems to cause issues with modifying the item after it has been completed. For example, if I complete an item but then want to change the context or project, the tag shows up and then when saved, it does not render with the little priority bubble. When modifying a ToDo item that has not been completed, this does not seem to be an issue at all.

This also occurs when using todo.sh archive later:
image

This causes the priority filter to not work as expected and I need to set it to All to see the tasks that were completed. Maybe that's okay, it just struck me as odd

Filtering and Searching todo list

Is there a way to filter and search other than the priority dropdown? I tried using Obsidian's search with file:todo.todotxt but it doesn't pick anything up. Sorry if obvious ... new to Obsidian and just learning ... Thanks!

Context/project tags are relocated to the end of each line

Hello! I love this plugin, and thanks very much for developing it.

I was a bit dismayed to discover that projects and contexts are being relocated to the end of tasks. Or in other words, they aren't "allowed" to reside as part of the main text.

For example, these tasks:

(A) Call @Mom tomorrow
(C) +Learn Python

become:

(A) Call tomorrow @Mom
(C) Python +Learn

I tend to write a lot of my tasks this way, and I believe this is supported by the todo.txt spec. Would you consider a revision to allow this flexibility, so that projects/contexts are not reordered?

Thanks very much!

Failed to install plugin - Mac M1

Hi and thanks for your great work !

I'm trying to install the plugin from the community plugin list in Obsidian 1.5.12 running on a Mac M1 with Mac OS Sonoma but I get an error message saying "Failed to install plugin "TodoTxt".

Any idea what can be the issue here ?

Thanks

Long tasks are not moved to a new line, but to a neighboring column

Thanks for the update to 1.3.2. The two problems I described earlier have been successfully resolved.

But a new one has popped up - for some reason some data is not moved to a new line, and overlaps the contents of other lines.
I noticed that this happens more often in tasks that have a long description and many specified projects and contexts. Long task descriptions without projects and contexts are normally moved to several lines.

The screenshots are attached:

flameshot__2023 08 31__21-46-16
flameshot__2023 08 31__21-46-59
flameshot__2023 08 31__21-48-00
flameshot__2023 08 31__22-01-36

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.