Skip to content

Commit

Permalink
Fixed processing repl command
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbata committed Mar 12, 2021
1 parent 40bc848 commit 1fe7e70
Show file tree
Hide file tree
Showing 10 changed files with 871 additions and 741 deletions.
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,21 @@ new [ ], done [x], started [>], blocked [!], priority *
gem install todo-jsonl
```

## Requirements

Ruby 2.5 or newer, or JRuby

## Demo

Web: [todo JavaScript REPL](http://gaborbata.github.io/todo/) using browser local storage
(created with [opal](https://github.com/opal/opal) and [vanilla-terminal](https://github.com/soyjavi/vanilla-terminal))
[todo JavaScript REPL](http://gaborbata.github.io/todo/) using browser local storage

Screencast:

![todo](todo.gif)
![todo](https://raw.githubusercontent.com/gaborbata/todo/master/todo.gif)

## Requirements
## Other versions

Ruby 2.5 or newer, or JRuby
* [todo for Node.js](https://github.com/gaborbata/todo/tree/master/node)
compiled with [Opal](https://github.com/opal/opal)
* [todo for web](http://gaborbata.github.io/todo/) using browser local storage,
created with [Opal](https://github.com/opal/opal) and [Vanilla Terminal](https://github.com/soyjavi/vanilla-terminal)
2 changes: 1 addition & 1 deletion bin/todo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def start_repl
execute(command == 'repl' ? [] : command.split(/\s+/))
end
print "\ntodo> "
command = STDIN.gets.chomp
command = STDIN.gets.chomp.strip
end
end

Expand Down
55 changes: 55 additions & 0 deletions node/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# todo for Node.js

todo list manager inspired by [todo.txt](http://todotxt.org) using the [jsonl](http://jsonlines.org) format

The Node.js version is compiled with [Opal](https://github.com/opal/opal) from the original [todo](https://github.com/gaborbata/todo) Ruby script,
with some JavaScript-specific modifications, optimized with [Closure Compiler](https://github.com/google/closure-compiler)

```
Usage: todo <command> <arguments>
Commands:
* add <text> add new task
* start <tasknumber> [text] mark task as started, with optional note
* done <tasknumber> [text] mark task as completed, with optional note
* block <tasknumber> [text] mark task as blocked, with optional note
* reset <tasknumber> [text] reset task to new state, with optional note
* prio <tasknumber> [text] toggle high priority flag, with optional note
* due <tasknumber> [date] set/unset due date (in YYYY-MM-DD format)
* append <tasknumber> <text> append text to task title
* rename <tasknumber> <text> rename task
* del <tasknumber> delete task
* note <tasknumber> <text> add note to task
* delnote <tasknumber> delete all notes from task
* list <regex> [regex...] list tasks (only active tasks by default)
* show <tasknumber> show all task details
* repl enter read-eval-print loop mode
* cleanup <regex> [regex...] cleanup completed tasks by regex
* help this help screen
With list command the following pre-defined regex patterns can be also used:
:active, :done, :blocked, :started, :new, :all, :today, :tomorrow, :next7days
Due dates can be also added via tags in task title: "due:YYYY-MM-DD"
Legend:
new [ ], done [x], started [>], blocked [!], priority *
```

`todo.jsonl` file stores the todo data which is saved into the `$HOME` folder of the current user.

## How to install

```
npm install -g todo-jsonl
```

## Demo

[todo JavaScript REPL](http://gaborbata.github.io/todo/) using browser local storage

Screencast:

![todo](https://raw.githubusercontent.com/gaborbata/todo/master/todo.gif)
34 changes: 30 additions & 4 deletions node/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,40 @@
{
"name": "todo-jsonl",
"version": "0.1.29",
"version": "0.1.30",
"description": "todo list manager inspired by todo.txt using the jsonl format",
"main": "todo.js",
"bin": {
"todo": "todo.js"
},
"scripts": {
"start": "node todo.js",
"build": "npm run compile && npm run optimize && mv todo.min.js todo.js",
"todo": "node todo.js",
"build": "npm run compile && npm run optimize && echo #!/usr/bin/env node > todo.js && cat todo.min.js >> todo.js && rm todo.min.js",
"compile": "opal --require date --require json --compile todo.js.rb | grep -v \"//# sourceMappingURL\" > todo.js",
"optimize": "java -jar closure-compiler.jar --isolation_mode IIFE --warning_level QUIET --js todo.js --js_output_file todo.min.js"
"optimize": "java -jar closure-compiler.jar --isolation_mode IIFE --warning_level QUIET --js todo.js --js_output_file todo.min.js",
"test": "echo \"no test specified\" && exit 0"
},
"engines": {
"node": ">=8.10.0"
},
"keywords": [
"cli",
"todo",
"command-line",
"manager",
"todolist",
"todotxt",
"todoapp",
"jsonlines",
"jsonl",
"ruby",
"opal"
],
"author": "Gabor Bata",
"license": "MIT",
"repository": "github:gaborbata/todo"
"homepage": "https://github.com/gaborbata/todo",
"repository": {
"type": "git",
"url": "https://github.com/gaborbata/todo.git"
}
}
Loading

0 comments on commit 1fe7e70

Please sign in to comment.