na 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/Gemfile.lock +2 -1
  4. data/README.md +82 -27
  5. data/bin/na +24 -5
  6. data/lib/na/version.rb +1 -1
  7. data/lib/na.rb +1 -0
  8. data/na.gemspec +9 -3
  9. data/na.rdoc +6 -2
  10. data/scripts/fixreadme.rb +18 -0
  11. data/src/README.md +276 -0
  12. metadata +32 -56
  13. data/html/App.html +0 -105
  14. data/html/NA/Action.html +0 -299
  15. data/html/NA/Color.html +0 -373
  16. data/html/NA.html +0 -100
  17. data/html/README_rdoc.html +0 -328
  18. data/html/String.html +0 -368
  19. data/html/created.rid +0 -9
  20. data/html/css/fonts.css +0 -167
  21. data/html/css/rdoc.css +0 -639
  22. data/html/fonts/Lato-Light.ttf +0 -0
  23. data/html/fonts/Lato-LightItalic.ttf +0 -0
  24. data/html/fonts/Lato-Regular.ttf +0 -0
  25. data/html/fonts/Lato-RegularItalic.ttf +0 -0
  26. data/html/fonts/SourceCodePro-Bold.ttf +0 -0
  27. data/html/fonts/SourceCodePro-Regular.ttf +0 -0
  28. data/html/images/add.png +0 -0
  29. data/html/images/arrow_up.png +0 -0
  30. data/html/images/brick.png +0 -0
  31. data/html/images/brick_link.png +0 -0
  32. data/html/images/bug.png +0 -0
  33. data/html/images/bullet_black.png +0 -0
  34. data/html/images/bullet_toggle_minus.png +0 -0
  35. data/html/images/bullet_toggle_plus.png +0 -0
  36. data/html/images/date.png +0 -0
  37. data/html/images/delete.png +0 -0
  38. data/html/images/find.png +0 -0
  39. data/html/images/loadingAnimation.gif +0 -0
  40. data/html/images/macFFBgHack.png +0 -0
  41. data/html/images/package.png +0 -0
  42. data/html/images/page_green.png +0 -0
  43. data/html/images/page_white_text.png +0 -0
  44. data/html/images/page_white_width.png +0 -0
  45. data/html/images/plugin.png +0 -0
  46. data/html/images/ruby.png +0 -0
  47. data/html/images/tag_blue.png +0 -0
  48. data/html/images/tag_green.png +0 -0
  49. data/html/images/transparent.png +0 -0
  50. data/html/images/wrench.png +0 -0
  51. data/html/images/wrench_orange.png +0 -0
  52. data/html/images/zoom.png +0 -0
  53. data/html/index.html +0 -297
  54. data/html/js/darkfish.js +0 -84
  55. data/html/js/navigation.js +0 -105
  56. data/html/js/navigation.js.gz +0 -0
  57. data/html/js/search.js +0 -110
  58. data/html/js/search_index.js +0 -1
  59. data/html/js/search_index.js.gz +0 -0
  60. data/html/js/searcher.js +0 -229
  61. data/html/js/searcher.js.gz +0 -0
  62. data/html/table_of_contents.html +0 -252
data/src/README.md ADDED
@@ -0,0 +1,276 @@
1
+ <!--README--><!--GITHUB--># na
2
+
3
+ [![Gem](https://img.shields.io/gem/v/na.svg)](https://rubygems.org/gems/na)
4
+ [![Travis](https://app.travis-ci.com/ttscoff/na_gem.svg?branch=main)](https://travis-ci.org/makenew/na_gem)
5
+ [![GitHub license](https://img.shields.io/github/license/ttscoff/na_gem.svg)](./LICENSE.txt)<!--END GITHUB-->
6
+
7
+ **A command line tool for adding and listing per-project todos.**
8
+
9
+ _If you're one of the rare people like me who find this useful, feel free to
10
+ [buy me some coffee][donate]._
11
+
12
+ The current version of `na` is <!--VER-->1.0.2<!--END VER-->.
13
+
14
+ `na` ("next action") is a command line tool designed to make it easy to see what your next actions are for any project, right from the command line. It works with TaskPaper-formatted files (but any plain text format will do), looking for `@na` tags (or whatever you specify) in todo files in your current folder.
15
+
16
+ Used with Taskpaper files, it can add new todo items quickly from the command line, automatically tagging them as next actions.
17
+
18
+ It can also auto-display next actions when you enter a project directory, automatically locating any todo files and listing their next actions when you `cd` to the project (optionally recursive). See the [Prompt Hooks](#prompt-hooks) section for details.
19
+
20
+ ### Features
21
+
22
+ You can list next actions in files in the current directory by typing `na`. By default, `na` looks for `*.taskpaper` files and extracts items tagged `@na` and not `@done`. All of these can be changed in the configuration.
23
+
24
+ #### Easy matching
25
+
26
+ `na` features intelligent project matching. Every time it locates a todo file, it adds the project to the database. Once a project is recorded, you can list its actions by using any portion of the parent directories or file names. If your project is in `~/Sites/dev/markedapp`, you could quickly list its next actions by typing `na dev mark`. It will always look for the shortest match.
27
+
28
+ #### Recursion
29
+
30
+ `na` can also recurse subdirectories to find all todo files in child folders as well. Use the `-d X` to search X levels deep from the current directory. `na -r` with no arguments will recurse from your current location, looking for todo files 3 directories deep.
31
+
32
+ #### Adding todos
33
+
34
+ You can also quickly add todo items from the command line with the `add` subcommand. The script will look for a file in the current directory with a `.taskpaper` extension (configurable).
35
+
36
+ If found, it will try to locate an `Inbox:` project, or create one if it doesn't exist. Any arguments after `add` will be combined to create a new task in TaskPaper format. They will automatically be assigned as next actions (tagged `@na`) and will show up when `na` lists the tasks for the project.
37
+
38
+ ### Installation
39
+
40
+ Assuming you have Ruby and RubyGems installed, you can just run `gem install na`. If you run into errors, use `sudo gem install na`.
41
+
42
+ If you don't have Ruby/RubyGems, you can install them pretty easily with Homebrew, rvm, or asdf. I can't swear this tool is worth the time, but there _are_ a lot of great gems available...
43
+
44
+ <!--JEKYLL> You can find the na source code (MIT license) on [GitHub][].-->
45
+
46
+ ### Usage
47
+
48
+ ```
49
+ NAME
50
+ na - Add and list next actions for the current project
51
+
52
+
53
+ SYNOPSIS
54
+ na [global options] command [command options] [arguments...]
55
+
56
+
57
+ VERSION
58
+ 1.0.2
59
+
60
+
61
+
62
+ GLOBAL OPTIONS
63
+ -a, --[no-]add - Add a next action (deprecated, for backwards compatibility)
64
+ -d, --depth=DEPTH - Recurse to depth (default: 1)
65
+ --ext=FILE_EXTENSION - File extension to consider a todo file (default: taskpaper)
66
+ --help - Show this message
67
+ -n, --[no-]note - Prompt for additional notes (deprecated, for backwards compatibility)
68
+ --na_tag=TAG - Tag to consider a next action (default: na)
69
+ -p, --priority=PRIORITY - Set a priority 0-5 (deprecated, for backwards compatibility) (default: none)
70
+ -r, --[no-]recurse - Recurse 3 directories deep (deprecated, for backwards compatability)
71
+ --version - Display the program version
72
+
73
+
74
+
75
+ COMMANDS
76
+ add - Add a new next action
77
+ find - Find actions matching a search pattern
78
+ help - Shows a list of commands or help for one command
79
+ initconfig - Initialize the config file using current global options
80
+ next, show - Show next actions
81
+ tagged - Find actions matching a tag
82
+ ```
83
+
84
+ #### Commands
85
+
86
+ ##### add
87
+
88
+ Example: `na add This feature @idea I have`
89
+
90
+ ```
91
+ NAME
92
+ add - Add a new next action
93
+
94
+ SYNOPSIS
95
+
96
+ na [global options] add [command options] TASK
97
+
98
+ DESCRIPTION
99
+ Provides an easy way to store todos while you work. Add quick reminders and (if you set up Prompt Hooks) they'll automatically display next time you enter the directory. If multiple todo files are found in the current directory, a menu will allow you to pick to which file the action gets added.
100
+
101
+ COMMAND OPTIONS
102
+ -f, --file=PATH - Specify the file to which the task should be added (default: none)
103
+ -n, --[no-]note - Prompt for additional notes
104
+ -p, --priority=arg - Add a priority level 1-5 (default: 0)
105
+ -t, --tag=TAG - Use a tag other than the default next action tag (default: none)
106
+
107
+ EXAMPLES
108
+
109
+ # Add a new action to the Inbox, including a tag
110
+ na add "A cool feature I thought of @idea"
111
+
112
+ # Add a new action to the Inbox, set its @priority to 4, and prompt for an additional note
113
+ na add "A bug I need to fix" -p 4 -n
114
+ ```
115
+
116
+ ##### find
117
+
118
+ Example: `na find cool feature idea`
119
+
120
+ ```
121
+ NAME
122
+ find - Find actions matching a search pattern
123
+
124
+ SYNOPSIS
125
+
126
+ na [global options] find [command options] PATTERN
127
+
128
+ DESCRIPTION
129
+ Search tokens are separated by spaces. Actions matching any token in the pattern will be shown (partial matches allowed). Add a + before a token to make it required, e.g. `na find +feature +maybe`
130
+
131
+ COMMAND OPTIONS
132
+ -d, --depth=DEPTH - Recurse to depth (default: 1)
133
+ -x, --[no-]exact - Match pattern exactly
134
+
135
+ EXAMPLES
136
+
137
+ # Find all actions containing feature, idea, and swift
138
+ na find feature +idea +swift
139
+
140
+ # Find all actions containing the exact text "feature idea"
141
+ na find -x feature idea
142
+
143
+ # Find all actions 3 directories deep containing either swift or obj-c
144
+ na find -d 3 swift obj-c
145
+ ```
146
+
147
+ ##### next, show
148
+
149
+ Examples:
150
+
151
+ - `na show` (list all next actions in the current directory)
152
+ - `na show -d 3` (list all next actions in the current directory and look for additional files 3 levels deep from there)
153
+ - `na show marked2` (show next actions from another directory you've previously used na on)
154
+
155
+ ```
156
+ NAME
157
+ next - Show next actions
158
+
159
+ SYNOPSIS
160
+
161
+ na [global options] next [command options] OPTIONAL_QUERY
162
+
163
+ COMMAND OPTIONS
164
+ -d, --depth=DEPTH - Recurse to depth (default: none)
165
+ -t, --tag=arg - Alternate tag to search for (default: na)
166
+
167
+ EXAMPLES
168
+
169
+ # display the next actions from any todo files in the current directory
170
+ doing next
171
+
172
+ # display the next actions from the current directory and its children, 3 levels deep
173
+ doing next -d 3
174
+ ```
175
+
176
+ ##### tagged
177
+
178
+ Example: `na tagged feature +maybe`
179
+
180
+ ```
181
+ NAME
182
+ tagged - Find actions matching a tag
183
+
184
+ SYNOPSIS
185
+
186
+ na [global options] tagged [command options] TAG [VALUE]
187
+
188
+ DESCRIPTION
189
+ Finds actions with tags matching the arguments. An action is shown if it contains any of the tags listed. Add a + before a tag to make it required, e.g. `na tagged feature +maybe`
190
+
191
+ COMMAND OPTIONS
192
+ -d, --depth=DEPTH - Recurse to depth (default: 1)
193
+
194
+ EXAMPLES
195
+
196
+ # Show all actions tagged @maybe
197
+ na tagged +maybe
198
+
199
+ # Show all actions tagged either @feature or @idea, recurse 3 levels
200
+ na tagged -d 3 feature idea
201
+ ```
202
+
203
+ ### Configuration
204
+
205
+ Global options such as todo extension and default next action tag can be stored permanently by using the `na initconfig` command. Run na with the global options you'd like to set, and add `initconfig` at the end of the command. A file will be written to `~/.na.rc`. You can edit this manually, or just update it using the `initconfig --force` command to overwrite it with new settings.
206
+
207
+ Example: `na --ext md --na_tag next initconfig --force`
208
+
209
+ When this command is run, it doesn't include options for subcommands, but inserts placeholders for them. If you want to permanently set an option for a subcommand, you'll need to edit `~/.na.rc`. For example, if you wanted the `next` command to always recurse 2 levels deep, you could edit it to look like this:
210
+
211
+ ```yaml
212
+ ---
213
+ :ext: taskpaper
214
+ :na_tag: na
215
+ :d: 1
216
+ commands:
217
+ :next:
218
+ :depth: 2
219
+ :add: {}
220
+ :find: {}
221
+ :tagged: {}
222
+ ```
223
+
224
+ Note that I created a new YAML dictionary inside of the `:next:` command, and added a `:depth:` key that matches the setting I want to make permanent.
225
+
226
+ > **WARNING** Don't touch most of the settings at the top of the auto-generated file. Setting any of them to true will alter the way na interprets the commands you're running. Most of those options are there for backwards compatibility with the bash version of this tool and will eventually be removed.
227
+ <!--JEKYLL{:.warn}-->
228
+
229
+ ### Prompt Hooks
230
+
231
+ You can add a prompt command to your shell to have na automatically list your next actions when you `cd` into a directory. Add the appropriate command to your login file for your shell:
232
+
233
+ _(You can add `-r` to any of these calls to na to automatically recurse 3 directories deep)_
234
+
235
+ Bash (in ~/.bash_profile):
236
+
237
+ ```bash
238
+ last_command_was_cd() {
239
+ [[ $(history 1|sed -e "s/^[ ]*[0-9]*[ ]*//") =~ ^((cd|z|j|jump|g|f|pushd|popd|exit)([ ]|$)) ]] && na
240
+ }
241
+ if [[ -z "$PROMPT_COMMAND" ]]; then
242
+ PROMPT_COMMAND="eval 'last_command_was_cd'"
243
+ else
244
+ echo $PROMPT_COMMAND | grep -v -q "last_command_was_cd" && PROMPT_COMMAND="$PROMPT_COMMAND;"'eval "last_command_was_cd"'
245
+ fi
246
+ ```
247
+
248
+ Fish (in ~/.config/fish/conf.d/*.fish):
249
+
250
+ ```fish
251
+ function __should_na --on-variable PWD
252
+ # function __should_na --on-event fish_prompt
253
+ test -s (basename $PWD)".taskpaper" && na
254
+ end
255
+ ```
256
+
257
+ Zsh (in ~/.zshrc):
258
+
259
+ ```zsh
260
+ chpwd() { na }
261
+ ```
262
+
263
+
264
+ ### Misc
265
+
266
+ If you have [gum][] installed, na will use it for command line input when adding tasks and notes.
267
+
268
+ [gum]: https://github.com/charmbracelet/gum
269
+ [donate]: http://brettterpstra.com/donate/
270
+ [github]: https://github.com/ttscoff/na_gem/
271
+
272
+ <!--GITHUB-->PayPal link: [paypal.me/ttscoff](https://paypal.me/ttscoff)<!--END GITHUB-->
273
+ <!--END README-->
274
+ ## Changelog
275
+
276
+ See [CHANGELOG.md](https://github.com/ttscoff/na_gem/blob/master/CHANGELOG.md)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: na
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
@@ -106,6 +106,26 @@ dependencies:
106
106
  - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: 0.9.0
109
+ - !ruby/object:Gem::Dependency
110
+ name: tty-screen
111
+ requirement: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '0.8'
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: 0.8.1
119
+ type: :runtime
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '0.8'
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: 0.8.1
109
129
  - !ruby/object:Gem::Dependency
110
130
  name: tty-which
111
131
  requirement: !ruby/object:Gem::Requirement
@@ -126,13 +146,16 @@ dependencies:
126
146
  - - ">="
127
147
  - !ruby/object:Gem::Version
128
148
  version: 0.5.0
129
- description:
149
+ description: A tool for managing a TaskPaper file of project todos for the current
150
+ directory. Easily create "next actions" to come back to, add tags and priorities,
151
+ and notes. Add prompt hooks to display your next actions automatically when cd'ing
152
+ into a directory.
130
153
  email: me@brettterpstra.com
131
154
  executables:
132
155
  - na
133
156
  extensions: []
134
157
  extra_rdoc_files:
135
- - README.rdoc
158
+ - README.md
136
159
  - na.rdoc
137
160
  files:
138
161
  - CHANGELOG.md
@@ -143,56 +166,6 @@ files:
143
166
  - README.rdoc
144
167
  - Rakefile
145
168
  - bin/na
146
- - html/App.html
147
- - html/NA.html
148
- - html/NA/Action.html
149
- - html/NA/Color.html
150
- - html/README_rdoc.html
151
- - html/String.html
152
- - html/created.rid
153
- - html/css/fonts.css
154
- - html/css/rdoc.css
155
- - html/fonts/Lato-Light.ttf
156
- - html/fonts/Lato-LightItalic.ttf
157
- - html/fonts/Lato-Regular.ttf
158
- - html/fonts/Lato-RegularItalic.ttf
159
- - html/fonts/SourceCodePro-Bold.ttf
160
- - html/fonts/SourceCodePro-Regular.ttf
161
- - html/images/add.png
162
- - html/images/arrow_up.png
163
- - html/images/brick.png
164
- - html/images/brick_link.png
165
- - html/images/bug.png
166
- - html/images/bullet_black.png
167
- - html/images/bullet_toggle_minus.png
168
- - html/images/bullet_toggle_plus.png
169
- - html/images/date.png
170
- - html/images/delete.png
171
- - html/images/find.png
172
- - html/images/loadingAnimation.gif
173
- - html/images/macFFBgHack.png
174
- - html/images/package.png
175
- - html/images/page_green.png
176
- - html/images/page_white_text.png
177
- - html/images/page_white_width.png
178
- - html/images/plugin.png
179
- - html/images/ruby.png
180
- - html/images/tag_blue.png
181
- - html/images/tag_green.png
182
- - html/images/transparent.png
183
- - html/images/wrench.png
184
- - html/images/wrench_orange.png
185
- - html/images/zoom.png
186
- - html/index.html
187
- - html/js/darkfish.js
188
- - html/js/navigation.js
189
- - html/js/navigation.js.gz
190
- - html/js/search.js
191
- - html/js/search_index.js
192
- - html/js/search_index.js.gz
193
- - html/js/searcher.js
194
- - html/js/searcher.js.gz
195
- - html/table_of_contents.html
196
169
  - lib/na.rb
197
170
  - lib/na/action.rb
198
171
  - lib/na/colors.rb
@@ -201,7 +174,9 @@ files:
201
174
  - lib/na/version.rb
202
175
  - na.gemspec
203
176
  - na.rdoc
204
- homepage: https://brettterpstra.com
177
+ - scripts/fixreadme.rb
178
+ - src/README.md
179
+ homepage: https://brettterpstra.com/projects/na/
205
180
  licenses:
206
181
  - MIT
207
182
  metadata: {}
@@ -210,8 +185,9 @@ rdoc_options:
210
185
  - "--title"
211
186
  - na
212
187
  - "--main"
213
- - README.rdoc
214
- - "-ri"
188
+ - README.md
189
+ - "--markup"
190
+ - markdown
215
191
  require_paths:
216
192
  - lib
217
193
  - lib
data/html/App.html DELETED
@@ -1,105 +0,0 @@
1
- <!DOCTYPE html>
2
-
3
- <html>
4
- <head>
5
- <meta charset="UTF-8">
6
-
7
- <title>class App - Your application title</title>
8
-
9
- <script type="text/javascript">
10
- var rdoc_rel_prefix = "./";
11
- var index_rel_prefix = "./";
12
- </script>
13
-
14
- <script src="./js/navigation.js" defer></script>
15
- <script src="./js/search.js" defer></script>
16
- <script src="./js/search_index.js" defer></script>
17
- <script src="./js/searcher.js" defer></script>
18
- <script src="./js/darkfish.js" defer></script>
19
-
20
- <link href="./css/fonts.css" rel="stylesheet">
21
- <link href="./css/rdoc.css" rel="stylesheet">
22
-
23
-
24
- <body id="top" role="document" class="class">
25
- <nav role="navigation">
26
- <div id="project-navigation">
27
- <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
- <h2>
29
- <a href="./index.html" rel="home">Home</a>
30
- </h2>
31
-
32
- <div id="table-of-contents-navigation">
33
- <a href="./table_of_contents.html#pages">Pages</a>
34
- <a href="./table_of_contents.html#classes">Classes</a>
35
- <a href="./table_of_contents.html#methods">Methods</a>
36
- </div>
37
- </div>
38
-
39
- <div id="search-section" role="search" class="project-section initially-hidden">
40
- <form action="#" method="get" accept-charset="utf-8">
41
- <div id="search-field-wrapper">
42
- <input id="search-field" role="combobox" aria-label="Search"
43
- aria-autocomplete="list" aria-controls="search-results"
44
- type="text" name="search" placeholder="Search" spellcheck="false"
45
- title="Type to search, Up and Down to navigate, Enter to load">
46
- </div>
47
-
48
- <ul id="search-results" aria-label="Search Results"
49
- aria-busy="false" aria-expanded="false"
50
- aria-atomic="false" class="initially-hidden"></ul>
51
- </form>
52
- </div>
53
-
54
- </div>
55
-
56
-
57
-
58
- <div id="class-metadata">
59
-
60
-
61
- <div id="parent-class-section" class="nav-section">
62
- <h3>Parent</h3>
63
-
64
- <p class="link">Object
65
- </div>
66
-
67
-
68
-
69
- <div id="extends-section" class="nav-section">
70
- <h3>Extended With Modules</h3>
71
-
72
- <ul class="link-list">
73
- <li><span class="extend">GLI::App</span>
74
- </ul>
75
- </div>
76
-
77
-
78
- </div>
79
- </nav>
80
-
81
- <main role="main" aria-labelledby="class-App">
82
- <h1 id="class-App" class="class">
83
- class App
84
- </h1>
85
-
86
- <section class="description">
87
-
88
- </section>
89
-
90
- <section id="5Buntitled-5D" class="documentation-section">
91
-
92
-
93
-
94
-
95
-
96
- </section>
97
- </main>
98
-
99
-
100
- <footer id="validator-badges" role="contentinfo">
101
- <p><a href="https://validator.w3.org/check/referer">Validate</a>
102
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.3.
103
- <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
104
- </footer>
105
-