howzit 2.1.18 → 2.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/howzit/prompt.rb CHANGED
@@ -83,21 +83,24 @@ module Howzit
83
83
  ## number of options, anything
84
84
  ## else gets max height for
85
85
  ## terminal)
86
+ ## @param query [String] The search term to display in prompt
86
87
  ##
87
88
  ## @return [Array] the selected results
88
89
  ##
89
- def choose(matches, height: :auto)
90
- return [] if !$stdout.isatty || matches.count.zero?
90
+ def choose(matches, height: :auto, query: nil)
91
+ return [] if matches.count.zero?
92
+ return matches if matches.count == 1
93
+ return [] unless $stdout.isatty
91
94
 
92
95
  if Util.command_exist?('fzf')
93
96
  height = height == :auto ? matches.count + 3 : TTY::Screen.rows
94
97
 
95
- settings = fzf_options(height)
98
+ settings = fzf_options(height, query: query)
96
99
  res = `echo #{Shellwords.escape(matches.join("\n"))} | fzf #{settings.join(' ')}`.strip
97
100
  return fzf_result(res)
98
101
  end
99
102
 
100
- tty_menu(matches)
103
+ tty_menu(matches, query: query)
101
104
  end
102
105
 
103
106
  def fzf_result(res)
@@ -108,7 +111,12 @@ module Howzit
108
111
  res.split(/\n/)
109
112
  end
110
113
 
111
- def fzf_options(height)
114
+ def fzf_options(height, query: nil)
115
+ prompt = if query
116
+ "Select a topic for \\`#{query}\\` > "
117
+ else
118
+ 'Select a topic > '
119
+ end
112
120
  [
113
121
  '-0',
114
122
  '-1',
@@ -116,7 +124,7 @@ module Howzit
116
124
  "--height=#{height}",
117
125
  '--header="Tab: add selection, ctrl-a/d: (de)select all, return: display/run"',
118
126
  '--bind ctrl-a:select-all,ctrl-d:deselect-all,ctrl-t:toggle-all',
119
- '--prompt="Select a topic > "',
127
+ "--prompt=\"#{prompt}\"",
120
128
  %(--preview="howzit --no-pager --header-format block --no-color --default --multiple first {}")
121
129
  ]
122
130
  end
@@ -125,8 +133,9 @@ module Howzit
125
133
  ## Display a numeric menu on the TTY
126
134
  ##
127
135
  ## @param matches The matches from which to select
136
+ ## @param query [String] The search term to display
128
137
  ##
129
- def tty_menu(matches)
138
+ def tty_menu(matches, query: nil)
130
139
  return matches if matches.count == 1
131
140
 
132
141
  @stty_save = `stty -g`.chomp
@@ -136,6 +145,9 @@ module Howzit
136
145
  exit
137
146
  end
138
147
 
148
+ if query
149
+ puts "\nSelect a topic for `#{query}`:"
150
+ end
139
151
  options_list(matches)
140
152
  read_selection(matches)
141
153
  end
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Howzit
4
+ # Formatter for task run summaries
5
+ module RunReport
6
+ module_function
7
+
8
+ def reset
9
+ Howzit.run_log = []
10
+ end
11
+
12
+ def log(entry)
13
+ Howzit.run_log = [] if Howzit.run_log.nil?
14
+ Howzit.run_log << entry
15
+ end
16
+
17
+ def entries
18
+ Howzit.run_log || []
19
+ end
20
+
21
+ def format
22
+ return '' if entries.empty?
23
+
24
+ lines = entries.map { |entry| format_line(entry, Howzit.multi_topic_run) }
25
+ lines.map! { |line| line.rstrip }
26
+ widths = lines.map { |line| line.uncolor.length }
27
+ width = widths.max
28
+ top = '=' * width
29
+ bottom = '-' * width
30
+ output_lines = [top] + lines + [bottom]
31
+ result = output_lines.join("\n")
32
+ result = result.gsub(/\n[ \t]+\n/, "\n")
33
+ result.gsub(/\n{2,}/, "\n")
34
+ end
35
+
36
+ def format_line(entry, prefix_topic)
37
+ bullet_start = '{mb}- [{x}'
38
+ bullet_end = '{mb}] {x}'
39
+ symbol = entry[:success] ? '{bg}✓{x}' : '{br}X{x}'
40
+ parts = []
41
+ parts << "#{bullet_start}#{symbol}#{bullet_end}"
42
+ parts << "{bl}#{entry[:topic]}{x}: " if prefix_topic && entry[:topic] && !entry[:topic].empty?
43
+ parts << "{by}#{entry[:task]}{x}"
44
+ unless entry[:success]
45
+ reason = entry[:exit_status] ? "exit code #{entry[:exit_status]}" : 'failed'
46
+ parts << " {br}(Failed: #{reason}){x}"
47
+ end
48
+ parts.join.c
49
+ end
50
+ end
51
+ end
@@ -183,7 +183,9 @@ module Howzit
183
183
 
184
184
  # Just strip out color codes when requested
185
185
  def uncolor
186
- gsub(/\e\[[\d;]+m/, '').gsub(/\e\]1337;SetMark/, '')
186
+ # force UTF-8 and remove invalid characters, then remove color codes
187
+ # and iTerm markers
188
+ gsub(Howzit::Color::COLORED_REGEXP, "").gsub(/\e\]1337;SetMark/, "")
187
189
  end
188
190
 
189
191
  # Wrap text at a specified width.
data/lib/howzit/task.rb CHANGED
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'English'
4
+
3
5
  module Howzit
4
6
  # Task object
5
7
  class Task
6
- attr_reader :type, :title, :action, :arguments, :parent, :optional, :default
8
+ attr_reader :type, :title, :action, :arguments, :parent, :optional, :default, :last_status
7
9
 
8
10
  ##
9
11
  ## Initialize a Task object
@@ -31,6 +33,7 @@ module Howzit
31
33
 
32
34
  @optional = optional
33
35
  @default = default
36
+ @last_status = nil
34
37
  end
35
38
 
36
39
  ##
@@ -68,6 +71,7 @@ module Howzit
68
71
  script.unlink
69
72
  end
70
73
 
74
+ update_last_status(res ? 0 : 1)
71
75
  res
72
76
  end
73
77
 
@@ -86,6 +90,7 @@ module Howzit
86
90
  Howzit.console.info("#{@prefix}{by}Running tasks from {bw}#{matches[0].title}{x}".c)
87
91
  output.concat(matches[0].run(nested: true))
88
92
  Howzit.console.info("{by}End include: #{matches[0].tasks.count} tasks{x}".c)
93
+ @last_status = nil
89
94
  [output, matches[0].tasks.count]
90
95
  end
91
96
 
@@ -96,7 +101,9 @@ module Howzit
96
101
  title = Howzit.options[:show_all_code] ? @action : @title
97
102
  Howzit.console.info("#{@prefix}{bg}Running {bw}#{title}{x}".c)
98
103
  ENV['HOWZIT_SCRIPTS'] = File.expand_path('~/.config/howzit/scripts')
99
- system(@action)
104
+ res = system(@action)
105
+ update_last_status(res ? 0 : 1)
106
+ res
100
107
  end
101
108
 
102
109
  ##
@@ -106,6 +113,7 @@ module Howzit
106
113
  title = Howzit.options[:show_all_code] ? @action : @title
107
114
  Howzit.console.info("#{@prefix}{bg}Copied {bw}#{title}{bg} to clipboard{x}".c)
108
115
  Util.os_copy(@action)
116
+ @last_status = 0
109
117
  true
110
118
  end
111
119
 
@@ -127,12 +135,23 @@ module Howzit
127
135
  run_copy
128
136
  when :open
129
137
  Util.os_open(@action)
138
+ @last_status = 0
139
+ true
130
140
  end
131
141
  end
132
142
 
133
143
  [output, tasks, res]
134
144
  end
135
145
 
146
+ def update_last_status(default = nil)
147
+ status = if defined?($CHILD_STATUS) && $CHILD_STATUS
148
+ $CHILD_STATUS.exitstatus
149
+ else
150
+ default
151
+ end
152
+ @last_status = status
153
+ end
154
+
136
155
  ##
137
156
  ## Output terminal-formatted list item
138
157
  ##
data/lib/howzit/topic.rb CHANGED
@@ -104,6 +104,8 @@ module Howzit
104
104
 
105
105
  break unless Howzit.options[:force]
106
106
  end
107
+
108
+ log_task_result(task, success)
107
109
  end
108
110
 
109
111
  total = "{bw}#{@results[:total]}{by} #{@results[:total] == 1 ? 'task' : 'tasks'}".c
@@ -119,7 +121,7 @@ module Howzit
119
121
  Howzit.console.warn "{r}--run: No {br}@directive{xr} found in {bw}#{@title}{x}".c
120
122
  end
121
123
 
122
- output.push(@results[:message]) if Howzit.options[:log_level] < 2 && !nested
124
+ output.push(@results[:message]) if Howzit.options[:log_level] < 2 && !nested && !Howzit.options[:run]
123
125
 
124
126
  puts TTY::Box.frame("{bw}#{@postreqs.join("\n\n").wrap(cols - 4)}{x}".c, width: cols) unless @postreqs.empty?
125
127
 
@@ -324,6 +326,27 @@ module Howzit
324
326
  ##
325
327
  ## @return [Array] array of Task objects
326
328
  ##
329
+ def log_task_result(task, success)
330
+ return unless Howzit.options[:run]
331
+ return if task.type == :include
332
+
333
+ Howzit.run_log ||= []
334
+
335
+ title = (task.title || '').strip
336
+ if title.empty?
337
+ action = (task.action || '').strip
338
+ title = action.split(/\n/).first.to_s.strip
339
+ end
340
+ title = task.type.to_s.capitalize if title.nil? || title.empty?
341
+
342
+ Howzit.run_log << {
343
+ topic: @title,
344
+ task: title,
345
+ success: success ? true : false,
346
+ exit_status: task.last_status
347
+ }
348
+ end
349
+
327
350
  def gather_tasks
328
351
  runnable = []
329
352
  @prereqs = @content.scan(/(?<=@before\n).*?(?=\n@end)/im).map(&:strip)
data/lib/howzit/util.rb CHANGED
@@ -145,7 +145,11 @@ module Howzit
145
145
  end
146
146
 
147
147
  read_io.close
148
- write_io.write(text)
148
+ begin
149
+ write_io.write(text)
150
+ rescue Errno::EPIPE
151
+ # User quit pager before we finished writing, ignore
152
+ end
149
153
  write_io.close
150
154
 
151
155
  _, status = Process.waitpid2(pid)
@@ -3,5 +3,5 @@
3
3
  # Primary module for this gem.
4
4
  module Howzit
5
5
  # Current Howzit version.
6
- VERSION = '2.1.18'
6
+ VERSION = '2.1.21'
7
7
  end
data/lib/howzit.rb CHANGED
@@ -41,6 +41,7 @@ require_relative 'howzit/config'
41
41
  require_relative 'howzit/task'
42
42
  require_relative 'howzit/topic'
43
43
  require_relative 'howzit/buildnote'
44
+ require_relative 'howzit/run_report'
44
45
 
45
46
  require 'tty/screen'
46
47
  require 'tty/box'
@@ -49,7 +50,7 @@ require 'tty/box'
49
50
  # Main module for howzit
50
51
  module Howzit
51
52
  class << self
52
- attr_accessor :arguments, :named_arguments, :cli_args
53
+ attr_accessor :arguments, :named_arguments, :cli_args, :run_log, :multi_topic_run
53
54
 
54
55
  ##
55
56
  ## Holds a Configuration object with methods and a @settings hash
@@ -88,10 +89,18 @@ module Howzit
88
89
  @console ||= Howzit::ConsoleLogger.new(options[:log_level])
89
90
  end
90
91
 
92
+ def run_log
93
+ @run_log ||= []
94
+ end
95
+
96
+ def multi_topic_run
97
+ @multi_topic_run ||= false
98
+ end
99
+
91
100
  def has_read_upstream
92
101
  @has_read_upstream ||= false
93
102
  end
94
103
 
95
- attr_writer :has_read_upstream
104
+ attr_writer :has_read_upstream, :run_log
96
105
  end
97
106
  end
@@ -62,6 +62,12 @@ describe Howzit::BuildNote do
62
62
  expect(matches.count).to eq 0
63
63
  end
64
64
 
65
+ it "matches topics containing colon even without space" do
66
+ matches = how.find_topic('git:clean')
67
+ expect(matches.count).to eq 1
68
+ expect(matches[0].title).to eq 'Git: Clean Repo'
69
+ end
70
+
65
71
  it "Handles multiple matches with best match" do
66
72
  Howzit.options[:matching] = 'fuzzy'
67
73
  Howzit.options[:multiple_matches] = :best
@@ -70,12 +76,62 @@ describe Howzit::BuildNote do
70
76
  end
71
77
  end
72
78
 
79
+ describe ".find_topic_exact" do
80
+ it "finds exact whole-word match" do
81
+ matches = how.find_topic_exact('Topic Tropic')
82
+ expect(matches.count).to eq 1
83
+ expect(matches[0].title).to eq 'Topic Tropic'
84
+ end
85
+
86
+ it "finds exact match case-insensitively" do
87
+ matches = how.find_topic_exact('topic tropic')
88
+ expect(matches.count).to eq 1
89
+ expect(matches[0].title).to eq 'Topic Tropic'
90
+ end
91
+
92
+ it "does not match partial phrases" do
93
+ matches = how.find_topic_exact('topic trop')
94
+ expect(matches.count).to eq 0
95
+ end
96
+
97
+ it "does not match single word when phrase has multiple words" do
98
+ matches = how.find_topic_exact('topic')
99
+ expect(matches.count).to eq 0
100
+ end
101
+
102
+ it "matches single-word topics" do
103
+ matches = how.find_topic_exact('Happy Bgagngagnga')
104
+ expect(matches.count).to eq 1
105
+ expect(matches[0].title).to eq 'Happy Bgagngagnga'
106
+ end
107
+
108
+ it "matches topics with colons" do
109
+ matches = how.find_topic_exact('Git: Clean Repo')
110
+ expect(matches.count).to eq 1
111
+ expect(matches[0].title).to eq 'Git: Clean Repo'
112
+ end
113
+ end
114
+
73
115
  describe ".topics" do
74
- it "contains 4 topics" do
75
- expect(how.list_topics.count).to eq 4
116
+ it "contains 7 topics" do
117
+ expect(how.list_topics.count).to eq 7
76
118
  end
77
119
  it "outputs a newline-separated string for completion" do
78
- expect(how.list_completions.scan(/\n/).count).to eq 3
120
+ expect(how.list_completions.scan(/\n/).count).to eq 6
121
+ end
122
+ end
123
+
124
+ describe "#topic_search_terms_from_cli" do
125
+ after { Howzit.cli_args = [] }
126
+
127
+ it "respects separators found inside topics" do
128
+ Howzit.cli_args = ['git:clean:blog:update post']
129
+ expect(how.send(:topic_search_terms_from_cli)).to eq(['git:clean', 'blog:update post'])
130
+ end
131
+
132
+ it "keeps comma inside matching topics" do
133
+ Howzit.cli_args = ['release, deploy,topic balogna']
134
+ expect(how.send(:topic_search_terms_from_cli)).to eq(['release, deploy', 'topic balogna'])
79
135
  end
80
136
  end
81
137
  end
data/spec/cli_spec.rb CHANGED
@@ -15,7 +15,7 @@ describe 'CLI' do
15
15
  execute_script('bin/howzit', use_bundler: true, args: %w[-L])
16
16
  expect(last_execution).to be_successful
17
17
  expect(last_execution.stdout).to match(/Topic Balogna/)
18
- expect(last_execution.stdout.split(/\n/).count).to eq 4
18
+ expect(last_execution.stdout.split(/\n/).count).to eq 7
19
19
  end
20
20
 
21
21
  it 'lists available tasks' do
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Howzit::RunReport do
6
+ before do
7
+ Howzit.run_log = []
8
+ Howzit.multi_topic_run = false
9
+ end
10
+
11
+ after do
12
+ Howzit::RunReport.reset
13
+ Howzit.multi_topic_run = false
14
+ end
15
+
16
+ it 'renders a bordered summary for single topic runs' do
17
+ Howzit::RunReport.log({ topic: 'Git: Config', task: 'Run Git Origin', success: true, exit_status: 0 })
18
+ plain = Howzit::RunReport.format.uncolor
19
+ expect(plain).to include('- [✓] Run Git Origin')
20
+ expect(plain).not_to include('Git: Config:')
21
+ top, line, bottom = plain.split("\n")
22
+ expect(top).to eq('=' * line.length)
23
+ expect(bottom).to eq('-' * line.length)
24
+ end
25
+
26
+ it 'prefixes topic titles and shows failures when multiple topics run' do
27
+ Howzit.multi_topic_run = true
28
+ Howzit::RunReport.log({ topic: 'Git: Config', task: 'Run Git Origin', success: true, exit_status: 0 })
29
+ Howzit::RunReport.log({ topic: 'Git: Clean Repo', task: 'Clean Git Repo', success: false, exit_status: 12 })
30
+ plain = Howzit::RunReport.format.uncolor
31
+ expect(plain).to include('- [✓] Git: Config: Run Git Origin')
32
+ expect(plain).to include('- [X] Git: Clean Repo: Clean Git Repo (Failed: exit code 12)')
33
+ end
34
+ end
35
+
data/spec/spec_helper.rb CHANGED
@@ -18,6 +18,8 @@ RSpec.configure do |c|
18
18
  save_buildnote
19
19
  Howzit.options[:include_upstream] = false
20
20
  Howzit.options[:default] = true
21
+ Howzit.options[:matching] = 'partial'
22
+ Howzit.options[:multiple_matches] = 'choose'
21
23
  @hz = Howzit.buildnote
22
24
  end
23
25
 
@@ -67,6 +69,18 @@ def save_buildnote
67
69
  ## Happy Bgagngagnga
68
70
 
69
71
  This one is just to throw things off
72
+
73
+ ## Git: Clean Repo
74
+
75
+ Keep Git projects tidy.
76
+
77
+ ## Blog: Update Post
78
+
79
+ Publish the latest article updates.
80
+
81
+ ## Release, Deploy
82
+
83
+ Prep and deploy the latest release.
70
84
  EONOTE
71
85
  File.open('builda.md', 'w') { |f| f.puts note }
72
86
  # puts "Saved to builda.md: #{File.exist?('builda.md')}"
data/spec/topic_spec.rb CHANGED
@@ -82,8 +82,11 @@ describe Howzit::Topic do
82
82
  end
83
83
 
84
84
  describe '.print_out' do
85
- Howzit.options[:header_format] = :block
86
- Howzit.options[:color] = false
85
+ before do
86
+ Howzit.options[:header_format] = :block
87
+ Howzit.options[:color] = false
88
+ Howzit.options[:show_all_code] = false
89
+ end
87
90
 
88
91
  it 'prints the topic title' do
89
92
  expect(topic.print_out({ single: true, header: true }).join("\n").uncolor).to match(/▌Topic Balogna/)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: howzit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.18
4
+ version: 2.1.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-01 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bundler
@@ -275,15 +275,6 @@ executables:
275
275
  extensions: []
276
276
  extra_rdoc_files: []
277
277
  files:
278
- - ".editorconfig"
279
- - ".github/FUNDING.yml"
280
- - ".gitignore"
281
- - ".howzit.taskpaper.bak"
282
- - ".irbrc"
283
- - ".rspec"
284
- - ".rubocop.yml"
285
- - ".travis.yml"
286
- - ".yardopts"
287
278
  - CHANGELOG.md
288
279
  - Gemfile
289
280
  - Guardfile
@@ -304,7 +295,6 @@ files:
304
295
  - fish/completions/howzit.fish
305
296
  - fish/functions/bld.fish
306
297
  - howzit.gemspec
307
- - lib/.rubocop.yml
308
298
  - lib/howzit.rb
309
299
  - lib/howzit/buildnote.rb
310
300
  - lib/howzit/colors.rb
@@ -312,17 +302,18 @@ files:
312
302
  - lib/howzit/console_logger.rb
313
303
  - lib/howzit/hash.rb
314
304
  - lib/howzit/prompt.rb
305
+ - lib/howzit/run_report.rb
315
306
  - lib/howzit/stringutils.rb
316
307
  - lib/howzit/task.rb
317
308
  - lib/howzit/topic.rb
318
309
  - lib/howzit/util.rb
319
310
  - lib/howzit/version.rb
320
311
  - scripts/runtests.sh
321
- - spec/.rubocop.yml
322
312
  - spec/buildnote_spec.rb
323
313
  - spec/cli_spec.rb
324
314
  - spec/prompt_spec.rb
325
315
  - spec/ruby_gem_spec.rb
316
+ - spec/run_report_spec.rb
326
317
  - spec/spec_helper.rb
327
318
  - spec/task_spec.rb
328
319
  - spec/topic_spec.rb
@@ -347,16 +338,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
338
  - !ruby/object:Gem::Version
348
339
  version: '0'
349
340
  requirements: []
350
- rubygems_version: 3.6.2
341
+ rubygems_version: 3.6.7
351
342
  specification_version: 4
352
343
  summary: Provides a way to access Markdown project notes by topic with query capabilities
353
344
  and the ability to execute the tasks it describes.
354
345
  test_files:
355
- - spec/.rubocop.yml
356
346
  - spec/buildnote_spec.rb
357
347
  - spec/cli_spec.rb
358
348
  - spec/prompt_spec.rb
359
349
  - spec/ruby_gem_spec.rb
350
+ - spec/run_report_spec.rb
360
351
  - spec/spec_helper.rb
361
352
  - spec/task_spec.rb
362
353
  - spec/topic_spec.rb
data/.editorconfig DELETED
@@ -1,9 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- charset = utf-8
5
- end_of_line = lf
6
- insert_final_newline = true
7
- trim_trailing_whitespace = true
8
- indent_style = space
9
- indent_size = 2
data/.github/FUNDING.yml DELETED
@@ -1,2 +0,0 @@
1
- github: [ttscoff]
2
- custom: ['https://brettterpstra.com/support/', 'https://brettterpstra.com/donate/']
data/.gitignore DELETED
@@ -1,45 +0,0 @@
1
- # Parts of this file were adapted from
2
- # GitHub’s collection of .gitignore file templates
3
- # which are Copyright (c) 2016 GitHub, Inc.
4
- # and released under the MIT License.
5
- # For more details, visit the project page:
6
- # https://github.com/github/gitignore
7
-
8
- *.gem
9
- *.rbc
10
- /.config
11
- /coverage/
12
- /InstalledFiles
13
- /pkg/
14
- /spec/reports/
15
- /spec/examples.txt
16
- /test/tmp/
17
- /test/version_tmp/
18
- /tmp/
19
-
20
- ## Specific to RubyMotion:
21
- .dat*
22
- .repl_history
23
- build/
24
-
25
- ## Documentation cache and generated files:
26
- /.yardoc/
27
- /_yardoc/
28
- /doc/
29
- /rdoc/
30
-
31
- ## Environment normalization:
32
- /.bundle/
33
- /vendor/bundle
34
- /lib/bundler/man/
35
-
36
- # for a library or gem, you might want to ignore these files since the code is
37
- # intended to run in multiple environments; otherwise, check them in:
38
- Gemfile.lock
39
- .ruby-version
40
- .ruby-gemset
41
-
42
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
43
- .rvmrc
44
- results.log
45
- html
@@ -1,27 +0,0 @@
1
- Inbox:
2
- - Topic summaries @na
3
- Maybe in square brackets on line after topic title, or as a blockquote. When doing a list of available topics, include its summary in the output. Ignore or specially style summary when viewing full topic.
4
- - Named positional arguments for topics @na
5
- Parenthesis after title like a function (arg1, arg2). Variables can have default values (arg1 = testing) and are available as [%var1] replacements in scripts
6
- howzit:
7
- New Features:
8
- Ideas:
9
- - Nested topics @maybe @na
10
- Allow increased header levels to nest topics within a parent
11
- Running/viewing a parent includes all nested subtopics
12
- All topics still available via search
13
- When reading file, set a base level from first header, then test each additional topic title to see whether it's greater than the current level. If so, change current level and begin collecting subtopics at the same level
14
- Howzit::Topic has a subtopic attribute, consisting of an array of Topics. Each of these Topics also has a subtopics attr. These are collected and assigned during initila reading of note file
15
- When read in, a topic is added to the top level build notes topic, as well as appended to its parent's subtopics if it's a higher level than the base
16
- just need methods to determine base level (first # match) and check the current headers level when discovering a topic (count #)
17
-
18
- no, wait. topics should read in their own children. Determine base header level, split topics at that level, then recurse each topic the same way
19
- include statements will need to be adjusted to allow includes as children. Multiple at symbols could indicate the level to nest at, two symbols would indicate that the include belonged to the last parent. When importing, adjust base header levels appropriately (increase 1).
20
- Bugs:
21
- Archive:
22
- - Add a preview when selecting topic with fzf @priority(3) @na @done(2022-08-06) @project(Inbox)
23
- Search Definitions:
24
- Top Priority @search(@priority = 5 and not @done)
25
- High Priority @search(@priority > 3 and not @done)
26
- Maybe @search(@maybe)
27
- Next @search(@na and not @done and not project = "Archive")
data/.irbrc DELETED
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
- IRB.conf[:AUTO_INDENT] = true
3
-
4
- require "irb/completion"
5
- require_relative "lib/conductor"
6
-
7
- # rubocop:disable Style/MixinUsage
8
- include Howzit # standard:disable all
9
- # rubocop:enable Style/MixinUsage
10
-
11
- require "awesome_print"
12
- AwesomePrint.irb!
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color