Code Monkey home page Code Monkey logo

todo.txt-note's Introduction

todo.txt-note

Description

Add-on to add note into todo.txt-cli tasks.

NOTE: Disclaimer: This tool is built to scratch my own itch: having details for a task. The tool was built in 2 hours in a hack-things-together manner so expect it to be (a little) buggy.

The todo.txt format does not specify anywhere to store more information related to a task.

This add-on introduces note concept in to the task by making use of Additional File Format Definition.

Concept

todo.txt-note add a key:value tag into your task, namely note:xxxx in which xxxx is a generated id to the file containing the whole description.

For example:

$ todo.sh ls
01 (A) Finish the whole @awesome-project on time. note:abcd938

NOTE: as of 0.1.0, the id is the first 8 characters of SHA-256 of random sequence of bits.

The description files are stored at $TODO_DIR/notes/*.txt

Known Limitations

  • When a task is marked as done by todo.sh do $x, the note file associating with $x is NOT deleted.

Roadmap

This TODO is using todo.txt format, of course.

(A) Delete orphan note files.
(B) Show the task's original content and id on the top when `show` +improvement.
(C) Allow to use an external editor when `add` the description as an +improvement.

Installation

You need python3 in your PATH.

Simply clone this repository into your $TODO_ACTION_DIR (defined in your ~/.todo.fg)

$ mkdir -p ~/.todo.actions.d/note
$ git clone https://github.com/Genzer/todo-note.git ~/.todo.actions.d/note
$ chmod u+x ~/.todo.actions.d/note/note

Usage

todo.txt-note supports 3 primary functions: add, show and edit (or use their aliases a, s and e respectively)

Add a Description to a Task

IMPORTANT: add a new note into a task which already has a note will effectively ovewrite the existing one. The content of the previous one, however, is kept intact.

# Simply a single text
$ todo.sh note add 1 -n "The project is defined to be TOP secret"

# Use heredoc
# Please note the second argument, the content of description, MUST be - so that the add-on knows to read from stdin
$ todo.sh note add 1 -n - <<__DOC__
# Description

The project is defined to be TOP secret
__DOC__

# Or a file.
# Please note the `-` is being used to tell `todo.txt-note` to read the content
# from the stdin.
$ cat some_prepared_text.md | todo.sh note add 1 -n -


# By omitting the note's content argument, `todo.txt-note` will use
# `TODO_NOTE_EDITOR` for inputing the content.
$ todo.sh note add 1
# vim is opened

Show the Note

$ todo.sh note show 1
The project is defined to be TOP secret

Edit the Note Using an External Editor

You can specify your preferred editor either through an environment variable EDITOR or TODO_NOTE_EDITOR.

NOTE: The default editor is vi. The order of lookup is to search for EDITOR then TODO_NOTE_EDITOR.

For example:

# Your ~/.todo.cfg

# Use Visual Studio Code
export TODO_NOTE_EDITOR=/usr/local/bin/code
$ todo.sh note edit 1
# Use Code to open the file ~/.todo/notes/abcd012.txt

Development

Please have a look at Creating Add-ons: Examples.

You need Python 3.6 or later. There is no external dependencies.

todo.txt-note's People

Contributors

genzer avatar

Watchers

 avatar

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.