howzit 1.2.6 → 1.2.10

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: ca091b1137f05559c0e53738d8cf283e3e301bbd434b3241a54592ded4aac39a
4
- data.tar.gz: 99f0a601a6d2655954da642621df18573f15bcefe44ccb458b3ef61f397ec92b
3
+ metadata.gz: fba37c5c428aeab92ed337697a52323d5b98d5f9398776187e000043e3a5173b
4
+ data.tar.gz: 6f3a3ebfe50f50476837c2d702cd1c9854d49ff4960c51a06641e79d88abb410
5
5
  SHA512:
6
- metadata.gz: 24215ee9b271df785dedee31da6f2bf3ecbc4be69231635ee0d77a6e9a76b5fa1507e4125ee9b896cc15559842d7546302f25a789b726a87a7a4a3531a6a49bf
7
- data.tar.gz: a1754b95775992055ba92a294215bc9680e296f932cf2d2664a0e00e9d5442742469ac2f51e8acd741f788b49a9b39053083c4cd0d271d7aa2db167394fb343e
6
+ metadata.gz: 015bc504dca39d5b7a32b6d81a4df037abf61467f58b392e88389557f38a2abfb078fd3dc5ced7411b5d1654479d5a79b94da843f8384d4cf77216e9efa1c24c
7
+ data.tar.gz: c0b2003e8c1b24efa1e193520a66e01813fab6e9d8e21318a7d0c82718540fa8ef1c99b075d40dc07254c678015ca3fe687b64a2be6f8ce541c22e786ac63c9a
data/CHANGELOG.md CHANGED
@@ -1,10 +1,181 @@
1
- # Change Log
1
+ ### 1.2.10
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- This project adheres to [Semantic Versioning](http://semver.org/).
5
- This change log follows the conventions of
6
- [keep a CHANGELOG](http://keepachangelog.com/).
3
+ 2022-08-01 07:45
7
4
 
8
- ## [Unreleased]
5
+ #### FIXED
9
6
 
10
- [Unreleased]: https://github.com/ttscoff/howzit/compare/v1.2.4...HEAD
7
+ - Headline formatting when iTerm markers are inserted
8
+
9
+ ### 1.2.9
10
+
11
+ 2022-08-01 07:09
12
+
13
+ ### 1.2.8
14
+
15
+ 2022-08-01 07:01
16
+
17
+ #### FIXED
18
+
19
+ - Frozen string error
20
+
21
+ ### 1.2.6
22
+
23
+ 2022-08-01 06:09
24
+
25
+ #### NEW
26
+
27
+ - Use @before...@end and @after...@end to specify prerequisites and a post-run message. Topics with @before will require y/n verification before running
28
+
29
+ #### FIXED
30
+
31
+ - ITerm markers weren't being inserted when paging was off
32
+
33
+ ### 1.2.3
34
+
35
+ 2022-07-31 14:20
36
+
37
+ #### IMPROVED
38
+
39
+ - Don't include a topic multiple times in one display
40
+ - Don't execute nested topics more than once
41
+ - Indicate nested includes in headers
42
+ - Code cleanup
43
+
44
+ ### 1.2.2
45
+
46
+ 2022-07-31 08:56
47
+
48
+ - Add -F option to pager setup (quit if less than one screen)
49
+
50
+ ### 1.2.1
51
+
52
+ 2022-07-31 05:12
53
+
54
+ - Add handling for delta pager to not clear screen on exit
55
+
56
+ ### 1.2.0
57
+
58
+ 2022-07-31 04:59
59
+
60
+ - Add grep feature, searches topic/content for pattern and displays matches (selection menu if multiple matches)
61
+
62
+ ### 1.1.27
63
+
64
+ 2022-01-17 11:45
65
+
66
+ #### NEW
67
+
68
+ - Use fzf for menus if available
69
+ - "@run() TITLE" will show TITLE instead of command when listing runnable topics
70
+ - @include(FILENAME) will import an external file if the path exists
71
+
72
+ ### 1.1.26
73
+
74
+ - Fix for error in interactive build notes creation
75
+
76
+ ### 1.1.25
77
+
78
+ - Hide run block contents by default
79
+ - :show_all_code: config setting to include run block contents
80
+ - --show-code flag to display run block contents at runtime
81
+ - Modify include display
82
+
83
+ ### 1.1.24
84
+
85
+ - Use ~/.config/howzit/ignore.yaml to ignore patterns when scanning for build notes
86
+ - Use `required` and `optional` keys in templates to request that metadata be defined when importing
87
+ - Allow templates to include other templates
88
+
89
+ ### 1.1.23
90
+
91
+ - Add flags to allow content to stay onscreen after exiting pager (less and bat)
92
+
93
+ ### 1.1.21
94
+
95
+ - Merge directive and block handling so execution order is sequential
96
+
97
+ ### 1.1.20
98
+
99
+ - Template functionality for including common tasks/topics
100
+
101
+ ### 1.1.19
102
+
103
+ - Add `--upstream` option to traverse up parent directories for additional build notes
104
+
105
+ ### 1.1.15
106
+
107
+ - Code refactoring/cleanup
108
+ - Rename "sections" to "topics"
109
+ - If no match found for topic search, only show error (`:show_all_on_error: false` option)
110
+
111
+ ### 1.1.14
112
+
113
+ - Fix removal of non-alphanumeric characters from titles
114
+ - -s/--select option to display a menu of all available topics
115
+ - Allow arguments to be passed after `--` for variable substitution
116
+ - Allow --matching TYPE to match first non-ambigous keyword match
117
+
118
+ ### 1.1.13
119
+
120
+ - --matching [fuzzy,beginswith,partial,exact] flag
121
+ - --edit-config flag
122
+ - sort flags in help
123
+
124
+ ### 1.1.12
125
+
126
+ - After consideration, remove full fuzzy matching. Too many positives for shorter strings.
127
+
128
+ ### 1.1.11
129
+
130
+ - Add full fuzzy matching for topic titles
131
+ - Add `@include(TOPIC)` command to import another topic's tasks
132
+
133
+ ### 1.1.10
134
+
135
+ - Add config file for default options
136
+
137
+ ### 1.1.9
138
+
139
+ - Use `system` instead of `exec` to allow multiple @run commands
140
+ - Add code block runner
141
+
142
+ ### 1.1.8
143
+
144
+ - Add `-e/--edit` flag to open build notes in $EDITOR
145
+
146
+ ### 1.1.7
147
+
148
+ - Use `exec` for @run commands to allow interactive processes (e.g. vim)
149
+
150
+ ### 1.1.6
151
+
152
+ - Add option for outputting title with notes
153
+ - Add option for outputting note title only
154
+
155
+ ### 1.1.4
156
+
157
+ - Fix for "topic not found" when run with no arguments
158
+
159
+ ### 1.1.1
160
+
161
+ - Reorganize and rename long output options
162
+ - Fix wrapping long lines without spaces
163
+
164
+ ### 1.1.0
165
+
166
+ - Add -R switch for listing "runnable" topics
167
+ - Add -T switch for completion-compatible listing of "runnable" topics
168
+ - Add -L switch for completion-compatible listing of all topics
169
+
170
+ ### 1.0.1
171
+
172
+ - Allow topic matching within title, not just at start
173
+ - Remove formatting of topic text for better compatibility with mdless/mdcat
174
+ - Add @run() syntax to allow executable commands
175
+ - Add @copy() syntax to copy text to clipboard
176
+ - Add @url/@open() syntax to open urls/files, OS agnostic (hopefully)
177
+ - Add support for mdless/mdcat
178
+ - Add support for pager
179
+ - Offer to create skeleton buildnotes if none found
180
+ - Set iTerm 2 marks for navigation when paging is disabled
181
+ - Wrap output with option to specify width (default 80, 0 to disable)
data/README.md CHANGED
@@ -87,6 +87,12 @@ You can include commands that can be executed by howzit. Commands start at the b
87
87
  - `@include(TOPIC)`
88
88
 
89
89
  Includes all tasks from another topic, matching the name (partial match allowed) and returning first match.
90
+ - `@before...@end`
91
+
92
+ A block defined between @before and @end markers will be considered prerequisite for any task the topic can run. If one or more of these blocks exist in the topic, they will be displayed before running and a yes/no dialog will request confirmation that the prerequisites have been met. The content between these markers is still included when viewing the topic, but the tags themselves do not show up in output.
93
+ - `@after...@end`
94
+
95
+ A block defined between @after and @end markers will be displayed after a topic is run. Use it to remind yourself of additional tasks after automated ones have been executed. The content between these markers is still included when viewing the topic, but the tags themselves do not show up in output.
90
96
 
91
97
  ### Run blocks (embedded scripts)
92
98
 
@@ -132,8 +132,12 @@ module Howzit
132
132
  end
133
133
  end
134
134
 
135
+ def should_mark_iterm?
136
+ ENV['TERM_PROGRAM'] =~ /^iTerm/ && !@options[:run] && !@options[:paginate]
137
+ end
138
+
135
139
  def iterm_marker
136
- "\e]1337;SetMark\a\n" if ENV['TERM_PROGRAM'] =~ /^iTerm/ && !@options[:run] && !@options[:paginate]
140
+ "\e]1337;SetMark\a" if should_mark_iterm?
137
141
  end
138
142
 
139
143
  def color_single_options(choices = %w[y n])
@@ -226,16 +230,23 @@ module Howzit
226
230
  options = {
227
231
  hr: "\u{254C}",
228
232
  color: '1;32',
229
- border: '0'
233
+ border: '0',
234
+ mark: false
230
235
  }
231
236
 
232
237
  options.merge!(opts)
233
238
 
234
239
  cols = TTY::Screen.columns
240
+
235
241
  cols = @options[:wrap] if (@options[:wrap]).positive? && cols > @options[:wrap]
236
- title = "\e[#{options[:border]}m#{options[:hr]}#{options[:hr]}( \e[#{options[:color]}m#{title}\e[#{options[:border]}m )"
237
- tail = options[:hr] * (cols - title.uncolor.length)
238
- options[:hr] =~ /╌/ ? "#{iterm_marker}#{title}#{tail}\e[0m" : "#{title}#{tail}\e[0m"
242
+ title = "\e[#{options[:border]}m#{options[:hr] * 2}( \e[#{options[:color]}m#{title}\e[#{options[:border]}m )"
243
+
244
+ tail = if should_mark_iterm?
245
+ "#{options[:hr] * (cols - title.uncolor.length - 15)}#{options[:mark] ? iterm_marker : ''}"
246
+ else
247
+ options[:hr] * (cols - title.uncolor.length)
248
+ end
249
+ "#{title}#{tail}\e[0m"
239
250
  end
240
251
 
241
252
  def os_open(command)
@@ -344,7 +355,7 @@ module Howzit
344
355
 
345
356
  output = []
346
357
  if opt[:header]
347
- output.push(format_header(key))
358
+ output.push(format_header(key, { mark: should_mark_iterm? }))
348
359
  output.push('')
349
360
  end
350
361
  topic = topics[key].strip
@@ -49,11 +49,11 @@ module Howzit
49
49
  # Truncate string to nearest word
50
50
  # @param len <number> max length of string
51
51
  def trunc(len)
52
- split(/ /).each_with_object('') do |x, ob|
53
- break ob unless ob.length + ' '.length + x.length <= len
52
+ split(/ /).each_with_object([]) do |x, ob|
53
+ break ob unless ob.join(' ').length + ' '.length + x.length <= len
54
54
 
55
- ob << (" #{x}")
56
- end.strip
55
+ ob.push(x)
56
+ end.join(' ').strip
57
57
  end
58
58
 
59
59
  def trunc!(len)
@@ -2,5 +2,5 @@
2
2
  # Primary module for this gem.
3
3
  module Howzit
4
4
  # Current Howzit version.
5
- VERSION = '1.2.6'.freeze
5
+ VERSION = '1.2.10'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: howzit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra