standup_md 0.3.1 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +11 -9
- data/README.md +77 -43
- data/Rakefile +3 -1
- data/doc/README_md.html +63 -59
- data/doc/StandupMD.html +4 -23
- data/doc/StandupMD/Cli.html +11 -11
- data/doc/StandupMD/Cli/Helpers.html +8 -7
- data/doc/StandupMD/Config/Cli.html +29 -20
- data/doc/StandupMD/Config/Entry.html +26 -14
- data/doc/StandupMD/Config/EntryList.html +26 -11
- data/doc/StandupMD/Config/File.html +30 -26
- data/doc/StandupMD/Entry.html +1 -1
- data/doc/StandupMD/EntryList.html +116 -194
- data/doc/StandupMD/File.html +67 -25
- data/doc/StandupMD/Version.html +176 -0
- data/doc/created.rid +15 -15
- data/doc/index.html +62 -58
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +66 -59
- data/lib/standup_md.rb +4 -3
- data/lib/standup_md/cli.rb +2 -3
- data/lib/standup_md/cli/helpers.rb +66 -34
- data/lib/standup_md/config.rb +2 -2
- data/lib/standup_md/config/cli.rb +24 -23
- data/lib/standup_md/config/entry.rb +14 -9
- data/lib/standup_md/config/entry_list.rb +10 -5
- data/lib/standup_md/config/file.rb +26 -16
- data/lib/standup_md/entry.rb +2 -2
- data/lib/standup_md/entry_list.rb +24 -41
- data/lib/standup_md/file.rb +42 -15
- data/lib/standup_md/file/helpers.rb +13 -15
- data/lib/standup_md/version.rb +23 -6
- data/standup_md.gemspec +12 -16
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3778ef26e402b37d24ff4b3e7465123ffb3eb0cca19125d5bf44f21b36b92fe7
|
4
|
+
data.tar.gz: 4bef958d825346fdbfdb45c961633245f9edc172ac5877db1723d9c3501f04d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 262cee1fd957f46c19e39af445d50b89d034c925fc857a0b3e64a042e652ce7c0ebfd1addda1999cf40a8052f05b5b24ed274d443764769bd47d23e2aafea1bb
|
7
|
+
data.tar.gz: bfb62a584c6f9386e821deeade2bbf842999d8a210e225114d137701b2bd603f3934a4416a32cfd21ebf35ad5ada526a75e80dd13c2376d010b72119ce9c3960
|
data/Gemfile.lock
CHANGED
@@ -1,23 +1,25 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
standup_md (0.3.
|
4
|
+
standup_md (0.3.5)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
docile (1.3.
|
10
|
-
power_assert (
|
11
|
-
rake (13.0.
|
12
|
-
simplecov (0.
|
9
|
+
docile (1.3.5)
|
10
|
+
power_assert (2.0.0)
|
11
|
+
rake (13.0.3)
|
12
|
+
simplecov (0.21.2)
|
13
13
|
docile (~> 1.1)
|
14
14
|
simplecov-html (~> 0.11)
|
15
|
-
|
16
|
-
|
15
|
+
simplecov_json_formatter (~> 0.1)
|
16
|
+
simplecov-html (0.12.3)
|
17
|
+
simplecov_json_formatter (0.1.2)
|
18
|
+
test-unit (3.4.1)
|
17
19
|
power_assert
|
18
20
|
|
19
21
|
PLATFORMS
|
20
|
-
|
22
|
+
x86_64-darwin-20
|
21
23
|
|
22
24
|
DEPENDENCIES
|
23
25
|
rake (~> 13.0, >= 13.0.1)
|
@@ -26,4 +28,4 @@ DEPENDENCIES
|
|
26
28
|
test-unit (~> 3.3, >= 3.3.5)
|
27
29
|
|
28
30
|
BUNDLED WITH
|
29
|
-
2.
|
31
|
+
2.2.16
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# The Standup Doctor
|
2
|
+
<!-- vi: set ts=4 sw=4 : -->
|
2
3
|
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fevanthegrayt%2Fstandup_md%2Fbadge%3Fref%3Dmaster&style=flat)](https://actions-badge.atrox.dev/evanthegrayt/standup_md/goto?ref=master)
|
3
4
|
[![Gem Version](https://badge.fury.io/rb/standup_md.svg)](https://badge.fury.io/rb/standup_md)
|
4
5
|
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
@@ -12,26 +13,6 @@ View on: [Github](https://github.com/evanthegrayt/standup_md) |
|
|
12
13
|
[GitHub Pages](https://evanthegrayt.github.io/standup_md/) |
|
13
14
|
[RubyGems](https://rubygems.org/gems/standup_md)
|
14
15
|
|
15
|
-
## Table of Contents
|
16
|
-
- [About](#about)
|
17
|
-
- [Installation](#Installation)
|
18
|
-
- [Via RubyGems](#via-rubygems)
|
19
|
-
- [Manual Installation](#manual-installation)
|
20
|
-
- [Usage](#usage)
|
21
|
-
- [Command Line](#command-line)
|
22
|
-
- [CLI Examples](#cli-examples)
|
23
|
-
- [Adding an entry for today via editor](#adding-an-entry-for-today-via-editor)
|
24
|
-
- [Copy the entry for today to clipboard](#copy-the-entry-for-today-to-clipboard)
|
25
|
-
- [Add entry to file without opening it](#add-entry-to-file-without-opening-it)
|
26
|
-
- [Find an entry by date and print it](#find-an-entry-by-date-and-print-it)
|
27
|
-
- [Customization and Runtime Options](#customization-and-runtime-options)
|
28
|
-
- [Using existing standup files](#using-existing-standup-files)
|
29
|
-
- [API](#api)
|
30
|
-
- [API Examples](#api-examples)
|
31
|
-
- [Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html)
|
32
|
-
- [Reporting Bugs and Requesting Features](#reporting-bugs-and-requesting-features)
|
33
|
-
- [Self-Promotion](#self-promotion)
|
34
|
-
|
35
16
|
## About
|
36
17
|
I've now been at two separate companies where we post our daily standups in a
|
37
18
|
chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day
|
@@ -45,10 +26,15 @@ for the current month in your preferred editor. If an entry for today is already
|
|
45
26
|
present, no text will be generated. If an entry for today doesn't exist, one
|
46
27
|
will be generated with your preferred values. When generating, if a previous
|
47
28
|
entry exists, it will be added to today's entry as your previous day's work. See
|
48
|
-
[example](#
|
49
|
-
in your own code somehow.
|
29
|
+
[example](#cli-examples). There's also a very robust API if you'd like to use
|
30
|
+
this in your own code somehow.
|
50
31
|
|
51
32
|
## Installation
|
33
|
+
If you don't have the permissions to install system-wide gems, you're probabaly
|
34
|
+
also running an older version of ruby. I recommend installing
|
35
|
+
[rbenv](https://github.com/rbenv/rbenv#installation), and then installing an
|
36
|
+
up-to-date version of ruby.
|
37
|
+
|
52
38
|
### Via RubyGems
|
53
39
|
Just install the gem!
|
54
40
|
|
@@ -76,7 +62,7 @@ rake install
|
|
76
62
|
|
77
63
|
## Usage
|
78
64
|
### Command Line
|
79
|
-
For the most basic usage,
|
65
|
+
For the most basic usage, simply call the executable.
|
80
66
|
|
81
67
|
```sh
|
82
68
|
standup
|
@@ -132,7 +118,7 @@ result to the command line, you could use the following.
|
|
132
118
|
|
133
119
|
#### Add entry to file without opening it
|
134
120
|
```sh
|
135
|
-
standup --no-edit --current "Work on this thing","And another thing"
|
121
|
+
standup --no-edit --current "Work on this thing","And another thing"
|
136
122
|
```
|
137
123
|
|
138
124
|
#### Find an entry by date and print it.
|
@@ -167,6 +153,8 @@ them again.
|
|
167
153
|
|
168
154
|
|
169
155
|
#### Available Config File Options and Defaults
|
156
|
+
For command-line usage, this file needs to be named `~/.standuprc`. To use in a
|
157
|
+
rails project, create an initializer (`config/initializers/standup_md.rb`).
|
170
158
|
|
171
159
|
```ruby
|
172
160
|
StandupMD.configure do |c|
|
@@ -205,7 +193,15 @@ StandupMD.configure do |c|
|
|
205
193
|
end
|
206
194
|
```
|
207
195
|
|
196
|
+
Any options not set in this file will retain their default values. Note that if
|
197
|
+
you change `file_name_format`, and don't use a month or year, there will only
|
198
|
+
ever be one standup file. This could cause issues long-term, as the files will
|
199
|
+
get large over time and possibly cause performance issues.
|
200
|
+
|
201
|
+
|
208
202
|
#### Executable Flags
|
203
|
+
Some of these options can be changed at runtime. They are as follows.
|
204
|
+
|
209
205
|
```
|
210
206
|
--current ARRAY List of current entry's tasks
|
211
207
|
--previous ARRAY List of precious entry's tasks
|
@@ -224,11 +220,6 @@ end
|
|
224
220
|
DATE must be in the same format as file-name-format
|
225
221
|
```
|
226
222
|
|
227
|
-
Any options not set in this file will retain their default values. Note that if
|
228
|
-
you change `file_name_format`, and don't use a month or year, there will only
|
229
|
-
ever be one standup file. This could cause issues long-term, as the files will
|
230
|
-
get large over time and possibly cause performance issues.
|
231
|
-
|
232
223
|
#### Using Existing Standup Files
|
233
224
|
If you already have a directory of existing standup files, you can use them, but
|
234
225
|
they must be in a format that the parser can understand. The default is:
|
@@ -267,30 +258,29 @@ Your `~/.standuprc` should contain:
|
|
267
258
|
|
268
259
|
```ruby
|
269
260
|
StandupMD.configure do |c|
|
270
|
-
c.file.header_depth
|
271
|
-
c.file.sub_header_depth
|
272
|
-
c.file.current_header
|
273
|
-
c.file.previous_header
|
274
|
-
c.file.impediments_header
|
275
|
-
c.file.bullet_character
|
276
|
-
c.file.header_date_format
|
277
|
-
c.file.sub_header_order
|
261
|
+
c.file.header_depth = 2
|
262
|
+
c.file.sub_header_depth = 3
|
263
|
+
c.file.current_header = 'Today'
|
264
|
+
c.file.previous_header = 'Yesterday'
|
265
|
+
c.file.impediments_header = 'Hold-ups'
|
266
|
+
c.file.bullet_character = '*'
|
267
|
+
c.file.header_date_format = '%m/%d/%Y'
|
268
|
+
c.file.sub_header_order = %w[current previous impediments notes]
|
278
269
|
end
|
279
270
|
```
|
280
271
|
|
281
272
|
## API
|
282
273
|
The API is fully documented in the
|
283
|
-
[
|
274
|
+
[RDoc Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html).
|
284
275
|
|
285
276
|
This was mainly written as a command line utility, but the API is ridiculously
|
286
277
|
robust, and is available for use in your own projects. A quick example of how
|
287
278
|
to write a new entry via code could look like the following:
|
288
279
|
|
289
280
|
### API Examples
|
290
|
-
|
281
|
+
#### Adding an entry for today
|
291
282
|
```ruby
|
292
283
|
require 'standup_md'
|
293
|
-
require 'date'
|
294
284
|
|
295
285
|
StandupMD.configure do |c|
|
296
286
|
c.file.current_header = 'Today',
|
@@ -307,7 +297,6 @@ API fit together. The code can actually be simplified to the following.
|
|
307
297
|
|
308
298
|
```ruby
|
309
299
|
require 'standup_md'
|
310
|
-
require 'date'
|
311
300
|
|
312
301
|
StandupMD.configure do |c|
|
313
302
|
c.file.current_header = 'Today',
|
@@ -317,10 +306,55 @@ end
|
|
317
306
|
StandupMD::File.find_by_date(Date.today).load.write
|
318
307
|
```
|
319
308
|
|
309
|
+
#### Finding a past entry
|
310
|
+
```ruby
|
311
|
+
require 'standup_md'
|
312
|
+
|
313
|
+
date = Date.new(2020, 04, 15)
|
314
|
+
file = StandupMD::File.find_by_date(date).load
|
315
|
+
entry = file.entries.find(date)
|
316
|
+
```
|
317
|
+
|
318
|
+
## Vim
|
319
|
+
While there's no official support for vim, you can add this to your `vimrc`
|
320
|
+
file, or something like `~/.vim/plugin/standup.vim`.
|
321
|
+
|
322
|
+
```vim
|
323
|
+
if executable('standup')
|
324
|
+
command! -complete=custom,s:StandupCompletion -nargs=? -bang Standup
|
325
|
+
\ call s:OpenStandupFile(<bang>0, <f-args>)
|
326
|
+
endif
|
327
|
+
|
328
|
+
function! s:StandupCompletion(...) abort
|
329
|
+
let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
|
330
|
+
if !isdirectory(l:dir) | return '' | endif
|
331
|
+
let l:list = glob(l:dir . '*.md', 0, 1)
|
332
|
+
return join(map(l:list, "substitute(v:val, l:dir, '', '')"), "\n")
|
333
|
+
endfunction
|
334
|
+
|
335
|
+
function! s:OpenStandupFile(split, ...)
|
336
|
+
let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
|
337
|
+
let l:file = a:0 ? a:1 : get(g:, 'standup_file', strftime('%Y_%m.md'))
|
338
|
+
call system('standup --no-edit')
|
339
|
+
execute a:split ? 'vsplit' : 'split' l:dir . l:file
|
340
|
+
endfunction
|
341
|
+
```
|
342
|
+
|
343
|
+
This makes the `:Standup` command, which opens the standup file in a split,
|
344
|
+
while `:Standup!` opens it in a vertical split. If a file is passed to the
|
345
|
+
command, that file will be opened. There's tab completion for this. Lastly,
|
346
|
+
it allows for a few variables to be set for customization.
|
347
|
+
|
348
|
+
```vim
|
349
|
+
g:standup_dir = $HOME . '/.cache/standup_md' " the directory where your file are
|
350
|
+
g:standup_file = strftime('%Y_%m.md') " the file format to use
|
351
|
+
```
|
352
|
+
|
320
353
|
## Reporting Bugs and Requesting Features
|
321
354
|
If you have an idea or find a bug, please [create an
|
322
|
-
issue](https://github.com/evanthegrayt/standup_md/issues/new). Just make sure
|
323
|
-
doesn't already exist. Better yet, you can always submit a Pull
|
355
|
+
issue](https://github.com/evanthegrayt/standup_md/issues/new). Just make sure
|
356
|
+
the topic doesn't already exist. Better yet, you can always submit a Pull
|
357
|
+
Request.
|
324
358
|
|
325
359
|
## Self-Promotion
|
326
360
|
I do these projects for fun, and I enjoy knowing that they're helpful to people.
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'lib/standup_md'
|
2
4
|
require 'bundler/gem_tasks'
|
3
5
|
require 'rdoc/task'
|
@@ -16,4 +18,4 @@ RDoc::Task.new do |rdoc|
|
|
16
18
|
rdoc.rdoc_files.include('README.md', 'lib/**/*.rb')
|
17
19
|
end
|
18
20
|
|
19
|
-
task :
|
21
|
+
task default: :test
|
data/doc/README_md.html
CHANGED
@@ -61,7 +61,6 @@
|
|
61
61
|
|
62
62
|
<ul class="link-list" role="directory">
|
63
63
|
<li><a href="#label-The+Standup+Doctor">The Standup Doctor</a>
|
64
|
-
<li><a href="#label-Table+of+Contents">Table of Contents</a>
|
65
64
|
<li><a href="#label-About">About</a>
|
66
65
|
<li><a href="#label-Installation">Installation</a>
|
67
66
|
<li><a href="#label-Via+RubyGems">Via RubyGems</a>
|
@@ -79,6 +78,9 @@
|
|
79
78
|
<li><a href="#label-Using+Existing+Standup+Files">Using Existing Standup Files</a>
|
80
79
|
<li><a href="#label-API">API</a>
|
81
80
|
<li><a href="#label-API+Examples">API Examples</a>
|
81
|
+
<li><a href="#label-Adding+an+entry+for+today">Adding an entry for today</a>
|
82
|
+
<li><a href="#label-Finding+a+past+entry">Finding a past entry</a>
|
83
|
+
<li><a href="#label-Vim">Vim</a>
|
82
84
|
<li><a href="#label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features</a>
|
83
85
|
<li><a href="#label-Self-Promotion">Self-Promotion</a>
|
84
86
|
</ul>
|
@@ -102,7 +104,7 @@
|
|
102
104
|
<main role="main" aria-label="Page README.md">
|
103
105
|
|
104
106
|
<h1 id="label-The+Standup+Doctor">The Standup Doctor<span><a href="#label-The+Standup+Doctor">¶</a> <a href="#top">↑</a></span></h1>
|
105
|
-
|
107
|
+
<!-- vi: set ts=4 sw=4 : -->
|
106
108
|
<p><a href="https://actions-badge.atrox.dev/evanthegrayt/standup_md/goto?ref=master"><img src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fevanthegrayt%2Fstandup_md%2Fbadge%3Fref%3Dmaster&style=flat"></a> <a href="https://badge.fury.io/rb/standup_md"><img src="https://badge.fury.io/rb/standup_md.svg"></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg"></a></p>
|
107
109
|
|
108
110
|
<blockquote>
|
@@ -113,55 +115,16 @@
|
|
113
115
|
|
114
116
|
<p>View on: <a href="https://github.com/evanthegrayt/standup_md">Github</a> | <a href="https://evanthegrayt.github.io/standup_md/">GitHub Pages</a> | <a href="https://rubygems.org/gems/standup_md">RubyGems</a></p>
|
115
117
|
|
116
|
-
<h2 id="label-Table+of+Contents">Table of Contents<span><a href="#label-Table+of+Contents">¶</a> <a href="#top">↑</a></span></h2>
|
117
|
-
<ul><li>
|
118
|
-
<p><a href="#about">About</a></p>
|
119
|
-
</li><li>
|
120
|
-
<p><a href="#Installation">Installation</a></p>
|
121
|
-
</li><li>
|
122
|
-
<p><a href="#via-rubygems">Via RubyGems</a></p>
|
123
|
-
</li><li>
|
124
|
-
<p><a href="#manual-installation">Manual Installation</a></p>
|
125
|
-
</li><li>
|
126
|
-
<p><a href="#usage">Usage</a></p>
|
127
|
-
</li><li>
|
128
|
-
<p><a href="#command-line">Command Line</a></p>
|
129
|
-
<ul><li>
|
130
|
-
<p><a href="#cli-examples">CLI Examples</a></p>
|
131
|
-
</li><li>
|
132
|
-
<p><a href="#adding-an-entry-for-today-via-editor">Adding an entry for today via editor</a></p>
|
133
|
-
</li><li>
|
134
|
-
<p><a href="#copy-the-entry-for-today-to-clipboard">Copy the entry for today to clipboard</a></p>
|
135
|
-
</li><li>
|
136
|
-
<p><a href="#add-entry-to-file-without-opening-it">Add entry to file without opening it</a></p>
|
137
|
-
</li><li>
|
138
|
-
<p><a href="#find-an-entry-by-date-and-print-it">Find an entry by date and print it</a></p>
|
139
|
-
</li><li>
|
140
|
-
<p><a href="#customization-and-runtime-options">Customization and Runtime Options</a></p>
|
141
|
-
</li><li>
|
142
|
-
<p><a href="#using-existing-standup-files">Using existing standup files</a></p>
|
143
|
-
</li></ul>
|
144
|
-
</li><li>
|
145
|
-
<p><a href="#api">API</a></p>
|
146
|
-
<ul><li>
|
147
|
-
<p><a href="#api-examples">API Examples</a></p>
|
148
|
-
</li><li>
|
149
|
-
<p><a href="https://evanthegrayt.github.io/standup_md/doc/index.html">Documentation</a></p>
|
150
|
-
</li></ul>
|
151
|
-
</li><li>
|
152
|
-
<p><a href="#reporting-bugs-and-requesting-features">Reporting Bugs and Requesting Features</a></p>
|
153
|
-
</li><li>
|
154
|
-
<p><a href="#self-promotion">Self-Promotion</a></p>
|
155
|
-
</li></ul>
|
156
|
-
|
157
118
|
<h2 id="label-About">About<span><a href="#label-About">¶</a> <a href="#top">↑</a></span></h2>
|
158
119
|
|
159
120
|
<p>I've now been at two separate companies where we post our daily standups in a chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day became tedious, as I'd have to look up what I did the day before, copy and paste yesterday's work into a new entry, and add today's tasks. This gem automates most of this process, along with providing means of opening the file in your editor, and finding and displaying entries from the command line.</p>
|
160
121
|
|
161
|
-
<p>In a nutshell, calling <code>standup</code> from the command line will open a standup file for the current month in your preferred editor. If an entry for today is already present, no text will be generated. If an entry for today doesn't exist, one will be generated with your preferred values. When generating, if a previous entry exists, it will be added to today's entry as your previous day's work. See <a href="#
|
122
|
+
<p>In a nutshell, calling <code>standup</code> from the command line will open a standup file for the current month in your preferred editor. If an entry for today is already present, no text will be generated. If an entry for today doesn't exist, one will be generated with your preferred values. When generating, if a previous entry exists, it will be added to today's entry as your previous day's work. See <a href="#cli-examples">example</a>. There's also a very robust API if you'd like to use this in your own code somehow.</p>
|
162
123
|
|
163
124
|
<h2 id="label-Installation">Installation<span><a href="#label-Installation">¶</a> <a href="#top">↑</a></span></h2>
|
164
125
|
|
126
|
+
<p>If you don't have the permissions to install system-wide gems, you're probabaly also running an older version of ruby. I recommend installing <a href="https://github.com/rbenv/rbenv#installation">rbenv</a>, and then installing an up-to-date version of ruby.</p>
|
127
|
+
|
165
128
|
<h3 id="label-Via+RubyGems">Via RubyGems<span><a href="#label-Via+RubyGems">¶</a> <a href="#top">↑</a></span></h3>
|
166
129
|
|
167
130
|
<p>Just install the gem!</p>
|
@@ -188,7 +151,7 @@ rake install</pre>
|
|
188
151
|
|
189
152
|
<h3 id="label-Command+Line">Command Line<span><a href="#label-Command+Line">¶</a> <a href="#top">↑</a></span></h3>
|
190
153
|
|
191
|
-
<p>For the most basic usage,
|
154
|
+
<p>For the most basic usage, simply call the executable.</p>
|
192
155
|
|
193
156
|
<pre class="ruby"><span class="ruby-identifier">standup</span>
|
194
157
|
</pre>
|
@@ -232,7 +195,7 @@ rake install</pre>
|
|
232
195
|
|
233
196
|
<h4 id="label-Add+entry+to+file+without+opening+it">Add entry to file without opening it<span><a href="#label-Add+entry+to+file+without+opening+it">¶</a> <a href="#top">↑</a></span></h4>
|
234
197
|
|
235
|
-
<pre>standup --no-edit --current "Work on this thing","And another thing"
|
198
|
+
<pre>standup --no-edit --current "Work on this thing","And another thing"</pre>
|
236
199
|
|
237
200
|
<h4 id="label-Find+an+entry+by+date+and+print+it.">Find an entry by date and print it.<span><a href="#label-Find+an+entry+by+date+and+print+it.">¶</a> <a href="#top">↑</a></span></h4>
|
238
201
|
|
@@ -250,6 +213,8 @@ rake install</pre>
|
|
250
213
|
|
251
214
|
<h4 id="label-Available+Config+File+Options+and+Defaults">Available Config File Options and Defaults<span><a href="#label-Available+Config+File+Options+and+Defaults">¶</a> <a href="#top">↑</a></span></h4>
|
252
215
|
|
216
|
+
<p>For command-line usage, this file needs to be named <code>~/.standuprc</code>. To use in a rails project, create an initializer (<code>config/initializers/standup_md.rb</code>).</p>
|
217
|
+
|
253
218
|
<pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
254
219
|
<span class="ruby-comment"># Defaults for how the file is formatted.</span>
|
255
220
|
<span class="ruby-comment"># See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html</span>
|
@@ -286,8 +251,12 @@ rake install</pre>
|
|
286
251
|
<span class="ruby-keyword">end</span>
|
287
252
|
</pre>
|
288
253
|
|
254
|
+
<p>Any options not set in this file will retain their default values. Note that if you change <code>file_name_format</code>, and don't use a month or year, there will only ever be one standup file. This could cause issues long-term, as the files will get large over time and possibly cause performance issues.</p>
|
255
|
+
|
289
256
|
<h4 id="label-Executable+Flags">Executable Flags<span><a href="#label-Executable+Flags">¶</a> <a href="#top">↑</a></span></h4>
|
290
257
|
|
258
|
+
<p>Some of these options can be changed at runtime. They are as follows.</p>
|
259
|
+
|
291
260
|
<pre>--current ARRAY List of current entry's tasks
|
292
261
|
--previous ARRAY List of precious entry's tasks
|
293
262
|
--impediments ARRAY List of impediments for current entry
|
@@ -304,8 +273,6 @@ rake install</pre>
|
|
304
273
|
If DATE is passed, will print entry for DATE, if it exists.
|
305
274
|
DATE must be in the same format as file-name-format</pre>
|
306
275
|
|
307
|
-
<p>Any options not set in this file will retain their default values. Note that if you change <code>file_name_format</code>, and don't use a month or year, there will only ever be one standup file. This could cause issues long-term, as the files will get large over time and possibly cause performance issues.</p>
|
308
|
-
|
309
276
|
<h4 id="label-Using+Existing+Standup+Files">Using Existing Standup Files<span><a href="#label-Using+Existing+Standup+Files">¶</a> <a href="#top">↑</a></span></h4>
|
310
277
|
|
311
278
|
<p>If you already have a directory of existing standup files, you can use them, but they must be in a format that the parser can understand. The default is:</p>
|
@@ -337,27 +304,28 @@ rake install</pre>
|
|
337
304
|
<p>Your <code>~/.standuprc</code> should contain:</p>
|
338
305
|
|
339
306
|
<pre class="ruby"><span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
340
|
-
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_depth</span>
|
341
|
-
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_depth</span>
|
342
|
-
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span>
|
343
|
-
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">previous_header</span>
|
344
|
-
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">impediments_header</span>
|
345
|
-
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">bullet_character</span>
|
346
|
-
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_date_format</span>
|
347
|
-
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_order</span>
|
307
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_depth</span> = <span class="ruby-value">2</span>
|
308
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_depth</span> = <span class="ruby-value">3</span>
|
309
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span>
|
310
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">previous_header</span> = <span class="ruby-string">'Yesterday'</span>
|
311
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">impediments_header</span> = <span class="ruby-string">'Hold-ups'</span>
|
312
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">bullet_character</span> = <span class="ruby-string">'*'</span>
|
313
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">header_date_format</span> = <span class="ruby-string">'%m/%d/%Y'</span>
|
314
|
+
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">sub_header_order</span> = <span class="ruby-node">%w[current previous impediments notes]</span>
|
348
315
|
<span class="ruby-keyword">end</span>
|
349
316
|
</pre>
|
350
317
|
|
351
318
|
<h2 id="label-API">API<span><a href="#label-API">¶</a> <a href="#top">↑</a></span></h2>
|
352
319
|
|
353
|
-
<p>The API is fully documented in the <a href="https://evanthegrayt.github.io/standup_md/doc/index.html">
|
320
|
+
<p>The API is fully documented in the <a href="https://evanthegrayt.github.io/standup_md/doc/index.html">RDoc Documentation</a>.</p>
|
354
321
|
|
355
322
|
<p>This was mainly written as a command line utility, but the API is ridiculously robust, and is available for use in your own projects. A quick example of how to write a new entry via code could look like the following:</p>
|
356
323
|
|
357
324
|
<h3 id="label-API+Examples">API Examples<span><a href="#label-API+Examples">¶</a> <a href="#top">↑</a></span></h3>
|
358
325
|
|
326
|
+
<h4 id="label-Adding+an+entry+for+today">Adding an entry for today<span><a href="#label-Adding+an+entry+for+today">¶</a> <a href="#top">↑</a></span></h4>
|
327
|
+
|
359
328
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
360
|
-
<span class="ruby-identifier">require</span> <span class="ruby-string">'date'</span>
|
361
329
|
|
362
330
|
<span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
363
331
|
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span>,
|
@@ -372,7 +340,6 @@ rake install</pre>
|
|
372
340
|
<p>The above example was written as such to show how the different pieces of the API fit together. The code can actually be simplified to the following.</p>
|
373
341
|
|
374
342
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
375
|
-
<span class="ruby-identifier">require</span> <span class="ruby-string">'date'</span>
|
376
343
|
|
377
344
|
<span class="ruby-constant">StandupMD</span>.<span class="ruby-identifier">configure</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
|
378
345
|
<span class="ruby-identifier">c</span>.<span class="ruby-identifier">file</span>.<span class="ruby-identifier">current_header</span> = <span class="ruby-string">'Today'</span>,
|
@@ -382,6 +349,43 @@ rake install</pre>
|
|
382
349
|
<span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">find_by_date</span>(<span class="ruby-constant">Date</span>.<span class="ruby-identifier">today</span>).<span class="ruby-identifier">load</span>.<span class="ruby-identifier">write</span>
|
383
350
|
</pre>
|
384
351
|
|
352
|
+
<h4 id="label-Finding+a+past+entry">Finding a past entry<span><a href="#label-Finding+a+past+entry">¶</a> <a href="#top">↑</a></span></h4>
|
353
|
+
|
354
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'standup_md'</span>
|
355
|
+
|
356
|
+
<span class="ruby-identifier">date</span> = <span class="ruby-constant">Date</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">2020</span>, <span class="ruby-value">04</span>, <span class="ruby-value">15</span>)
|
357
|
+
<span class="ruby-identifier">file</span> = <span class="ruby-constant">StandupMD</span><span class="ruby-operator">::</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">find_by_date</span>(<span class="ruby-identifier">date</span>).<span class="ruby-identifier">load</span>
|
358
|
+
<span class="ruby-identifier">entry</span> = <span class="ruby-identifier">file</span>.<span class="ruby-identifier">entries</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">date</span>)
|
359
|
+
</pre>
|
360
|
+
|
361
|
+
<h2 id="label-Vim">Vim<span><a href="#label-Vim">¶</a> <a href="#top">↑</a></span></h2>
|
362
|
+
|
363
|
+
<p>While there's no official support for vim, you can add this to your <code>vimrc</code> file, or something like <code>~/.vim/plugin/standup.vim</code>.</p>
|
364
|
+
|
365
|
+
<pre>if executable('standup')
|
366
|
+
command! -complete=custom,s:StandupCompletion -nargs=? -bang Standup
|
367
|
+
\ call s:OpenStandupFile(<bang>0, <f-args>)
|
368
|
+
endif
|
369
|
+
|
370
|
+
function! s:StandupCompletion(...) abort
|
371
|
+
let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
|
372
|
+
if !isdirectory(l:dir) | return '' | endif
|
373
|
+
let l:list = glob(l:dir . '*.md', 0, 1)
|
374
|
+
return join(map(l:list, "substitute(v:val, l:dir, '', '')"), "\n")
|
375
|
+
endfunction
|
376
|
+
|
377
|
+
function! s:OpenStandupFile(split, ...)
|
378
|
+
let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
|
379
|
+
let l:file = a:0 ? a:1 : get(g:, 'standup_file', strftime('%Y_%m.md'))
|
380
|
+
call system('standup --no-edit')
|
381
|
+
execute a:split ? 'vsplit' : 'split' l:dir . l:file
|
382
|
+
endfunction</pre>
|
383
|
+
|
384
|
+
<p>This makes the <code>:Standup</code> command, which opens the standup file in a split, while <code>:Standup!</code> opens it in a vertical split. If a file is passed to the command, that file will be opened. There's tab completion for this. Lastly, it allows for a few variables to be set for customization.</p>
|
385
|
+
|
386
|
+
<pre>g:standup_dir = $HOME . '/.cache/standup_md' " the directory where your file are
|
387
|
+
g:standup_file = strftime('%Y_%m.md') " the file format to use</pre>
|
388
|
+
|
385
389
|
<h2 id="label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features<span><a href="#label-Reporting+Bugs+and+Requesting+Features">¶</a> <a href="#top">↑</a></span></h2>
|
386
390
|
|
387
391
|
<p>If you have an idea or find a bug, please <a href="https://github.com/evanthegrayt/standup_md/issues/new">create an issue</a>. Just make sure the topic doesn't already exist. Better yet, you can always submit a Pull Request.</p>
|