markdown_exec 2.1.0 → 2.3.0
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 +5 -1
- data/CHANGELOG.md +23 -1
- data/Gemfile +3 -3
- data/Gemfile.lock +134 -92
- data/README.md +13 -13
- data/bin/tab_completion.sh +14 -3
- data/bin/tab_completion.sh.erb +0 -1
- data/examples/bash-blocks.md +58 -0
- data/examples/block-names.md +62 -0
- data/examples/indent.md +43 -2
- data/examples/link-blocks-block.md +5 -0
- data/examples/link-blocks-load-save.md +59 -0
- data/examples/link-blocks-vars.md +56 -0
- data/examples/linked.md +6 -101
- data/examples/opts-blocks-require.md +28 -0
- data/examples/{port.md → port-blocks.md} +18 -9
- data/examples/save.md +76 -4
- data/examples/vars-blocks.md +38 -0
- data/lib/colorize.rb +13 -0
- data/lib/constants.rb +1 -1
- data/lib/fcb.rb +202 -16
- data/lib/filter.rb +12 -12
- data/lib/hash_delegator.rb +695 -326
- data/lib/hierarchy_string.rb +133 -0
- data/lib/input_sequencer.rb +4 -2
- data/lib/link_history.rb +34 -1
- data/lib/markdown_exec/version.rb +1 -1
- data/lib/markdown_exec.rb +67 -79
- data/lib/mdoc.rb +122 -60
- data/lib/menu.src.yml +71 -21
- data/lib/menu.yml +59 -19
- data/lib/namer.rb +50 -0
- data/lib/poly.rb +152 -0
- data/lib/saved_assets.rb +4 -11
- data/lib/string_util.rb +0 -1
- data/lib/text_analyzer.rb +100 -0
- metadata +16 -6
- data/examples/vars.md +0 -20
- /data/examples/{opts.md → opts-blocks.md} +0 -0
- /data/examples/{pass-through.md → pass-through-arguments.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40813cfbaca2f9b2e8b865e2f574ab71211c56120d5706d2f8ebc4fbb103d254
|
4
|
+
data.tar.gz: 880d121d18747d2370dff0caa90f84da9fca51633ec6e00919f690ea4821d1f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df8c99ddc62b271b1fa74036ffcb485411a1461195d68c2e1825ae3ba606e4b20de456636d0094606c4579548d4532dd46287c5c486b4ab613217ab708144709
|
7
|
+
data.tar.gz: 4b812fa4808161beaa06c3de9b0639a031446294bb8a171d599e5baa4db157660233701c1068a130c93dfbd4cd0469853867cf4c751dfda4197ffb13ee81899a
|
data/.rubocop.yml
CHANGED
@@ -14,7 +14,8 @@ Layout/LineContinuationLeadingSpace:
|
|
14
14
|
Enabled: false
|
15
15
|
|
16
16
|
Layout/LineLength: # 2024-01-21 temp disable
|
17
|
-
Enabled: false
|
17
|
+
# Enabled: false
|
18
|
+
Max: 80
|
18
19
|
# Max: 96
|
19
20
|
# Max: 120
|
20
21
|
|
@@ -87,6 +88,9 @@ Style/FormatStringToken:
|
|
87
88
|
Style/GlobalVars:
|
88
89
|
Enabled: false
|
89
90
|
|
91
|
+
Style/IfUnlessModifier: # 2024-08 suggests lines that are too long
|
92
|
+
Enabled: false
|
93
|
+
|
90
94
|
Style/Lambda:
|
91
95
|
Enabled: false
|
92
96
|
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [2.3.0] - 2024-08-05
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- In-line decoration of text
|
8
|
+
- ANSI graphics modes for text decoration.
|
9
|
+
- Translation from text to ANSI graphics.
|
10
|
+
- Options for decorations in three stages, with default (Main) in the middle.
|
11
|
+
|
12
|
+
## [2.2.0] - 2024-07-27
|
13
|
+
|
14
|
+
### Added
|
15
|
+
|
16
|
+
- Options to list recent saved assets.
|
17
|
+
- Short name for execute-in-own-window option.
|
18
|
+
- Short name for load-code option.
|
19
|
+
|
20
|
+
### Changed
|
21
|
+
|
22
|
+
- Improve handling of variations of block names.
|
23
|
+
- Remove functions to select recent saved assets.
|
24
|
+
|
3
25
|
## [2.1.0] - 2024-07-15
|
4
26
|
|
5
27
|
### Added
|
@@ -555,7 +577,7 @@ Most options can be configured in multiple ways. In order of use (earliest super
|
|
555
577
|
2. the configuration file `.mde.yml` in the current folder
|
556
578
|
3. command line arguments
|
557
579
|
|
558
|
-
|
580
|
+
### Representing boolean values
|
559
581
|
|
560
582
|
Boolean values for options are specified as strings and interpreted as:
|
561
583
|
| Value | Boolean |
|
data/Gemfile
CHANGED
@@ -9,7 +9,7 @@ gemspec
|
|
9
9
|
gem 'clipboard'
|
10
10
|
gem 'debug'
|
11
11
|
gem 'erb'
|
12
|
-
gem 'irb'
|
12
|
+
gem 'irb'
|
13
13
|
gem 'mocha', require: false
|
14
14
|
gem 'minitest', require: false
|
15
15
|
gem 'pry-nav'
|
@@ -23,5 +23,5 @@ gem 'rubocop-minitest', require: false
|
|
23
23
|
gem 'rubocop-rake', require: false
|
24
24
|
gem 'rubocop-rspec', require: false
|
25
25
|
gem 'shellwords'
|
26
|
-
gem 'uri'
|
27
|
-
gem 'yaml'
|
26
|
+
gem 'uri'
|
27
|
+
gem 'yaml'
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
markdown_exec (2.
|
4
|
+
markdown_exec (2.3.0)
|
5
5
|
clipboard (~> 1.3.6)
|
6
6
|
open3 (~> 0.1.1)
|
7
7
|
optparse (~> 0.1.1)
|
@@ -11,64 +11,102 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
actionpack (7.
|
15
|
-
actionview (= 7.
|
16
|
-
activesupport (= 7.
|
17
|
-
|
14
|
+
actionpack (7.1.3.4)
|
15
|
+
actionview (= 7.1.3.4)
|
16
|
+
activesupport (= 7.1.3.4)
|
17
|
+
nokogiri (>= 1.8.5)
|
18
|
+
racc
|
19
|
+
rack (>= 2.2.4)
|
20
|
+
rack-session (>= 1.0.1)
|
18
21
|
rack-test (>= 0.6.3)
|
19
|
-
rails-dom-testing (~> 2.
|
20
|
-
rails-html-sanitizer (~> 1.
|
21
|
-
actionview (7.
|
22
|
-
activesupport (= 7.
|
22
|
+
rails-dom-testing (~> 2.2)
|
23
|
+
rails-html-sanitizer (~> 1.6)
|
24
|
+
actionview (7.1.3.4)
|
25
|
+
activesupport (= 7.1.3.4)
|
23
26
|
builder (~> 3.1)
|
24
|
-
erubi (~> 1.
|
25
|
-
rails-dom-testing (~> 2.
|
26
|
-
rails-html-sanitizer (~> 1.
|
27
|
-
activesupport (7.
|
27
|
+
erubi (~> 1.11)
|
28
|
+
rails-dom-testing (~> 2.2)
|
29
|
+
rails-html-sanitizer (~> 1.6)
|
30
|
+
activesupport (7.1.3.4)
|
31
|
+
base64
|
32
|
+
bigdecimal
|
28
33
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
34
|
+
connection_pool (>= 2.2.5)
|
35
|
+
drb
|
29
36
|
i18n (>= 1.6, < 2)
|
30
37
|
minitest (>= 5.1)
|
38
|
+
mutex_m
|
31
39
|
tzinfo (~> 2.0)
|
32
40
|
ast (2.4.2)
|
33
|
-
base64 (0.
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
41
|
+
base64 (0.2.0)
|
42
|
+
bigdecimal (3.1.8)
|
43
|
+
binding_of_caller (1.0.1)
|
44
|
+
debug_inspector (>= 1.2.0)
|
45
|
+
builder (3.3.0)
|
46
|
+
cgi (0.4.1)
|
38
47
|
clipboard (1.3.6)
|
39
48
|
coderay (1.1.3)
|
40
|
-
concurrent-ruby (1.
|
49
|
+
concurrent-ruby (1.3.3)
|
50
|
+
connection_pool (2.4.1)
|
41
51
|
crass (1.0.6)
|
42
|
-
debug (1.9.
|
52
|
+
debug (1.9.2)
|
43
53
|
irb (~> 1.10)
|
44
54
|
reline (>= 0.3.8)
|
45
|
-
debug_inspector (1.
|
46
|
-
diff-lcs (1.5.
|
47
|
-
|
55
|
+
debug_inspector (1.2.0)
|
56
|
+
diff-lcs (1.5.1)
|
57
|
+
drb (2.2.1)
|
58
|
+
dry-configurable (1.2.0)
|
59
|
+
dry-core (~> 1.0, < 2)
|
60
|
+
zeitwerk (~> 2.6)
|
61
|
+
dry-core (1.0.1)
|
62
|
+
concurrent-ruby (~> 1.0)
|
63
|
+
zeitwerk (~> 2.6)
|
64
|
+
dry-inflector (1.1.0)
|
65
|
+
dry-initializer (3.1.1)
|
66
|
+
dry-logic (1.5.0)
|
67
|
+
concurrent-ruby (~> 1.0)
|
68
|
+
dry-core (~> 1.0, < 2)
|
69
|
+
zeitwerk (~> 2.6)
|
70
|
+
dry-schema (1.13.4)
|
71
|
+
concurrent-ruby (~> 1.0)
|
72
|
+
dry-configurable (~> 1.0, >= 1.0.1)
|
73
|
+
dry-core (~> 1.0, < 2)
|
74
|
+
dry-initializer (~> 3.0)
|
75
|
+
dry-logic (>= 1.4, < 2)
|
76
|
+
dry-types (>= 1.7, < 2)
|
77
|
+
zeitwerk (~> 2.6)
|
78
|
+
dry-types (1.7.2)
|
79
|
+
bigdecimal (~> 3.0)
|
80
|
+
concurrent-ruby (~> 1.0)
|
81
|
+
dry-core (~> 1.0)
|
82
|
+
dry-inflector (~> 1.0)
|
83
|
+
dry-logic (~> 1.4)
|
84
|
+
zeitwerk (~> 2.6)
|
85
|
+
erb (4.0.4)
|
48
86
|
cgi (>= 0.3.3)
|
49
|
-
erubi (1.
|
50
|
-
i18n (1.14.
|
87
|
+
erubi (1.13.0)
|
88
|
+
i18n (1.14.5)
|
51
89
|
concurrent-ruby (~> 1.0)
|
52
|
-
io-console (0.7.
|
53
|
-
irb (1.
|
54
|
-
rdoc
|
55
|
-
reline (>= 0.
|
56
|
-
json (2.
|
57
|
-
kwalify (0.7.2)
|
90
|
+
io-console (0.7.2)
|
91
|
+
irb (1.14.0)
|
92
|
+
rdoc (>= 4.0.0)
|
93
|
+
reline (>= 0.4.2)
|
94
|
+
json (2.7.2)
|
58
95
|
language_server-protocol (3.17.0.3)
|
59
|
-
loofah (2.
|
96
|
+
loofah (2.22.0)
|
60
97
|
crass (~> 1.0.2)
|
61
98
|
nokogiri (>= 1.12.0)
|
62
|
-
method_source (1.
|
63
|
-
minitest (5.
|
64
|
-
mocha (2.
|
99
|
+
method_source (1.1.0)
|
100
|
+
minitest (5.24.1)
|
101
|
+
mocha (2.4.5)
|
65
102
|
ruby2_keywords (>= 0.0.5)
|
66
|
-
|
103
|
+
mutex_m (0.2.0)
|
104
|
+
nokogiri (1.16.6-arm64-darwin)
|
67
105
|
racc (~> 1.4)
|
68
106
|
open3 (0.1.2)
|
69
107
|
optparse (0.1.1)
|
70
|
-
parallel (1.
|
71
|
-
parser (3.
|
108
|
+
parallel (1.25.1)
|
109
|
+
parser (3.3.4.0)
|
72
110
|
ast (~> 2.4.1)
|
73
111
|
racc
|
74
112
|
pastel (0.8.0)
|
@@ -81,12 +119,17 @@ GEM
|
|
81
119
|
pry-stack_explorer (0.6.1)
|
82
120
|
binding_of_caller (~> 1.0)
|
83
121
|
pry (~> 0.13)
|
84
|
-
psych (5.1.
|
122
|
+
psych (5.1.2)
|
85
123
|
stringio
|
86
|
-
racc (1.
|
87
|
-
rack (
|
124
|
+
racc (1.8.0)
|
125
|
+
rack (3.1.7)
|
126
|
+
rack-session (2.0.0)
|
127
|
+
rack (>= 3.0.0)
|
88
128
|
rack-test (2.1.0)
|
89
129
|
rack (>= 1.3)
|
130
|
+
rackup (2.1.0)
|
131
|
+
rack (>= 3)
|
132
|
+
webrick (~> 1.8)
|
90
133
|
rails-dom-testing (2.2.0)
|
91
134
|
activesupport (>= 5.0.0)
|
92
135
|
minitest
|
@@ -94,69 +137,67 @@ GEM
|
|
94
137
|
rails-html-sanitizer (1.6.0)
|
95
138
|
loofah (~> 2.21)
|
96
139
|
nokogiri (~> 1.14)
|
97
|
-
railties (7.
|
98
|
-
actionpack (= 7.
|
99
|
-
activesupport (= 7.
|
100
|
-
|
140
|
+
railties (7.1.3.4)
|
141
|
+
actionpack (= 7.1.3.4)
|
142
|
+
activesupport (= 7.1.3.4)
|
143
|
+
irb
|
144
|
+
rackup (>= 1.0.0)
|
101
145
|
rake (>= 12.2)
|
102
|
-
thor (~> 1.0)
|
103
|
-
zeitwerk (~> 2.
|
146
|
+
thor (~> 1.0, >= 1.2.2)
|
147
|
+
zeitwerk (~> 2.6)
|
104
148
|
rainbow (3.1.1)
|
105
|
-
rake (13.
|
106
|
-
rdoc (6.
|
149
|
+
rake (13.2.1)
|
150
|
+
rdoc (6.7.0)
|
107
151
|
psych (>= 4.0.0)
|
108
|
-
reek (6.
|
109
|
-
|
110
|
-
parser (~> 3.
|
152
|
+
reek (6.3.0)
|
153
|
+
dry-schema (~> 1.13.0)
|
154
|
+
parser (~> 3.3.0)
|
111
155
|
rainbow (>= 2.0, < 4.0)
|
112
|
-
|
113
|
-
|
156
|
+
rexml (~> 3.1)
|
157
|
+
regexp_parser (2.9.2)
|
158
|
+
reline (0.5.9)
|
114
159
|
io-console (~> 0.5)
|
115
|
-
rexml (3.2
|
116
|
-
|
117
|
-
|
118
|
-
rspec-
|
119
|
-
rspec-
|
120
|
-
|
121
|
-
|
122
|
-
|
160
|
+
rexml (3.3.2)
|
161
|
+
strscan
|
162
|
+
rspec (3.13.0)
|
163
|
+
rspec-core (~> 3.13.0)
|
164
|
+
rspec-expectations (~> 3.13.0)
|
165
|
+
rspec-mocks (~> 3.13.0)
|
166
|
+
rspec-core (3.13.0)
|
167
|
+
rspec-support (~> 3.13.0)
|
168
|
+
rspec-expectations (3.13.1)
|
123
169
|
diff-lcs (>= 1.2.0, < 2.0)
|
124
|
-
rspec-support (~> 3.
|
125
|
-
rspec-mocks (3.
|
170
|
+
rspec-support (~> 3.13.0)
|
171
|
+
rspec-mocks (3.13.1)
|
126
172
|
diff-lcs (>= 1.2.0, < 2.0)
|
127
|
-
rspec-support (~> 3.
|
128
|
-
rspec-support (3.
|
129
|
-
rubocop (1.
|
130
|
-
base64 (~> 0.1.1)
|
173
|
+
rspec-support (~> 3.13.0)
|
174
|
+
rspec-support (3.13.1)
|
175
|
+
rubocop (1.65.0)
|
131
176
|
json (~> 2.3)
|
132
177
|
language_server-protocol (>= 3.17.0)
|
133
178
|
parallel (~> 1.10)
|
134
|
-
parser (>= 3.
|
179
|
+
parser (>= 3.3.0.2)
|
135
180
|
rainbow (>= 2.2.2, < 4.0)
|
136
|
-
regexp_parser (>=
|
181
|
+
regexp_parser (>= 2.4, < 3.0)
|
137
182
|
rexml (>= 3.2.5, < 4.0)
|
138
|
-
rubocop-ast (>= 1.
|
183
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
139
184
|
ruby-progressbar (~> 1.7)
|
140
185
|
unicode-display_width (>= 2.4.0, < 3.0)
|
141
|
-
rubocop-ast (1.
|
142
|
-
parser (>= 3.
|
143
|
-
rubocop-
|
144
|
-
rubocop (
|
145
|
-
|
146
|
-
rubocop (~> 1.33)
|
147
|
-
rubocop-minitest (0.32.2)
|
148
|
-
rubocop (>= 1.39, < 2.0)
|
186
|
+
rubocop-ast (1.31.3)
|
187
|
+
parser (>= 3.3.1.0)
|
188
|
+
rubocop-minitest (0.35.1)
|
189
|
+
rubocop (>= 1.61, < 2.0)
|
190
|
+
rubocop-ast (>= 1.31.1, < 2.0)
|
149
191
|
rubocop-rake (0.6.0)
|
150
192
|
rubocop (~> 1.0)
|
151
|
-
rubocop-rspec (
|
152
|
-
rubocop (~> 1.
|
153
|
-
rubocop-capybara (~> 2.17)
|
154
|
-
rubocop-factory_bot (~> 2.22)
|
193
|
+
rubocop-rspec (3.0.3)
|
194
|
+
rubocop (~> 1.61)
|
155
195
|
ruby-progressbar (1.13.0)
|
156
196
|
ruby2_keywords (0.0.5)
|
157
|
-
shellwords (0.
|
158
|
-
stringio (3.1.
|
159
|
-
|
197
|
+
shellwords (0.2.0)
|
198
|
+
stringio (3.1.1)
|
199
|
+
strscan (3.1.0)
|
200
|
+
thor (1.3.1)
|
160
201
|
tty-color (0.6.0)
|
161
202
|
tty-cursor (0.7.1)
|
162
203
|
tty-prompt (0.23.1)
|
@@ -166,14 +207,15 @@ GEM
|
|
166
207
|
tty-cursor (~> 0.7)
|
167
208
|
tty-screen (~> 0.8)
|
168
209
|
wisper (~> 2.0)
|
169
|
-
tty-screen (0.8.
|
210
|
+
tty-screen (0.8.2)
|
170
211
|
tzinfo (2.0.6)
|
171
212
|
concurrent-ruby (~> 1.0)
|
172
213
|
unicode-display_width (2.5.0)
|
173
|
-
uri (0.
|
214
|
+
uri (0.13.0)
|
215
|
+
webrick (1.8.1)
|
174
216
|
wisper (2.0.1)
|
175
217
|
yaml (0.2.1)
|
176
|
-
zeitwerk (2.6.
|
218
|
+
zeitwerk (2.6.16)
|
177
219
|
|
178
220
|
PLATFORMS
|
179
221
|
arm64-darwin-21
|
@@ -182,7 +224,7 @@ DEPENDENCIES
|
|
182
224
|
clipboard
|
183
225
|
debug
|
184
226
|
erb
|
185
|
-
irb
|
227
|
+
irb
|
186
228
|
markdown_exec!
|
187
229
|
minitest
|
188
230
|
mocha
|
@@ -197,8 +239,8 @@ DEPENDENCIES
|
|
197
239
|
rubocop-rake
|
198
240
|
rubocop-rspec
|
199
241
|
shellwords
|
200
|
-
uri
|
201
|
-
yaml
|
242
|
+
uri
|
243
|
+
yaml
|
202
244
|
|
203
245
|
BUNDLED WITH
|
204
246
|
2.4.13
|
data/README.md
CHANGED
@@ -41,65 +41,65 @@ Install:
|
|
41
41
|
|
42
42
|
### Help
|
43
43
|
|
44
|
-
|
44
|
+
::: `mde --help`
|
45
45
|
|
46
46
|
Displays help information.
|
47
47
|
|
48
48
|
### Basic
|
49
49
|
|
50
|
-
|
50
|
+
::: `mde`
|
51
51
|
|
52
52
|
Process `README.md` file in the current folder. Displays all the blocks in the file and allows you to select using [up], [down], and [return].
|
53
53
|
|
54
|
-
|
54
|
+
::: `mde my.md` or `mde -f my.md`
|
55
55
|
|
56
56
|
Select a block to execute from `my.md`.
|
57
57
|
|
58
|
-
|
58
|
+
::: `mde my.md myblock`
|
59
59
|
|
60
60
|
Execute the block named `myblock` from `my.md`.
|
61
61
|
|
62
|
-
|
62
|
+
::: `mde .` or `mde -p .`
|
63
63
|
|
64
64
|
Select a markdown file in the current folder. Select a block to execute from that file.
|
65
65
|
|
66
66
|
### Report documents and blocks
|
67
67
|
|
68
|
-
|
68
|
+
::: `mde --list-blocks`
|
69
69
|
|
70
70
|
List all blocks in the all the markdown documents in the current folder.
|
71
71
|
|
72
|
-
|
72
|
+
::: `mde --list-docs`
|
73
73
|
|
74
74
|
List all markdown documents in the current folder.
|
75
75
|
|
76
76
|
### Configuration
|
77
77
|
|
78
|
-
|
78
|
+
::: `mde --list-default-env` or `mde --list-default-yaml`
|
79
79
|
|
80
80
|
List default values that can be set in configuration file, environment, and command line.
|
81
81
|
|
82
|
-
|
82
|
+
::: `mde -0`
|
83
83
|
|
84
84
|
Show current configuation values that will be applied to the current run. Does not interrupt processing.
|
85
85
|
|
86
86
|
### Save scripts
|
87
87
|
|
88
|
-
|
88
|
+
::: `mde --save-executed-script 1`
|
89
89
|
|
90
90
|
Save executed script in saved script folder.
|
91
91
|
|
92
|
-
|
92
|
+
::: `mde --list-recent-scripts`
|
93
93
|
|
94
94
|
List recent saved scripts in saved script folder.
|
95
95
|
|
96
|
-
|
96
|
+
::: `mde --select-recent-script`
|
97
97
|
|
98
98
|
Select and execute a recently saved script in saved script folder.
|
99
99
|
|
100
100
|
### Save output
|
101
101
|
|
102
|
-
|
102
|
+
::: `mde --save-execution-output 1`
|
103
103
|
|
104
104
|
Save execution output in saved output folder.
|
105
105
|
|
data/bin/tab_completion.sh
CHANGED
@@ -13,7 +13,7 @@ __filedirs_all()
|
|
13
13
|
}
|
14
14
|
|
15
15
|
_mde_echo_version() {
|
16
|
-
echo "2.
|
16
|
+
echo "2.3.0"
|
17
17
|
}
|
18
18
|
|
19
19
|
_mde() {
|
@@ -50,6 +50,10 @@ _mde() {
|
|
50
50
|
|
51
51
|
--dump-selected-block) COMPREPLY="0"; return 0 ;;
|
52
52
|
|
53
|
+
--execute_in_own_window) COMPREPLY="0"; return 0 ;;
|
54
|
+
|
55
|
+
-w) COMPREPLY="0"; return 0 ;;
|
56
|
+
|
53
57
|
--filename) COMPREPLY="."; return 0 ;;
|
54
58
|
|
55
59
|
-f) COMPREPLY="."; return 0 ;;
|
@@ -68,6 +72,8 @@ _mde() {
|
|
68
72
|
|
69
73
|
--load-code) COMPREPLY="''"; return 0 ;;
|
70
74
|
|
75
|
+
-l) COMPREPLY="''"; return 0 ;;
|
76
|
+
|
71
77
|
--open) COMPREPLY="''"; return 0 ;;
|
72
78
|
|
73
79
|
-o) COMPREPLY="''"; return 0 ;;
|
@@ -94,7 +100,7 @@ _mde() {
|
|
94
100
|
# present matching option names
|
95
101
|
#
|
96
102
|
if [[ ${cur} == -* ]] ; then
|
97
|
-
opts=("--block-name" "--config" "--debug" "--dump-delegate-object" "--dump-blocks-in-file" "--dump-inherited-block_names" "--dump-inherited-dependencies" "--dump-inherited-lines" "--dump-menu-blocks" "--dump-selected-block" "--exit" "--filename" "--find" "--find-path" "--help" "--how" "--list-blocks" "--list-count" "--list-default-env" "--list-default-yaml" "--list-docs" "--list-recent-output" "--list-recent-scripts" "--load-code" "--open" "--output-script" "--output-stdout" "--path" "--pwd" "--run-last-script" "--
|
103
|
+
opts=("--block-name" "--config" "--debug" "--dump-delegate-object" "--dump-blocks-in-file" "--dump-inherited-block_names" "--dump-inherited-dependencies" "--dump-inherited-lines" "--dump-menu-blocks" "--dump-selected-block" "--execute_in_own_window" "--exit" "--filename" "--find" "--find-path" "--help" "--how" "--list-blocks" "--list-count" "--list-default-env" "--list-default-yaml" "--list-docs" "--list-recent-output" "--list-recent-scripts" "--load-code" "--open" "--output-script" "--output-stdout" "--path" "--pwd" "--run-last-script" "--tab-completions" "--user-must-approve" "--version" "--display-level")
|
98
104
|
COMPREPLY=( $(compgen -W "$(printf "'%s' " "${opts[@]}")" -- "${cur}") )
|
99
105
|
|
100
106
|
return 0
|
@@ -131,6 +137,10 @@ _mde() {
|
|
131
137
|
|
132
138
|
--dump-selected-block) COMPREPLY=".BOOL."; return 0 ;;
|
133
139
|
|
140
|
+
--execute_in_own_window) COMPREPLY=".BOOL."; return 0 ;;
|
141
|
+
|
142
|
+
-w) COMPREPLY=".BOOL."; return 0 ;;
|
143
|
+
|
134
144
|
--filename) COMPREPLY=".RELATIVE_PATH."; return 0 ;;
|
135
145
|
|
136
146
|
-f) COMPREPLY=".RELATIVE_PATH."; return 0 ;;
|
@@ -149,6 +159,8 @@ _mde() {
|
|
149
159
|
|
150
160
|
--load-code) COMPREPLY=".PATH."; return 0 ;;
|
151
161
|
|
162
|
+
-l) COMPREPLY=".PATH."; return 0 ;;
|
163
|
+
|
152
164
|
--open) COMPREPLY=".OPEN."; return 0 ;;
|
153
165
|
|
154
166
|
-o) COMPREPLY=".OPEN."; return 0 ;;
|
@@ -178,4 +190,3 @@ _mde() {
|
|
178
190
|
|
179
191
|
complete -o filenames -o nospace -F _mde mde
|
180
192
|
# _mde_echo_version
|
181
|
-
# echo "Updated: 2024-07-16 20:54:59 UTC"
|
data/bin/tab_completion.sh.erb
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
# Demonstrate requiring shell blocks
|
2
|
+
## Requiring a named block
|
3
|
+
::: Click below to trigger. If it prints "species", "genus", the required block was processed.
|
4
|
+
The un-named block prints "species" and requires block "genus".
|
5
|
+
```bash +genus
|
6
|
+
echo "species"
|
7
|
+
```
|
8
|
+
::: Click below to trigger. If it prints "genus", the block was processed.
|
9
|
+
The named block prints "genus".
|
10
|
+
```bash :genus
|
11
|
+
echo "genus"
|
12
|
+
```
|
13
|
+
|
14
|
+
## Requiring a block with a nickname and a hidden block
|
15
|
+
::: Click below to trigger. If it prints "family", "order", "class" the required blocks were processed.
|
16
|
+
The named block prints "family" and requires blocks "[order]" and "(class)".
|
17
|
+
```bash :family +[order] +(class)
|
18
|
+
echo "family"
|
19
|
+
```
|
20
|
+
The nick-named block "[order]" is required above. It prints "order".
|
21
|
+
```bash :[order]
|
22
|
+
echo "order"
|
23
|
+
```
|
24
|
+
The hidden block "(class)" is required above. It prints "class".
|
25
|
+
```bash :(class)
|
26
|
+
echo "class"
|
27
|
+
```
|
28
|
+
|
29
|
+
## Requiring a before-and-after block pair
|
30
|
+
The hidden block "{phylum-domain}", prints "phylum".
|
31
|
+
```bash :{phylum-domain}
|
32
|
+
echo "phylum"
|
33
|
+
```
|
34
|
+
The hidden block "{phylum-domain-after}", prints "domain".
|
35
|
+
```bash :{phylum-domain-after}
|
36
|
+
echo "domain"
|
37
|
+
```
|
38
|
+
The hidden block "(biology)" prints "biology".
|
39
|
+
```bash :(biology)
|
40
|
+
echo "biology"
|
41
|
+
```
|
42
|
+
::: Click below to trigger. If it prints "biology", "phylum", "kingdom", "domain", and "taxonomy" the required blocks were processed.
|
43
|
+
The named block prints "kingdom" and requires blocks wrapper blocks "{phylum-domain}" and "{phylum-domain-after}".
|
44
|
+
Notice the wrapper blocks are exclusive to the single block with the requirement.
|
45
|
+
```bash :kingdom +{phylum-domain} +(biology) +(taxonomy)
|
46
|
+
echo "kingdom"
|
47
|
+
```
|
48
|
+
The hidden block "(taxonomy)" prints "taxonomy".
|
49
|
+
```bash :(taxonomy)
|
50
|
+
echo "taxonomy"
|
51
|
+
```
|
52
|
+
|
53
|
+
```opts :(document_options)
|
54
|
+
execute_in_own_window: false
|
55
|
+
output_execution_report: false
|
56
|
+
output_execution_summary: false
|
57
|
+
pause_after_script_execution: true
|
58
|
+
```
|
@@ -0,0 +1,62 @@
|
|
1
|
+
## Demonstrate handling of special characters in block names
|
2
|
+
|
3
|
+
::: Click below to trigger. If it prints "1","2","3","4", the Link blocks were required.
|
4
|
+
Long block names can be required by a Bash block.
|
5
|
+
```bash :calling-block +long_block_name_12345678901234567890123456789012345678901234567890 +(long_block_name_12345678901234567890123456789012345678901234567890) +[long_block_name_12345678901234567890123456789012345678901234567890]
|
6
|
+
echo '1'
|
7
|
+
```
|
8
|
+
Long block names can be used in Link blocks.
|
9
|
+
```link
|
10
|
+
block: long_block_name_12345678901234567890123456789012345678901234567890
|
11
|
+
```
|
12
|
+
```link
|
13
|
+
block: "(long_block_name_12345678901234567890123456789012345678901234567890)"
|
14
|
+
```
|
15
|
+
```link
|
16
|
+
block: "[long_block_name_12345678901234567890123456789012345678901234567890]"
|
17
|
+
```
|
18
|
+
|
19
|
+
Do not call these blocks directly.
|
20
|
+
```bash :long_block_name_12345678901234567890123456789012345678901234567890
|
21
|
+
echo '2'
|
22
|
+
```
|
23
|
+
```bash :(long_block_name_12345678901234567890123456789012345678901234567890)
|
24
|
+
echo '3'
|
25
|
+
```
|
26
|
+
```bash :[long_block_name_12345678901234567890123456789012345678901234567890]
|
27
|
+
echo '4'
|
28
|
+
```
|
29
|
+
|
30
|
+
Block names with all chars.
|
31
|
+
/ UTF-8
|
32
|
+
/ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
|
33
|
+
/ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
|
34
|
+
::: Click below to trigger. If it prints "Success", the Link block was processed.
|
35
|
+
This block name uses the printable characters in the first 128 values. It is executable.
|
36
|
+
```link :!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
|
37
|
+
block: (success)
|
38
|
+
```
|
39
|
+
This block name uses the printable characters in the second 128 values. It is executable.
|
40
|
+
```link :¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
|
41
|
+
block: (success)
|
42
|
+
```
|
43
|
+
|
44
|
+
## Block formatting
|
45
|
+
The un-named block should display correctly.
|
46
|
+
```link
|
47
|
+
file: examples/linked2.md
|
48
|
+
block: show_vars
|
49
|
+
vars:
|
50
|
+
page2_var_via_environment: for_page2_from_page1_via_current_environment
|
51
|
+
```
|
52
|
+
The hidden block "(success)" is required above. It prints "Success".
|
53
|
+
```bash :(success)
|
54
|
+
echo "Success"
|
55
|
+
```
|
56
|
+
|
57
|
+
```opts :(document_options)
|
58
|
+
execute_in_own_window: false
|
59
|
+
output_execution_report: false
|
60
|
+
output_execution_summary: false
|
61
|
+
pause_after_script_execution: true
|
62
|
+
```
|