standup_md 0.3.4 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71a7fb49df17324d09d35de586a54edb308f684cad586fefc5a0da8feeb1f6c1
4
- data.tar.gz: 592f369262e459631dacae459836e804c9fe9777932f9b9e1f6ee9201a6d8e99
3
+ metadata.gz: a87d888af43be793a8c4d542a57d6260de252df5abf6d4e5025b04b389c1569c
4
+ data.tar.gz: 336d2d4c04678ab01262eebf2323f69d48347f873d9236dfdb8c781a6e20caa7
5
5
  SHA512:
6
- metadata.gz: e02396bf9be1f7087122f2f52d5cd7b038716be203ff7303ff99c4335eae2e82a1114d13a782523df4647477865d9972ba257eed2d31ae253992ea98a985d675
7
- data.tar.gz: ef19c102c52fe69cc767ced8523a841cbea1714e6a9d4cd05f2c45e4c07d4721e33b0abf7fbc84354498bfc02e2cb09168b1ee667c4022b0edb9805a202a6dd6
6
+ metadata.gz: f965f80af7cdb9023487f2ed458b9da2e6e94d6474f777c6ff11266e309a6025f4d6051e639d8bf3e31d8f8a4b23419c6a6be602ee32954974162eb1b41c0659
7
+ data.tar.gz: 1f3fcf18356183cea6fdf77a2cb1298b082e915d056f6b649ac41440c40aa76f88db6da365296fedea5b3723efe258a5cbe5be23d10e10a3810bdf941e920a24
data/Gemfile.lock CHANGED
@@ -1,23 +1,25 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standup_md (0.3.3)
4
+ standup_md (0.3.8)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- docile (1.3.2)
10
- power_assert (1.2.0)
11
- rake (13.0.1)
12
- simplecov (0.18.5)
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
- simplecov-html (0.12.2)
16
- test-unit (3.3.6)
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
- ruby
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.1.4
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,27 +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
- - [Adding an entry for today](#adding-an-entry-for-today)
32
- - [Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html)
33
- - [Reporting Bugs and Requesting Features](#reporting-bugs-and-requesting-features)
34
- - [Self-Promotion](#self-promotion)
35
-
36
16
  ## About
37
17
  I've now been at two separate companies where we post our daily standups in a
38
18
  chat client, such as Slack, Mattermost, or Riot. Typing out my standup every day
@@ -46,8 +26,8 @@ for the current month in your preferred editor. If an entry for today is already
46
26
  present, no text will be generated. If an entry for today doesn't exist, one
47
27
  will be generated with your preferred values. When generating, if a previous
48
28
  entry exists, it will be added to today's entry as your previous day's work. See
49
- [example](#example). There's also a very robust API if you'd like to use this
50
- 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.
51
31
 
52
32
  ## Installation
53
33
  If you don't have the permissions to install system-wide gems, you're probabaly
@@ -133,20 +113,12 @@ your clipboard without even opening your editor.
133
113
  standup -p | pbcopy
134
114
  ```
135
115
 
136
- If you wanted to add today's entry without opening your editor, and print the
137
- result to the command line, you could use the following.
138
-
139
116
  #### Add entry to file without opening it
140
- ```sh
141
- standup --no-edit --current "Work on this thing","And another thing"
142
- ```
143
-
144
- #### Find an entry by date and print it.
145
- If you wanted to find and print the entry for March 2nd, 2020, you could use the
146
- following.
117
+ You can add an entry for today without even opening your editor. Note that, if
118
+ you have multiple entries, you must separate them with a comma and *no spaces*.
147
119
 
148
120
  ```sh
149
- standup -p 2020-03-02
121
+ standup --no-edit --current "Work on this thing","And another thing"
150
122
  ```
151
123
 
152
124
  ### Customization and Runtime Options
@@ -213,7 +185,15 @@ StandupMD.configure do |c|
213
185
  end
214
186
  ```
215
187
 
188
+ Any options not set in this file will retain their default values. Note that if
189
+ you change `file_name_format`, and don't use a month or year, there will only
190
+ ever be one standup file. This could cause issues long-term, as the files will
191
+ get large over time and possibly cause performance issues.
192
+
193
+
216
194
  #### Executable Flags
195
+ Some of these options can be changed at runtime. They are as follows.
196
+
217
197
  ```
218
198
  --current ARRAY List of current entry's tasks
219
199
  --previous ARRAY List of precious entry's tasks
@@ -232,11 +212,6 @@ end
232
212
  DATE must be in the same format as file-name-format
233
213
  ```
234
214
 
235
- Any options not set in this file will retain their default values. Note that if
236
- you change `file_name_format`, and don't use a month or year, there will only
237
- ever be one standup file. This could cause issues long-term, as the files will
238
- get large over time and possibly cause performance issues.
239
-
240
215
  #### Using Existing Standup Files
241
216
  If you already have a directory of existing standup files, you can use them, but
242
217
  they must be in a format that the parser can understand. The default is:
@@ -290,9 +265,9 @@ end
290
265
  The API is fully documented in the
291
266
  [RDoc Documentation](https://evanthegrayt.github.io/standup_md/doc/index.html).
292
267
 
293
- This was mainly written as a command line utility, but the API is ridiculously
294
- robust, and is available for use in your own projects. A quick example of how
295
- to write a new entry via code could look like the following:
268
+ This was mainly written as a command line utility, but the API is very robust,
269
+ and is available for use in your own projects. A quick example of how to write a
270
+ new entry via code could look like the following:
296
271
 
297
272
  ### API Examples
298
273
  #### Adding an entry for today
@@ -323,10 +298,52 @@ end
323
298
  StandupMD::File.find_by_date(Date.today).load.write
324
299
  ```
325
300
 
301
+ #### Finding a past entry
302
+ ```ruby
303
+ require 'standup_md'
304
+
305
+ date = Date.new(2020, 04, 15)
306
+ file = StandupMD::File.find_by_date(date).load
307
+ entry = file.entries.find(date)
308
+ ```
309
+
310
+ ## Vim
311
+ While there's no official support for vim, you can add this to your `vimrc`
312
+ file, or something like `~/.vim/plugin/standup.vim`.
313
+
314
+ ```vim
315
+ command! -complete=custom,<SID>StandupCompletion -nargs=? -bang Standup
316
+ \ call <SID>OpenStandupFile(<bang>0, <f-args>)
317
+
318
+ function! s:StandupCompletion(...) abort
319
+ let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
320
+ if !isdirectory(l:dir) | return '' | endif
321
+ return join(map(glob(l:dir . '*.md', 0, 1), "fnamemodify(v:val, ':t')"), "\n")
322
+ endfunction
323
+
324
+ function! s:OpenStandupFile(split, ...)
325
+ let l:dir = get(g:, 'standup_dir', $HOME . '/.cache/standup_md') . '/'
326
+ let l:file = a:0 ? a:1 : get(g:, 'standup_file', strftime('%Y_%m.md'))
327
+ call system('standup --no-edit')
328
+ execute a:split ? 'vsplit' : 'split' l:dir . l:file
329
+ endfunction
330
+ ```
331
+
332
+ This makes the `:Standup` command, which opens the standup file in a split,
333
+ while `:Standup!` opens it in a vertical split. If a file is passed to the
334
+ command, that file will be opened. There's tab completion for this. Lastly,
335
+ it allows for a few variables to be set for customization.
336
+
337
+ ```vim
338
+ g:standup_dir = $HOME . '/.cache/standup_md' " the directory where your file are
339
+ g:standup_file = strftime('%Y_%m.md') " the file format to use
340
+ ```
341
+
326
342
  ## Reporting Bugs and Requesting Features
327
343
  If you have an idea or find a bug, please [create an
328
- issue](https://github.com/evanthegrayt/standup_md/issues/new). Just make sure the topic
329
- doesn't already exist. Better yet, you can always submit a Pull Request.
344
+ issue](https://github.com/evanthegrayt/standup_md/issues/new). Just make sure
345
+ the topic doesn't already exist. Better yet, you can always submit a Pull
346
+ Request.
330
347
 
331
348
  ## Self-Promotion
332
349
  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 :default => :test
21
+ task default: :test
data/doc/README_md.html CHANGED
@@ -21,8 +21,6 @@
21
21
  <link href="./css/rdoc.css" rel="stylesheet">
22
22
 
23
23
 
24
-
25
-
26
24
  <body id="top" role="document" class="file">
27
25
  <nav role="navigation">
28
26
  <div id="project-navigation">
@@ -61,7 +59,6 @@
61
59
 
62
60
  <ul class="link-list" role="directory">
63
61
  <li><a href="#label-The+Standup+Doctor">The Standup Doctor</a>
64
- <li><a href="#label-Table+of+Contents">Table of Contents</a>
65
62
  <li><a href="#label-About">About</a>
66
63
  <li><a href="#label-Installation">Installation</a>
67
64
  <li><a href="#label-Via+RubyGems">Via RubyGems</a>
@@ -72,13 +69,15 @@
72
69
  <li><a href="#label-Adding+an+entry+for+today+via+editor">Adding an entry for today via editor</a>
73
70
  <li><a href="#label-Copy+the+entry+for+today+to+clipboard">Copy the entry for today to clipboard</a>
74
71
  <li><a href="#label-Add+entry+to+file+without+opening+it">Add entry to file without opening it</a>
75
- <li><a href="#label-Find+an+entry+by+date+and+print+it.">Find an entry by date and print it.</a>
76
72
  <li><a href="#label-Customization+and+Runtime+Options">Customization and Runtime Options</a>
77
73
  <li><a href="#label-Available+Config+File+Options+and+Defaults">Available Config File Options and Defaults</a>
78
74
  <li><a href="#label-Executable+Flags">Executable Flags</a>
79
75
  <li><a href="#label-Using+Existing+Standup+Files">Using Existing Standup Files</a>
80
76
  <li><a href="#label-API">API</a>
81
77
  <li><a href="#label-API+Examples">API Examples</a>
78
+ <li><a href="#label-Adding+an+entry+for+today">Adding an entry for today</a>
79
+ <li><a href="#label-Finding+a+past+entry">Finding a past entry</a>
80
+ <li><a href="#label-Vim">Vim</a>
82
81
  <li><a href="#label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features</a>
83
82
  <li><a href="#label-Self-Promotion">Self-Promotion</a>
84
83
  </ul>
@@ -86,13 +85,12 @@
86
85
 
87
86
 
88
87
  <div id="project-metadata">
89
- <div id="fileindex-section" class="nav-section">
88
+
89
+ <div id="fileindex-section" class="nav-section">
90
90
  <h3>Pages</h3>
91
91
 
92
92
  <ul class="link-list">
93
-
94
93
  <li><a href="./README_md.html">README</a>
95
-
96
94
  </ul>
97
95
  </div>
98
96
 
@@ -102,7 +100,7 @@
102
100
  <main role="main" aria-label="Page README.md">
103
101
 
104
102
  <h1 id="label-The+Standup+Doctor">The Standup Doctor<span><a href="#label-The+Standup+Doctor">&para;</a> <a href="#top">&uarr;</a></span></h1>
105
-
103
+ <!-- vi: set ts=4 sw=4 : -->
106
104
  <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
105
 
108
106
  <blockquote>
@@ -113,55 +111,16 @@
113
111
 
114
112
  <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
113
 
116
- <h2 id="label-Table+of+Contents">Table of Contents<span><a href="#label-Table+of+Contents">&para;</a> <a href="#top">&uarr;</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
114
  <h2 id="label-About">About<span><a href="#label-About">&para;</a> <a href="#top">&uarr;</a></span></h2>
158
115
 
159
116
  <p>I&#39;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&#39;d have to look up what I did the day before, copy and paste yesterday&#39;s work into a new entry, and add today&#39;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
117
 
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&#39;t exist, one will be generated with your preferred values. When generating, if a previous entry exists, it will be added to today&#39;s entry as your previous day&#39;s work. See <a href="#example">example</a>. There&#39;s also a very robust API if you&#39;d like to use this in your own code somehow.</p>
118
+ <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&#39;t exist, one will be generated with your preferred values. When generating, if a previous entry exists, it will be added to today&#39;s entry as your previous day&#39;s work. See <a href="#cli-examples">example</a>. There&#39;s also a very robust API if you&#39;d like to use this in your own code somehow.</p>
162
119
 
163
120
  <h2 id="label-Installation">Installation<span><a href="#label-Installation">&para;</a> <a href="#top">&uarr;</a></span></h2>
164
121
 
122
+ <p>If you don&#39;t have the permissions to install system-wide gems, you&#39;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>
123
+
165
124
  <h3 id="label-Via+RubyGems">Via RubyGems<span><a href="#label-Via+RubyGems">&para;</a> <a href="#top">&uarr;</a></span></h3>
166
125
 
167
126
  <p>Just install the gem!</p>
@@ -228,17 +187,11 @@ rake install</pre>
228
187
  <pre class="ruby"><span class="ruby-identifier">standup</span> <span class="ruby-operator">-</span><span class="ruby-identifier">p</span> <span class="ruby-operator">|</span> <span class="ruby-identifier">pbcopy</span>
229
188
  </pre>
230
189
 
231
- <p>If you wanted to add today&#39;s entry without opening your editor, and print the result to the command line, you could use the following.</p>
232
-
233
190
  <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">&para;</a> <a href="#top">&uarr;</a></span></h4>
234
191
 
235
- <pre>standup --no-edit --current &quot;Work on this thing&quot;,&quot;And another thing&quot;</pre>
236
-
237
- <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.">&para;</a> <a href="#top">&uarr;</a></span></h4>
192
+ <p>You can add an entry for today without even opening your editor. Note that, if you have multiple entries, you must separate them with a comma and <em>no spaces</em>.</p>
238
193
 
239
- <p>If you wanted to find and print the entry for March 2nd, 2020, you could use the following.</p>
240
-
241
- <pre>standup -p 2020-03-02</pre>
194
+ <pre>standup --no-edit --current &quot;Work on this thing&quot;,&quot;And another thing&quot;</pre>
242
195
 
243
196
  <h3 id="label-Customization+and+Runtime+Options">Customization and Runtime Options<span><a href="#label-Customization+and+Runtime+Options">&para;</a> <a href="#top">&uarr;</a></span></h3>
244
197
 
@@ -250,6 +203,8 @@ rake install</pre>
250
203
 
251
204
  <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">&para;</a> <a href="#top">&uarr;</a></span></h4>
252
205
 
206
+ <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>
207
+
253
208
  <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
209
  <span class="ruby-comment"># Defaults for how the file is formatted.</span>
255
210
  <span class="ruby-comment"># See https://evanthegrayt.github.io/standup_md/doc/StandupMD/Config/Cli.html</span>
@@ -286,8 +241,12 @@ rake install</pre>
286
241
  <span class="ruby-keyword">end</span>
287
242
  </pre>
288
243
 
244
+ <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&#39;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>
245
+
289
246
  <h4 id="label-Executable+Flags">Executable Flags<span><a href="#label-Executable+Flags">&para;</a> <a href="#top">&uarr;</a></span></h4>
290
247
 
248
+ <p>Some of these options can be changed at runtime. They are as follows.</p>
249
+
291
250
  <pre>--current ARRAY List of current entry&#39;s tasks
292
251
  --previous ARRAY List of precious entry&#39;s tasks
293
252
  --impediments ARRAY List of impediments for current entry
@@ -304,8 +263,6 @@ rake install</pre>
304
263
  If DATE is passed, will print entry for DATE, if it exists.
305
264
  DATE must be in the same format as file-name-format</pre>
306
265
 
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&#39;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
266
  <h4 id="label-Using+Existing+Standup+Files">Using Existing Standup Files<span><a href="#label-Using+Existing+Standup+Files">&para;</a> <a href="#top">&uarr;</a></span></h4>
310
267
 
311
268
  <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>
@@ -352,10 +309,12 @@ rake install</pre>
352
309
 
353
310
  <p>The API is fully documented in the <a href="https://evanthegrayt.github.io/standup_md/doc/index.html">RDoc Documentation</a>.</p>
354
311
 
355
- <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>
312
+ <p>This was mainly written as a command line utility, but the API is very 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
313
 
357
314
  <h3 id="label-API+Examples">API Examples<span><a href="#label-API+Examples">&para;</a> <a href="#top">&uarr;</a></span></h3>
358
315
 
316
+ <h4 id="label-Adding+an+entry+for+today">Adding an entry for today<span><a href="#label-Adding+an+entry+for+today">&para;</a> <a href="#top">&uarr;</a></span></h4>
317
+
359
318
  <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;standup_md&#39;</span>
360
319
 
361
320
  <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>
@@ -380,6 +339,40 @@ rake install</pre>
380
339
  <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>
381
340
  </pre>
382
341
 
342
+ <h4 id="label-Finding+a+past+entry">Finding a past entry<span><a href="#label-Finding+a+past+entry">&para;</a> <a href="#top">&uarr;</a></span></h4>
343
+
344
+ <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;standup_md&#39;</span>
345
+
346
+ <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>)
347
+ <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>
348
+ <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>)
349
+ </pre>
350
+
351
+ <h2 id="label-Vim">Vim<span><a href="#label-Vim">&para;</a> <a href="#top">&uarr;</a></span></h2>
352
+
353
+ <p>While there&#39;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>
354
+
355
+ <pre>command! -complete=custom,&lt;SID&gt;StandupCompletion -nargs=? -bang Standup
356
+ \ call &lt;SID&gt;OpenStandupFile(&lt;bang&gt;0, &lt;f-args&gt;)
357
+
358
+ function! s:StandupCompletion(...) abort
359
+ let l:dir = get(g:, &#39;standup_dir&#39;, $HOME . &#39;/.cache/standup_md&#39;) . &#39;/&#39;
360
+ if !isdirectory(l:dir) | return &#39;&#39; | endif
361
+ return join(map(glob(l:dir . &#39;*.md&#39;, 0, 1), &quot;fnamemodify(v:val, &#39;:t&#39;)&quot;), &quot;\n&quot;)
362
+ endfunction
363
+
364
+ function! s:OpenStandupFile(split, ...)
365
+ let l:dir = get(g:, &#39;standup_dir&#39;, $HOME . &#39;/.cache/standup_md&#39;) . &#39;/&#39;
366
+ let l:file = a:0 ? a:1 : get(g:, &#39;standup_file&#39;, strftime(&#39;%Y_%m.md&#39;))
367
+ call system(&#39;standup --no-edit&#39;)
368
+ execute a:split ? &#39;vsplit&#39; : &#39;split&#39; l:dir . l:file
369
+ endfunction</pre>
370
+
371
+ <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&#39;s tab completion for this. Lastly, it allows for a few variables to be set for customization.</p>
372
+
373
+ <pre>g:standup_dir = $HOME . &#39;/.cache/standup_md&#39; &quot; the directory where your file are
374
+ g:standup_file = strftime(&#39;%Y_%m.md&#39;) &quot; the file format to use</pre>
375
+
383
376
  <h2 id="label-Reporting+Bugs+and+Requesting+Features">Reporting Bugs and Requesting Features<span><a href="#label-Reporting+Bugs+and+Requesting+Features">&para;</a> <a href="#top">&uarr;</a></span></h2>
384
377
 
385
378
  <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&#39;t already exist. Better yet, you can always submit a Pull Request.</p>
@@ -394,7 +387,7 @@ rake install</pre>
394
387
 
395
388
  <footer id="validator-badges" role="contentinfo">
396
389
  <p><a href="https://validator.w3.org/check/referer">Validate</a>
397
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.2.1.
390
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.0.
398
391
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
399
392
  </footer>
400
393