Skip to content

A small tool that creates or retrieves a markdown todo list for a given day, using a template

License

Notifications You must be signed in to change notification settings

PDWhittington/todo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

todo — an idiosyncratic todo list manager

Introduction

This project is a lightweight C# solution which manages todo lists written in Markdown.

Please feel free to DM me on Twitter, @PDWhittington, or to add issues on this repo for any features you would like to see.

Thanks,

Phil Whittington

How to build

Install git and ensure that it is in your PATH environment variable. To clone this repository, type the following at a command-line:

git clone https://github.com/PDWhittington/todo.git

The solution is curreently targetting .Net 6.0, so you will need this SDK installed, or a later one. To build the app, run something like the following. This will build the app so that it can run on all target operating systems. One dependency, gitlib2sharp, has OS-specific dependencies (i.e. the .Net assembly wraps a native library which varies from platform to platform). Building for all target operating systems will ensure that all the native libraries are produced. This means that the app can run on Windows, OSX or Linux.

cd todo
dotnet build src

If you are confident that you need the app to run on only one operating system, you can publish the app for just the runtime identifier that you need.

dotnet publish src --runtime win-x64 --configuration Release --no-self-contained
dotnet publish src --runtime osx-x64 --configuration Release --no-self-contained
dotnet publish src --runtime linux-x64 --configuration Release --no-self-contained

Usage

Once you have the app, add its published location to your PATH environment variable.

The following commands can be invoked from the command line:-

Command Description
(No text)
createorshow
Creates or shows a markdown file for the date supplied. This is the default command and can be executed by typing anything that can be parsed as a date. Supplying no date assumes the current day.

Usage: todo [date]
a
archive
Archives the markdown file for a given date. The file is moved into the archive subfolder of the main todo folder. The name of the archive folder is specified in settings.json. Also in settings.json can be specified whether the file is moved simply in the file system, or by using git mv.

Usage: todo a [date]
c
commit
Gathers the current modifications into a commit. Commit message is optional.

Usage: todo c [commit message]
h
html
showhtml
Opens the browser specified in the settings file and loads the Html file for the given date.

Usage: todo h [date]
help
about
Displays this help screen.

Usage: todo help
i
init
Initialises the current folder with a default todo-settings.json file. If the todo and archive folders whose paths are specified in the settings file do not exist, then these folders are created.

Usage: todo init
k
killhtml
Deletes all the html files in the todo folder and the archive subfolder

Usage: todo k
l
list
Provides a list of all todo lists. Switches are as follows:-

  • m -- main todo folder.
  • a -- archive folder.
  • d -- lists relating to days.
  • t -- lists relating to topics.

Usage: todo l [m | a] [d | t]
p
print
printhtml
Converts a Markdown file to HTML. Can be used with anything that can be parsed as a date. Supplying no date performs this operation on the Markdown file for the current day.

Usage: todo p [date]
ph
printandshowhtml
This command is equivalent to printhtml followed by showhtml (p, h).

Usage: todo ph [date]
push Executes a git push.

Usage: todo push
rm
remove
delete
Deletes the file. If git is enabled, the command performs a remove in git.

Usage: todo rm [date]
s
sync
Executes a commit and push operation sequentially.

Usage: todo s [commit message]
sc
showconflicts
Opens in the text editor all of the files for which conflicts exist.

Usage: todo sc
settings
showsettings
Shows the settings file in the default editor.

Usage: todo settings
t
topic
Creates or shows a todo list relating to a single topic.

Usage: todo t (topic name)
u
unarchive
Un-archives the markdown file for a given date. The file is moved form the subfolder back to the main todo folder. The name of the archive folder is specified in settings.json. Also in settings.json can be specified whether the file is moved simply in the file system, or by using git mv.

Usage: todo u [date]
w
web
www
Opens the project page in the default browser.

Usage: todo w
which
Reveals the location of the todo executable. Running this command is equivalent to invoking 'which todo' in bash, but can be run on any platform. In fact, a 'boiler plate' of information is produced.

Usage: todo which

Notes:

createorshow is the default command. This means it can be accessed simply by typing anything that can be parsed as a date after the word todo.

Valid date formats:-

  • "y", "yesterday" → yesterday
  • [empty string], ".", "today" → today
  • "tm", "tomorrow" → tomorrow
  • (day) → the day/month/year which is nearest in time to today
  • (day)/(month) → the day/month which is nearest in time to today
  • +(daycount) → positive offset a number of days from today
  • -(daycount) → negative offset a number of days from today

[Commit Message] → In the Commit and Sync commands, the commit message is optional. If none is supplied, then a standard message detailing the date and time of the commit will be used.

About

A small tool that creates or retrieves a markdown todo list for a given day, using a template

Resources

License

Stars

Watchers

Forks

Packages

No packages published