markdown_exec 1.8.7 → 1.8.9
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +41 -3
- data/Gemfile +1 -0
- data/Gemfile.lock +7 -1
- data/Rakefile +1 -0
- data/bin/bmde +1 -1
- data/bin/tab_completion.sh +4 -4
- data/examples/colors.md +2 -1
- data/examples/indent.md +66 -0
- data/examples/linked.md +76 -27
- data/examples/load1.sh +5 -0
- data/examples/load2.sh +5 -0
- data/examples/nickname.md +26 -0
- data/lib/array.rb +4 -0
- data/lib/cached_nested_file_reader.rb +47 -43
- data/lib/ce_get_cost_and_usage.rb +22 -0
- data/lib/constants.rb +12 -0
- data/lib/exceptions.rb +6 -4
- data/lib/fcb.rb +5 -2
- data/lib/filter.rb +6 -8
- data/lib/find_files.rb +99 -0
- data/lib/hash_delegator.rb +1056 -781
- data/lib/markdown_exec/version.rb +1 -1
- data/lib/mdoc.rb +27 -28
- data/lib/menu.src.yml +114 -17
- data/lib/menu.yml +85 -7
- metadata +8 -6
- data/lib/method_sorter.rb +0 -78
- data/lib/pty1.rb +0 -26
- data/lib/regexp_replacer.rb +0 -58
- data/lib/sort_yaml_gpt4.rb +0 -32
data/lib/mdoc.rb
CHANGED
|
@@ -76,15 +76,18 @@ module MarkdownExec
|
|
|
76
76
|
raise "Named code block `#{name}` not found. (@#{__LINE__})"
|
|
77
77
|
end
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
nickname = name_block[:nickname] || name_block[:oname]
|
|
80
|
+
dependencies = collect_dependencies(nickname)
|
|
80
81
|
# &bc 'dependencies.count:',dependencies.count
|
|
81
|
-
all_dependency_names = collect_unique_names(dependencies).push(
|
|
82
|
+
all_dependency_names = collect_unique_names(dependencies).push(nickname).uniq
|
|
82
83
|
# &bc 'all_dependency_names.count:',all_dependency_names.count
|
|
83
84
|
|
|
84
85
|
# select non-chrome blocks in order of appearance in source documents
|
|
85
86
|
#
|
|
86
87
|
blocks = @table.select do |fcb|
|
|
87
|
-
!fcb.fetch(:chrome,
|
|
88
|
+
!fcb.fetch(:chrome,
|
|
89
|
+
false) && all_dependency_names.include?(fcb.fetch(:nickname,
|
|
90
|
+
nil) || fcb.fetch(:oname))
|
|
88
91
|
end
|
|
89
92
|
# &bc 'blocks.count:',blocks.count
|
|
90
93
|
|
|
@@ -92,9 +95,9 @@ module MarkdownExec
|
|
|
92
95
|
#
|
|
93
96
|
unmet_dependencies = all_dependency_names.dup
|
|
94
97
|
blocks = blocks.map do |fcb|
|
|
95
|
-
unmet_dependencies.delete(fcb[:oname]) # may not exist if block name is duplicated
|
|
98
|
+
unmet_dependencies.delete(fcb[:nickname] || fcb[:oname]) # may not exist if block name is duplicated
|
|
96
99
|
if (call = fcb[:call])
|
|
97
|
-
[
|
|
100
|
+
[get_block_by_anyname("[#{call.match(/^%\((\S+) |\)/)[1]}]")
|
|
98
101
|
.merge({ cann: call })]
|
|
99
102
|
else
|
|
100
103
|
[]
|
|
@@ -121,7 +124,7 @@ module MarkdownExec
|
|
|
121
124
|
# &bc 'blocks.count:',blocks.count
|
|
122
125
|
|
|
123
126
|
block_search.merge(
|
|
124
|
-
{ block_names: blocks.map { |block| block[:oname] },
|
|
127
|
+
{ block_names: blocks.map { |block| block[:nickname] || block[:oname] },
|
|
125
128
|
code: blocks.map do |fcb|
|
|
126
129
|
if fcb[:cann]
|
|
127
130
|
collect_block_code_cann(fcb)
|
|
@@ -133,11 +136,12 @@ module MarkdownExec
|
|
|
133
136
|
elsif fcb[:shell] == BlockType::PORT
|
|
134
137
|
collect_block_code_shell(fcb)
|
|
135
138
|
elsif label_body
|
|
139
|
+
block_name_for_bash_comment = (fcb[:nickname] || fcb[:oname]).gsub(/\s+/, '_')
|
|
136
140
|
[label_format_above && format(label_format_above,
|
|
137
|
-
block_source.merge({ block_name:
|
|
141
|
+
block_source.merge({ block_name: block_name_for_bash_comment }))] +
|
|
138
142
|
fcb[:body] +
|
|
139
143
|
[label_format_below && format(label_format_below,
|
|
140
|
-
block_source.merge({ block_name:
|
|
144
|
+
block_source.merge({ block_name: block_name_for_bash_comment }))]
|
|
141
145
|
else # raw body
|
|
142
146
|
fcb[:body]
|
|
143
147
|
end
|
|
@@ -194,9 +198,15 @@ module MarkdownExec
|
|
|
194
198
|
|
|
195
199
|
### hide rows correctly
|
|
196
200
|
|
|
201
|
+
if !options[:menu_include_imported_blocks]
|
|
202
|
+
selrows = selrows.reject do |block|
|
|
203
|
+
block.fetch(:depth, 0).positive?
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
|
|
197
207
|
if opts[:hide_blocks_by_name]
|
|
198
208
|
selrows = selrows.reject do |block|
|
|
199
|
-
|
|
209
|
+
hide_menu_block_on_name opts, block
|
|
200
210
|
end
|
|
201
211
|
end
|
|
202
212
|
|
|
@@ -216,19 +226,8 @@ module MarkdownExec
|
|
|
216
226
|
#
|
|
217
227
|
def get_block_by_anyname(name, default = {})
|
|
218
228
|
@table.select do |fcb|
|
|
219
|
-
fcb.fetch(:
|
|
220
|
-
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
def get_block_by_dname(name, default = {})
|
|
224
|
-
@table.select do |fcb|
|
|
225
|
-
fcb.fetch(:dname, '') == name
|
|
226
|
-
end.fetch(0, default)
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
def get_block_by_oname(name, default = {})
|
|
230
|
-
@table.select do |fcb|
|
|
231
|
-
fcb.fetch(:oname, '') == name
|
|
229
|
+
fcb.fetch(:nickname,
|
|
230
|
+
'') == name || fcb.fetch(:dname, '') == name || fcb.fetch(:oname, '') == name
|
|
232
231
|
end.fetch(0, default)
|
|
233
232
|
end
|
|
234
233
|
|
|
@@ -239,7 +238,7 @@ module MarkdownExec
|
|
|
239
238
|
# @return [Boolean] True if the code block should be hidden; false otherwise.
|
|
240
239
|
#
|
|
241
240
|
# :reek:UtilityFunction
|
|
242
|
-
def
|
|
241
|
+
def hide_menu_block_on_name(opts, block)
|
|
243
242
|
if block.fetch(:chrome, false)
|
|
244
243
|
false
|
|
245
244
|
else
|
|
@@ -270,7 +269,7 @@ module MarkdownExec
|
|
|
270
269
|
next if memo.include? req
|
|
271
270
|
|
|
272
271
|
memo += [req]
|
|
273
|
-
|
|
272
|
+
get_block_by_anyname(req).fetch(:reqs, [])
|
|
274
273
|
end
|
|
275
274
|
.compact
|
|
276
275
|
.flatten(1)
|
|
@@ -445,10 +444,10 @@ if $PROGRAM_NAME == __FILE__
|
|
|
445
444
|
# end
|
|
446
445
|
|
|
447
446
|
def test_get_block_by_name
|
|
448
|
-
result = @doc.
|
|
447
|
+
result = @doc.get_block_by_anyname('block1')
|
|
449
448
|
assert_equal @table[0], result
|
|
450
449
|
|
|
451
|
-
result_missing = @doc.
|
|
450
|
+
result_missing = @doc.get_block_by_anyname('missing_block')
|
|
452
451
|
assert_equal({}, result_missing)
|
|
453
452
|
end
|
|
454
453
|
|
|
@@ -463,11 +462,11 @@ if $PROGRAM_NAME == __FILE__
|
|
|
463
462
|
end
|
|
464
463
|
end
|
|
465
464
|
|
|
466
|
-
def
|
|
465
|
+
def test_hide_menu_block_on_name
|
|
467
466
|
opts = { hide_blocks_by_name: true,
|
|
468
467
|
block_name_hidden_match: 'block1' }
|
|
469
468
|
block = FCB.new(oname: 'block1')
|
|
470
|
-
result = @doc.
|
|
469
|
+
result = @doc.hide_menu_block_on_name(opts, block)
|
|
471
470
|
assert result # this should be true based on the given logic
|
|
472
471
|
end
|
|
473
472
|
|
data/lib/menu.src.yml
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
- :description: Show current configuration values
|
|
3
3
|
:procname: show_config
|
|
4
|
-
:short_name:
|
|
4
|
+
:short_name: '0'
|
|
5
5
|
|
|
6
6
|
- :arg_name: BOOL
|
|
7
|
-
:default:
|
|
7
|
+
:default: true
|
|
8
8
|
:description: Display only blocks of type "bash"
|
|
9
9
|
:env_var: MDE_BASH_ONLY
|
|
10
10
|
:opt_name: bash_only
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
:opt_name: block_name_hidden_match
|
|
31
31
|
:procname: val_as_str
|
|
32
32
|
|
|
33
|
-
- :default: "
|
|
33
|
+
- :default: "^\\(.*\\)$"
|
|
34
34
|
:description: Pattern for blocks to hide from user-selection
|
|
35
35
|
:env_var: MDE_BLOCK_NAME_INCLUDE_MATCH
|
|
36
36
|
:opt_name: block_name_include_match
|
|
@@ -41,6 +41,12 @@
|
|
|
41
41
|
:opt_name: block_name_match
|
|
42
42
|
:procname: val_as_str
|
|
43
43
|
|
|
44
|
+
- :default: "^\\[.*\\]$"
|
|
45
|
+
:description: Pattern for block nicknames (name is not used in menu)
|
|
46
|
+
:env_var: MDE_BLOCK_NAME_NICK_MATCH
|
|
47
|
+
:opt_name: block_name_nick_match
|
|
48
|
+
:procname: val_as_str
|
|
49
|
+
|
|
44
50
|
- :default: "^{.+}$"
|
|
45
51
|
:description: Pattern for block names to use as wrappers
|
|
46
52
|
:env_var: MDE_BLOCK_NAME_WRAPPER_MATCH
|
|
@@ -73,6 +79,13 @@
|
|
|
73
79
|
:long_name: config
|
|
74
80
|
:procname: path
|
|
75
81
|
|
|
82
|
+
- :arg_name: BOOL
|
|
83
|
+
:default: true
|
|
84
|
+
:description: debounce_execution
|
|
85
|
+
:env_var: MDE_debounce_execution
|
|
86
|
+
:opt_name: debounce_execution
|
|
87
|
+
:procname: val_as_bool
|
|
88
|
+
|
|
76
89
|
- :arg_name: BOOL
|
|
77
90
|
:default: false
|
|
78
91
|
:description: Debug output
|
|
@@ -177,6 +190,53 @@
|
|
|
177
190
|
:opt_name: exclude_expect_blocks
|
|
178
191
|
:procname: val_as_bool
|
|
179
192
|
|
|
193
|
+
- :default: >
|
|
194
|
+
osascript -e '
|
|
195
|
+
tell application "iTerm"
|
|
196
|
+
tell application "System Events"
|
|
197
|
+
tell application "Finder"
|
|
198
|
+
set {posx, posy, screenWidth, screenHeight} to bounds of window of desktop
|
|
199
|
+
end tell
|
|
200
|
+
tell application process "Finder"
|
|
201
|
+
set {missing value, menubarHeight} to the size of menu bar 1
|
|
202
|
+
end tell
|
|
203
|
+
end tell
|
|
204
|
+
|
|
205
|
+
set winHeight to (screenHeight * 2 / 3)
|
|
206
|
+
set winWidth to (screenWidth / 2)
|
|
207
|
+
set xoff to menubarHeight * %{batch_index}
|
|
208
|
+
set yoff to xoff mod (screenHeight - winHeight)
|
|
209
|
+
|
|
210
|
+
create window with default profile
|
|
211
|
+
tell the first window
|
|
212
|
+
set bounds to {xoff, yoff, xoff + winWidth, yoff + winHeight}
|
|
213
|
+
tell the current session
|
|
214
|
+
write text "# %{script_filespec}"
|
|
215
|
+
write text "# %{output_filespec}"
|
|
216
|
+
write text "echo -ne \"\\033]; %{started_at} - %{document_filename} - %{block_name} \\007\""
|
|
217
|
+
write text "cd \"%{home}\""
|
|
218
|
+
write text "\"%{script_filename}\" | tee \"%{output_filespec}\""
|
|
219
|
+
end tell
|
|
220
|
+
end tell
|
|
221
|
+
end tell'
|
|
222
|
+
:description: execute_command_format
|
|
223
|
+
:env_var: MDE_EXECUTE_COMMAND_FORMAT
|
|
224
|
+
:opt_name: execute_command_format
|
|
225
|
+
:procname: val_as_str
|
|
226
|
+
|
|
227
|
+
- :default: "%T"
|
|
228
|
+
:description: Format for time in window title
|
|
229
|
+
:env_var: MDE_EXECUTE_COMMAND_TITLE_TIME_FORMAT
|
|
230
|
+
:opt_name: execute_command_title_time_format
|
|
231
|
+
:procname: val_as_str
|
|
232
|
+
|
|
233
|
+
- :arg_name: BOOL
|
|
234
|
+
:default: true
|
|
235
|
+
:description: Execute script in own window
|
|
236
|
+
:env_var: MDE_EXECUTE_IN_OWN_WINDOW
|
|
237
|
+
:opt_name: execute_in_own_window
|
|
238
|
+
:procname: val_as_bool
|
|
239
|
+
|
|
180
240
|
- :default: fg_rgbh_7f_ff_00
|
|
181
241
|
:description: execution_report_preview_frame_color
|
|
182
242
|
:env_var: MDE_EXECUTION_REPORT_PREVIEW_FRAME_COLOR
|
|
@@ -224,14 +284,14 @@
|
|
|
224
284
|
:short_name: f
|
|
225
285
|
|
|
226
286
|
- :arg_name: FIND
|
|
227
|
-
:default:
|
|
287
|
+
:default: ''
|
|
228
288
|
:description: Find in documents
|
|
229
289
|
:long_name: find
|
|
230
290
|
:procname: find
|
|
231
291
|
:short_name: "?"
|
|
232
292
|
|
|
233
293
|
- :arg_name: FIND_PATH
|
|
234
|
-
:default:
|
|
294
|
+
:default: ''
|
|
235
295
|
:description: Path for find (uses PATH if empty)
|
|
236
296
|
:env_var: MDE_FIND_PATH
|
|
237
297
|
:long_name: find-path
|
|
@@ -278,12 +338,17 @@
|
|
|
278
338
|
:procname: val_as_str
|
|
279
339
|
|
|
280
340
|
- :arg_name: HOW
|
|
281
|
-
:default:
|
|
341
|
+
:default: ''
|
|
282
342
|
:description: Find in YAML configuration options
|
|
283
343
|
:long_name: how
|
|
284
344
|
:procname: how
|
|
285
345
|
:short_name: "?"
|
|
286
346
|
|
|
347
|
+
- :default:
|
|
348
|
+
:env_var: MDE_IMPORT_PATHS
|
|
349
|
+
:opt_name: import_paths
|
|
350
|
+
:procname: val_as_str
|
|
351
|
+
|
|
287
352
|
- :default: "^ *@import +(?<name>.+?) *$"
|
|
288
353
|
:env_var: MDE_IMPORT_PATTERN
|
|
289
354
|
:opt_name: import_pattern
|
|
@@ -455,7 +520,7 @@
|
|
|
455
520
|
:opt_name: menu_heading3_format
|
|
456
521
|
:procname: val_as_str
|
|
457
522
|
|
|
458
|
-
- :default:
|
|
523
|
+
- :default: '0'
|
|
459
524
|
:description: Import levels for blocks to appear in menu. Empty is all.
|
|
460
525
|
:env_var: MDE_MENU_IMPORT_LEVEL_MATCH
|
|
461
526
|
:opt_name: menu_import_level_match
|
|
@@ -496,7 +561,7 @@
|
|
|
496
561
|
:procname: val_as_str
|
|
497
562
|
|
|
498
563
|
- :default:
|
|
499
|
-
:line:
|
|
564
|
+
:line: ''
|
|
500
565
|
:description: opening demarcation for menu
|
|
501
566
|
:env_var: MDE_MENU_INITIAL_DIVIDER
|
|
502
567
|
:opt_name: menu_initial_divider
|
|
@@ -642,6 +707,26 @@
|
|
|
642
707
|
:opt_name: no_chrome
|
|
643
708
|
:procname: val_as_bool
|
|
644
709
|
|
|
710
|
+
- :default:
|
|
711
|
+
:description: Expression to match to start collecting lines
|
|
712
|
+
:env_var: MDE_OUTPUT_ASSIGNMENT_BEGIN
|
|
713
|
+
:opt_name: output_assignment_begin
|
|
714
|
+
:procname: val_as_str
|
|
715
|
+
- :default:
|
|
716
|
+
:description: Expression to match to stop collecting lines
|
|
717
|
+
:env_var: MDE_OUTPUT_ASSIGNMENT_END
|
|
718
|
+
:opt_name: output_assignment_begin
|
|
719
|
+
:procname: val_as_str
|
|
720
|
+
- :default: "%{line} # !!!"
|
|
721
|
+
:description: Format for assignments from output
|
|
722
|
+
:env_var: MDE_OUTPUT_ASSIGNMENT_FORMAT
|
|
723
|
+
:opt_name: output_assignment_format
|
|
724
|
+
:procname: val_as_str
|
|
725
|
+
- :default: "^ *(?<line>\\w+=.*?) *$"
|
|
726
|
+
:description: Pattern for assignments from output
|
|
727
|
+
:env_var: MDE_OUTPUT_ASSIGNMENT_MATCH
|
|
728
|
+
:opt_name: output_assignment_match
|
|
729
|
+
:procname: val_as_str
|
|
645
730
|
- :arg_name: BOOL
|
|
646
731
|
:default: false
|
|
647
732
|
:description: Display summary for execution
|
|
@@ -706,7 +791,7 @@
|
|
|
706
791
|
:short_name: p
|
|
707
792
|
|
|
708
793
|
- :arg_name: BOOL
|
|
709
|
-
:default:
|
|
794
|
+
:default: false
|
|
710
795
|
:description: Wheter to pause after manually executing a block and the next menu
|
|
711
796
|
:env_var: MDE_PAUSE_AFTER_SCRIPT_EXECUTION
|
|
712
797
|
:opt_name: pause_after_script_execution
|
|
@@ -730,13 +815,19 @@
|
|
|
730
815
|
:opt_name: prompt_color_after_script_execution
|
|
731
816
|
:procname: val_as_str
|
|
732
817
|
|
|
818
|
+
- :default: "\nRepeat this block?"
|
|
819
|
+
:description: Prompt to debounce
|
|
820
|
+
:env_var: MDE_PROMPT_DEBOUNCE
|
|
821
|
+
:opt_name: prompt_debounce
|
|
822
|
+
:procname: val_as_str
|
|
823
|
+
|
|
733
824
|
- :default: Exit
|
|
734
825
|
:description: Prompt to exit app
|
|
735
826
|
:env_var: MDE_PROMPT_EXIT
|
|
736
827
|
:opt_name: prompt_exit
|
|
737
828
|
:procname: val_as_str
|
|
738
829
|
|
|
739
|
-
- :default:
|
|
830
|
+
- :default: 'No'
|
|
740
831
|
:description: Prompt for no
|
|
741
832
|
:env_var: MDE_PROMPT_NO
|
|
742
833
|
:opt_name: prompt_no
|
|
@@ -772,7 +863,13 @@
|
|
|
772
863
|
:opt_name: prompt_select_output
|
|
773
864
|
:procname: val_as_str
|
|
774
865
|
|
|
775
|
-
- :default:
|
|
866
|
+
- :default: Uninterrupted
|
|
867
|
+
:description: Uninterrupted execution
|
|
868
|
+
:env_var: MDE_PROMPT_UNINTERRUPTED
|
|
869
|
+
:opt_name: prompt_uninterrupted
|
|
870
|
+
:procname: val_as_str
|
|
871
|
+
|
|
872
|
+
- :default: 'Yes'
|
|
776
873
|
:description: Prompt for yes
|
|
777
874
|
:env_var: MDE_PROMPT_YES
|
|
778
875
|
:opt_name: prompt_yes
|
|
@@ -789,7 +886,7 @@
|
|
|
789
886
|
:procname: val_as_bool
|
|
790
887
|
|
|
791
888
|
- :default: 1
|
|
792
|
-
:description:
|
|
889
|
+
:description: Runtime exception error level (warn if < 0, ignore if 0, abort if > 0)
|
|
793
890
|
:env_var: MDE_RUNTIME_EXCEPTION_ERROR_LEVEL
|
|
794
891
|
:opt_name: runtime_exception_error_level
|
|
795
892
|
:procname: val_as_int
|
|
@@ -917,7 +1014,7 @@
|
|
|
917
1014
|
:procname: val_as_str
|
|
918
1015
|
|
|
919
1016
|
- :default: 36
|
|
920
|
-
:description:
|
|
1017
|
+
:description: 'Maximum # of rows in select list'
|
|
921
1018
|
:env_var: MDE_SELECT_PAGE_HEIGHT
|
|
922
1019
|
:opt_name: select_page_height
|
|
923
1020
|
:procname: val_as_int
|
|
@@ -944,13 +1041,13 @@
|
|
|
944
1041
|
:opt_name: shell
|
|
945
1042
|
:procname: val_as_str
|
|
946
1043
|
|
|
947
|
-
- :default: "# -^-
|
|
1044
|
+
- :default: "# -^-"
|
|
948
1045
|
:description: shell_code_label_format_above
|
|
949
1046
|
:env_var: MDE_SHELL_CODE_LABEL_FORMAT_ABOVE
|
|
950
1047
|
:opt_name: shell_code_label_format_above
|
|
951
1048
|
:procname: val_as_str
|
|
952
1049
|
|
|
953
|
-
- :default: "# -v- +%{block_name} -v-"
|
|
1050
|
+
- :default: "# -v- +%{block_name} -o- %{document_filename} -v-"
|
|
954
1051
|
:description: shell_code_label_format_below
|
|
955
1052
|
:env_var: MDE_SHELL_CODE_LABEL_FORMAT_BELOW
|
|
956
1053
|
:opt_name: shell_code_label_format_below
|
|
@@ -962,7 +1059,7 @@
|
|
|
962
1059
|
:procname: val_as_bool
|
|
963
1060
|
|
|
964
1061
|
- :arg_name: BOOL
|
|
965
|
-
:default:
|
|
1062
|
+
:default: false
|
|
966
1063
|
:description: Requires user approval before executing a script
|
|
967
1064
|
:env_var: MDE_USER_MUST_APPROVE
|
|
968
1065
|
:long_name: user-must-approve
|
|
@@ -981,7 +1078,7 @@
|
|
|
981
1078
|
:opt_name: warning_color
|
|
982
1079
|
:procname: val_as_str
|
|
983
1080
|
|
|
984
|
-
- :default:
|
|
1081
|
+
- :default: 'Error: %{error}'
|
|
985
1082
|
:description: Format of warning message
|
|
986
1083
|
:env_var: MDE_WARNING_FORMAT
|
|
987
1084
|
:opt_name: warning_format
|
data/lib/menu.yml
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# MDE - Markdown Executor (1.8.
|
|
1
|
+
# MDE - Markdown Executor (1.8.9)
|
|
2
2
|
---
|
|
3
3
|
- :description: Show current configuration values
|
|
4
4
|
:procname: show_config
|
|
5
5
|
:short_name: '0'
|
|
6
6
|
- :arg_name: BOOL
|
|
7
|
-
:default:
|
|
7
|
+
:default: true
|
|
8
8
|
:description: Display only blocks of type "bash"
|
|
9
9
|
:env_var: MDE_BASH_ONLY
|
|
10
10
|
:opt_name: bash_only
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
:env_var: MDE_BLOCK_NAME_HIDDEN_MATCH
|
|
27
27
|
:opt_name: block_name_hidden_match
|
|
28
28
|
:procname: val_as_str
|
|
29
|
-
- :default: "
|
|
29
|
+
- :default: "^\\(.*\\)$"
|
|
30
30
|
:description: Pattern for blocks to hide from user-selection
|
|
31
31
|
:env_var: MDE_BLOCK_NAME_INCLUDE_MATCH
|
|
32
32
|
:opt_name: block_name_include_match
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
:env_var: MDE_BLOCK_NAME_MATCH
|
|
36
36
|
:opt_name: block_name_match
|
|
37
37
|
:procname: val_as_str
|
|
38
|
+
- :default: "^\\[.*\\]$"
|
|
39
|
+
:description: Pattern for block nicknames (name is not used in menu)
|
|
40
|
+
:env_var: MDE_BLOCK_NAME_NICK_MATCH
|
|
41
|
+
:opt_name: block_name_nick_match
|
|
42
|
+
:procname: val_as_str
|
|
38
43
|
- :default: "^{.+}$"
|
|
39
44
|
:description: Pattern for block names to use as wrappers
|
|
40
45
|
:env_var: MDE_BLOCK_NAME_WRAPPER_MATCH
|
|
@@ -61,6 +66,12 @@
|
|
|
61
66
|
:description: Read configuration file
|
|
62
67
|
:long_name: config
|
|
63
68
|
:procname: path
|
|
69
|
+
- :arg_name: BOOL
|
|
70
|
+
:default: true
|
|
71
|
+
:description: debounce_execution
|
|
72
|
+
:env_var: MDE_debounce_execution
|
|
73
|
+
:opt_name: debounce_execution
|
|
74
|
+
:procname: val_as_bool
|
|
64
75
|
- :arg_name: BOOL
|
|
65
76
|
:default: false
|
|
66
77
|
:description: Debug output
|
|
@@ -152,6 +163,37 @@
|
|
|
152
163
|
:env_var: MDE_EXCLUDE_EXPECT_BLOCKS
|
|
153
164
|
:opt_name: exclude_expect_blocks
|
|
154
165
|
:procname: val_as_bool
|
|
166
|
+
- :default: "osascript -e '\n tell application \"iTerm\"\n tell application
|
|
167
|
+
\"System Events\"\n tell application \"Finder\"\n set
|
|
168
|
+
{posx, posy, screenWidth, screenHeight} to bounds of window of desktop\n end
|
|
169
|
+
tell\n tell application process \"Finder\"\n set {missing
|
|
170
|
+
value, menubarHeight} to the size of menu bar 1\n end tell\n end
|
|
171
|
+
tell\n\n set winHeight to (screenHeight * 2 / 3)\n set winWidth
|
|
172
|
+
to (screenWidth / 2)\n set xoff to menubarHeight * %{batch_index}\n set
|
|
173
|
+
yoff to xoff mod (screenHeight - winHeight)\n \n create window with
|
|
174
|
+
default profile\n tell the first window\n set bounds to {xoff,
|
|
175
|
+
yoff, xoff + winWidth, yoff + winHeight}\n tell the current session\n
|
|
176
|
+
\ write text \"# %{script_filespec}\"\n write text
|
|
177
|
+
\"# %{output_filespec}\"\n write text \"echo -ne \\\"\\\\033];
|
|
178
|
+
%{started_at} - %{document_filename} - %{block_name} \\\\007\\\"\"\n write
|
|
179
|
+
text \"cd \\\"%{home}\\\"\"\n write text \"\\\"%{script_filename}\\\"
|
|
180
|
+
| tee \\\"%{output_filespec}\\\"\"\n end tell\n end tell\n end
|
|
181
|
+
tell'\n"
|
|
182
|
+
:description: execute_command_format
|
|
183
|
+
:env_var: MDE_EXECUTE_COMMAND_FORMAT
|
|
184
|
+
:opt_name: execute_command_format
|
|
185
|
+
:procname: val_as_str
|
|
186
|
+
- :default: "%T"
|
|
187
|
+
:description: Format for time in window title
|
|
188
|
+
:env_var: MDE_EXECUTE_COMMAND_TITLE_TIME_FORMAT
|
|
189
|
+
:opt_name: execute_command_title_time_format
|
|
190
|
+
:procname: val_as_str
|
|
191
|
+
- :arg_name: BOOL
|
|
192
|
+
:default: true
|
|
193
|
+
:description: Execute script in own window
|
|
194
|
+
:env_var: MDE_EXECUTE_IN_OWN_WINDOW
|
|
195
|
+
:opt_name: execute_in_own_window
|
|
196
|
+
:procname: val_as_bool
|
|
155
197
|
- :default: fg_rgbh_7f_ff_00
|
|
156
198
|
:description: execution_report_preview_frame_color
|
|
157
199
|
:env_var: MDE_EXECUTION_REPORT_PREVIEW_FRAME_COLOR
|
|
@@ -243,6 +285,10 @@
|
|
|
243
285
|
:long_name: how
|
|
244
286
|
:procname: how
|
|
245
287
|
:short_name: "?"
|
|
288
|
+
- :default:
|
|
289
|
+
:env_var: MDE_IMPORT_PATHS
|
|
290
|
+
:opt_name: import_paths
|
|
291
|
+
:procname: val_as_str
|
|
246
292
|
- :default: "^ *@import +(?<name>.+?) *$"
|
|
247
293
|
:env_var: MDE_IMPORT_PATTERN
|
|
248
294
|
:opt_name: import_pattern
|
|
@@ -541,6 +587,26 @@
|
|
|
541
587
|
:env_var: MDE_NO_CHROME
|
|
542
588
|
:opt_name: no_chrome
|
|
543
589
|
:procname: val_as_bool
|
|
590
|
+
- :default:
|
|
591
|
+
:description: Expression to match to start collecting lines
|
|
592
|
+
:env_var: MDE_OUTPUT_ASSIGNMENT_BEGIN
|
|
593
|
+
:opt_name: output_assignment_begin
|
|
594
|
+
:procname: val_as_str
|
|
595
|
+
- :default:
|
|
596
|
+
:description: Expression to match to stop collecting lines
|
|
597
|
+
:env_var: MDE_OUTPUT_ASSIGNMENT_END
|
|
598
|
+
:opt_name: output_assignment_begin
|
|
599
|
+
:procname: val_as_str
|
|
600
|
+
- :default: "%{line} # !!!"
|
|
601
|
+
:description: Format for assignments from output
|
|
602
|
+
:env_var: MDE_OUTPUT_ASSIGNMENT_FORMAT
|
|
603
|
+
:opt_name: output_assignment_format
|
|
604
|
+
:procname: val_as_str
|
|
605
|
+
- :default: "^ *(?<line>\\w+=.*?) *$"
|
|
606
|
+
:description: Pattern for assignments from output
|
|
607
|
+
:env_var: MDE_OUTPUT_ASSIGNMENT_MATCH
|
|
608
|
+
:opt_name: output_assignment_match
|
|
609
|
+
:procname: val_as_str
|
|
544
610
|
- :arg_name: BOOL
|
|
545
611
|
:default: false
|
|
546
612
|
:description: Display summary for execution
|
|
@@ -596,7 +662,7 @@
|
|
|
596
662
|
:procname: val_as_str
|
|
597
663
|
:short_name: p
|
|
598
664
|
- :arg_name: BOOL
|
|
599
|
-
:default:
|
|
665
|
+
:default: false
|
|
600
666
|
:description: Wheter to pause after manually executing a block and the next menu
|
|
601
667
|
:env_var: MDE_PAUSE_AFTER_SCRIPT_EXECUTION
|
|
602
668
|
:opt_name: pause_after_script_execution
|
|
@@ -620,6 +686,13 @@
|
|
|
620
686
|
:env_var: MDE_PROMPT_COLOR_AFTER_SCRIPT_EXECUTION
|
|
621
687
|
:opt_name: prompt_color_after_script_execution
|
|
622
688
|
:procname: val_as_str
|
|
689
|
+
- :default: |2-
|
|
690
|
+
|
|
691
|
+
Repeat this block?
|
|
692
|
+
:description: Prompt to debounce
|
|
693
|
+
:env_var: MDE_PROMPT_DEBOUNCE
|
|
694
|
+
:opt_name: prompt_debounce
|
|
695
|
+
:procname: val_as_str
|
|
623
696
|
- :default: Exit
|
|
624
697
|
:description: Prompt to exit app
|
|
625
698
|
:env_var: MDE_PROMPT_EXIT
|
|
@@ -661,6 +734,11 @@
|
|
|
661
734
|
:env_var: MDE_PROMPT_SELECT_OUTPUT
|
|
662
735
|
:opt_name: prompt_select_output
|
|
663
736
|
:procname: val_as_str
|
|
737
|
+
- :default: Uninterrupted
|
|
738
|
+
:description: Uninterrupted execution
|
|
739
|
+
:env_var: MDE_PROMPT_UNINTERRUPTED
|
|
740
|
+
:opt_name: prompt_uninterrupted
|
|
741
|
+
:procname: val_as_str
|
|
664
742
|
- :default: 'Yes'
|
|
665
743
|
:description: Prompt for yes
|
|
666
744
|
:env_var: MDE_PROMPT_YES
|
|
@@ -811,12 +889,12 @@
|
|
|
811
889
|
:env_var: MDE_SHELL
|
|
812
890
|
:opt_name: shell
|
|
813
891
|
:procname: val_as_str
|
|
814
|
-
- :default: "# -^-
|
|
892
|
+
- :default: "# -^-"
|
|
815
893
|
:description: shell_code_label_format_above
|
|
816
894
|
:env_var: MDE_SHELL_CODE_LABEL_FORMAT_ABOVE
|
|
817
895
|
:opt_name: shell_code_label_format_above
|
|
818
896
|
:procname: val_as_str
|
|
819
|
-
- :default: "# -v- +%{block_name} -v-"
|
|
897
|
+
- :default: "# -v- +%{block_name} -o- %{document_filename} -v-"
|
|
820
898
|
:description: shell_code_label_format_below
|
|
821
899
|
:env_var: MDE_SHELL_CODE_LABEL_FORMAT_BELOW
|
|
822
900
|
:opt_name: shell_code_label_format_below
|
|
@@ -826,7 +904,7 @@
|
|
|
826
904
|
:opt_name: tab_completions
|
|
827
905
|
:procname: val_as_bool
|
|
828
906
|
- :arg_name: BOOL
|
|
829
|
-
:default:
|
|
907
|
+
:default: false
|
|
830
908
|
:description: Requires user approval before executing a script
|
|
831
909
|
:env_var: MDE_USER_MUST_APPROVE
|
|
832
910
|
:long_name: user-must-approve
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: markdown_exec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.8.
|
|
4
|
+
version: 1.8.9
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fareed Stevenson
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-01-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: clipboard
|
|
@@ -118,11 +118,15 @@ files:
|
|
|
118
118
|
- examples/import0.md
|
|
119
119
|
- examples/import1.md
|
|
120
120
|
- examples/include.md
|
|
121
|
+
- examples/indent.md
|
|
121
122
|
- examples/infile_config.md
|
|
122
123
|
- examples/linked.md
|
|
123
124
|
- examples/linked1.md
|
|
124
125
|
- examples/linked2.md
|
|
125
126
|
- examples/linked3.md
|
|
127
|
+
- examples/load1.sh
|
|
128
|
+
- examples/load2.sh
|
|
129
|
+
- examples/nickname.md
|
|
126
130
|
- examples/opts.md
|
|
127
131
|
- examples/pass-through.md
|
|
128
132
|
- examples/plant.md
|
|
@@ -135,6 +139,7 @@ files:
|
|
|
135
139
|
- lib/block_label.rb
|
|
136
140
|
- lib/block_types.rb
|
|
137
141
|
- lib/cached_nested_file_reader.rb
|
|
142
|
+
- lib/ce_get_cost_and_usage.rb
|
|
138
143
|
- lib/cli.rb
|
|
139
144
|
- lib/colorize.rb
|
|
140
145
|
- lib/constants.rb
|
|
@@ -143,6 +148,7 @@ files:
|
|
|
143
148
|
- lib/exceptions.rb
|
|
144
149
|
- lib/fcb.rb
|
|
145
150
|
- lib/filter.rb
|
|
151
|
+
- lib/find_files.rb
|
|
146
152
|
- lib/fout.rb
|
|
147
153
|
- lib/hash.rb
|
|
148
154
|
- lib/hash_delegator.rb
|
|
@@ -152,17 +158,13 @@ files:
|
|
|
152
158
|
- lib/mdoc.rb
|
|
153
159
|
- lib/menu.src.yml
|
|
154
160
|
- lib/menu.yml
|
|
155
|
-
- lib/method_sorter.rb
|
|
156
161
|
- lib/object_present.rb
|
|
157
162
|
- lib/option_value.rb
|
|
158
|
-
- lib/pty1.rb
|
|
159
163
|
- lib/regexp.rb
|
|
160
|
-
- lib/regexp_replacer.rb
|
|
161
164
|
- lib/rspec_helpers.rb
|
|
162
165
|
- lib/saved_assets.rb
|
|
163
166
|
- lib/saved_files_matcher.rb
|
|
164
167
|
- lib/shared.rb
|
|
165
|
-
- lib/sort_yaml_gpt4.rb
|
|
166
168
|
- lib/string_util.rb
|
|
167
169
|
- lib/tap.rb
|
|
168
170
|
homepage: https://rubygems.org/gems/markdown_exec
|