markdown_exec 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -2
- data/CHANGELOG.md +14 -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 +27 -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/constants.rb +1 -1
- data/lib/fcb.rb +202 -16
- data/lib/filter.rb +12 -12
- data/lib/hash_delegator.rb +647 -321
- data/lib/link_history.rb +34 -1
- data/lib/markdown_exec/version.rb +1 -1
- data/lib/markdown_exec.rb +56 -75
- data/lib/mdoc.rb +112 -57
- data/lib/menu.src.yml +34 -21
- data/lib/menu.yml +30 -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
- metadata +14 -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: 32532369e9eec3574b8bff6d6c79097f547e120c7b113c10a765364e20a311a4
|
4
|
+
data.tar.gz: 3773bab7197401361c06bace1921663679bbf53d77f2cbe5daa1c2975c091e87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6ad41fdae333916ef13870498b6b1b9be7338af8ae39238b4a16a475b42430cb9282c59dbcecd124f422ab218848a70611ce6120e03074660a213a89e054df1
|
7
|
+
data.tar.gz: f9ef27a86c8a7cb4e15b4eb59705d1fdad6a15b8c6af176978b09f1108599569e0f74423b89c1baaa2cfaed249a4ff37fb18c8e7c6c87220d0ecb48a5e4cdd45
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [2.2.0] - 2024-07-27
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Options to list recent saved assets.
|
8
|
+
- Short name for execute-in-own-window option.
|
9
|
+
- Short name for load-code option.
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
|
13
|
+
- Improve handling of variations of block names.
|
14
|
+
- Remove functions to select recent saved assets.
|
15
|
+
|
3
16
|
## [2.1.0] - 2024-07-15
|
4
17
|
|
5
18
|
### Added
|
@@ -555,7 +568,7 @@ Most options can be configured in multiple ways. In order of use (earliest super
|
|
555
568
|
2. the configuration file `.mde.yml` in the current folder
|
556
569
|
3. command line arguments
|
557
570
|
|
558
|
-
|
571
|
+
### Representing boolean values
|
559
572
|
|
560
573
|
Boolean values for options are specified as strings and interpreted as:
|
561
574
|
| 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.2.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.2.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,27 @@
|
|
1
|
+
## Demonstrate handling of special characters in block names
|
2
|
+
The hidden block "(success)" is required below. It prints "Success".
|
3
|
+
```bash :(success)
|
4
|
+
echo "Success"
|
5
|
+
```
|
6
|
+
Block names with all chars.
|
7
|
+
/ UTF-8
|
8
|
+
/ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
|
9
|
+
/ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
|
10
|
+
::: Click below to trigger. If it prints "Success", the Link block was processed.
|
11
|
+
This block name uses the printable characters in the first 128 values. It is executable.
|
12
|
+
```link :!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
|
13
|
+
block: (success)
|
14
|
+
```
|
15
|
+
This block name uses the printable characters in the second 128 values. It is executable.
|
16
|
+
```link :¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
|
17
|
+
block: (success)
|
18
|
+
```
|
19
|
+
|
20
|
+
## Block formatting
|
21
|
+
The un-named block should display correctly.
|
22
|
+
```link
|
23
|
+
file: examples/linked2.md
|
24
|
+
block: show_vars
|
25
|
+
vars:
|
26
|
+
page2_var_via_environment: for_page2_from_page1_via_current_environment
|
27
|
+
```
|