markdown_exec 3.4.0 → 3.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec9a613148346890f4db46f3f5bdcade05b8e2221e92402c431fa9a359556e1e
4
- data.tar.gz: 05d16eaf1ac5d433c8da62513da88159313e3b2898d36d7dfa0d71061c83a97b
3
+ metadata.gz: 4a4c6bcbb464222e907cb93cc549ef294d45b83f0f8be5e88e603b87c64eb7a4
4
+ data.tar.gz: dfce2b71eb6c954e3d438b6036b6543da7bcfe63178ca56971ddb198f49852db
5
5
  SHA512:
6
- metadata.gz: 9dcec89e521fc194eb329b36dc83068a11215186c5e3e5447485000a40c8e75f8bdabd10824af34b9ff90fee3f0899d5bb0f82f76f4ffa3a0a950d213585e6a5
7
- data.tar.gz: 06b8fb5443b026e628fd60962bd9c7abbccd78824ea0d0b001f27b4608cc0cb147fff6fa00eac5de3712ed97f76d50296b35368675478992e06b28db06b29dfc
6
+ metadata.gz: c7b2076de902483e3f2362b8319d99f1876c7f41e7ffd1815e92278803d55776f700df721dc16700064c890c7c48628657ef2bf4003ba989b7c6eee1c27a9088
7
+ data.tar.gz: ed8705a9687dc56cbef235fe0821065653852d5b1e1c05293a9ea53baf08a7a12c24fdc5e909e9dd04047378d664ddb0b8e7d644e38d54c753ef1a470138ce60
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.5.0] - 2025-11-13
4
+
5
+ ### Added
6
+
7
+ - MP4 with demonstration of Bash "trap" command.
8
+ - Type casting for tokens in imported documents.
9
+ - Default color for fenced code blocks per type.
10
+ - Shell blocks can require UX blocks.
11
+ - Common markdown patterns for text decorations.
12
+
13
+ ### Changed
14
+
15
+ - README.md
16
+
3
17
  ## [3.4.0] - 2025-09-16
4
18
 
5
19
  ### Added
data/Gemfile CHANGED
@@ -12,6 +12,7 @@ gem 'erb'
12
12
  gem 'irb'
13
13
  gem 'mocha', require: false
14
14
  gem 'minitest', require: false
15
+ gem 'minitest-reporters', require: false
15
16
  gem 'pry-nav'
16
17
  gem 'pry-stack_explorer'
17
18
  gem 'railties'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- markdown_exec (3.4.0)
4
+ markdown_exec (3.5.0)
5
5
  clipboard (~> 1.3.6)
6
6
  open3 (~> 0.1.1)
7
7
  optparse (~> 0.1.1)
@@ -37,6 +37,7 @@ GEM
37
37
  minitest (>= 5.1)
38
38
  mutex_m
39
39
  tzinfo (~> 2.0)
40
+ ansi (1.5.0)
40
41
  ast (2.4.2)
41
42
  base64 (0.2.0)
42
43
  bigdecimal (3.1.8)
@@ -98,6 +99,11 @@ GEM
98
99
  nokogiri (>= 1.12.0)
99
100
  method_source (1.1.0)
100
101
  minitest (5.24.1)
102
+ minitest-reporters (1.7.1)
103
+ ansi
104
+ builder
105
+ minitest (>= 5.0)
106
+ ruby-progressbar
101
107
  mocha (2.4.5)
102
108
  ruby2_keywords (>= 0.0.5)
103
109
  mutex_m (0.2.0)
@@ -227,6 +233,7 @@ DEPENDENCIES
227
233
  irb
228
234
  markdown_exec!
229
235
  minitest
236
+ minitest-reporters
230
237
  mocha
231
238
  pry-nav
232
239
  pry-stack_explorer
data/README.md CHANGED
@@ -1,150 +1,271 @@
1
1
  # MarkdownExec
2
2
 
3
- Interactively select and execute fenced code blocks in markdown files. Build complex scripts by naming and requiring blocks. Log resulting scripts and output. Re-run scripts.
4
-
5
- * Code blocks may be named. Named blocks can be required by other blocks.
6
-
7
- * The user-selected code block, and all required blocks, are arranged into a script in the order they appear in the markdown file. The script can be presented for approval prior to execution.
8
-
9
- * Executed scripts can be saved. Saved scripts can be listed, selected, and executed.
10
-
11
- * Output from executed scripts can be saved.
12
-
13
- ## Screenshots
14
-
15
- ### Select a file
16
-
17
- ![Select a file](/assets/select_a_file.png)
18
-
19
- ### Select a block
20
-
21
- ![Select a block](/assets/select_a_block.png)
22
-
23
- ### Approve code
24
-
25
- ![Approve code](/assets/approve_code.png)
26
-
27
- ### Output
28
-
29
- ![Output of execution](/assets/output_of_execution.png)
30
-
31
- ### Example blocks
32
-
33
- ![Example blocks](/assets/example_blocks.png)
3
+ [![MarkdownExec For Interactive Bash Instruction](https://raw.githubusercontent.com/fareedst/markdown_exec/main/demo/trap.demo1.gif)](https://raw.githubusercontent.com/fareedst/markdown_exec/main/demo/trap.demo1.mp4)
4
+
5
+ *Click the GIF above to view the full video with audio (MP4)*
6
+
7
+ Transform static markdown into interactive, executable workflows. Build complex scripts with named blocks, interactive forms, cross-document navigation, and template systems.
8
+
9
+ ## Key Features
10
+
11
+ ### Interactive Code Execution
12
+ - **Named Blocks**: Create reusable code blocks with dependencies
13
+ - **Block Requirements**: Automatically include required blocks in execution order
14
+ - **Interactive Selection**: Choose blocks from intuitive menus
15
+ - **Script Approval**: Review generated scripts before execution
16
+
17
+ ### UX Blocks - Interactive Forms
18
+ - **Variable Input**: Create interactive forms for user input
19
+ - **Validation**: Built-in regex validation with custom transforms
20
+ - **Dynamic Menus**: Selection from allowed values or command output
21
+ - **Auto-initialization**: Set values from environment, commands, or defaults
22
+ - **Dependencies**: Chain UX blocks with complex relationships
23
+
24
+ ### Cross-Document Navigation
25
+ - **Link Blocks**: Navigate between markdown files seamlessly
26
+ - **Variable Passing**: Share data between documents
27
+ - **Inherited Context**: Maintain state across document boundaries
28
+ - **HyperCard-style Navigation**: Create interactive document stacks
29
+
30
+ ### Template System & Imports
31
+ - **Import Directives**: Include content from other files with `@import`
32
+ - **Parameter Substitution**: Replace variables in imported content
33
+ - **Shell Expansions**: Use `${variable}` and `$(command)` syntax throughout documents
34
+ - **Dynamic Content**: Generate content based on user selections
35
+
36
+ ### Advanced Block Types
37
+ - **Shell Blocks**: Execute bash shells
38
+ - **UX Blocks**: Interactive forms with validation, transforms, and dynamic behavior
39
+ - **Vars Blocks**: Define variables in YAML format
40
+ - **Opts Blocks**: Configure document behavior and appearance
41
+ - **Link Blocks**: Cross-document navigation and variable passing
42
+
43
+ ### State Management
44
+ - **Script Persistence**: Save and replay executed scripts
45
+ - **Output Logging**: Capture and review execution results
46
+ - **State Inheritance**: Manage context across sessions
47
+ - **Configuration**: Flexible options via environment, files, or CLI
34
48
 
35
49
  ## Installation
36
50
 
37
- Install:
38
- $ gem install markdown_exec
51
+ ```bash
52
+ gem install markdown_exec
53
+ ```
39
54
 
40
- ## Usage
55
+ ## Quick Start
41
56
 
42
- ### Help
57
+ ### Interactive Mode (Recommended)
58
+ ```bash
59
+ mde # Process README.md in current folder
60
+ mde my-document.md # Process specific markdown file
61
+ mde . # Select from markdown files in current folder
62
+ ```
43
63
 
44
- ::: `mde --help`
64
+ ### Command Line Mode
65
+ ```bash
66
+ mde my-document.md my-block # Execute specific block directly
67
+ mde --list-blocks # List all available blocks
68
+ mde --list-docs # List all markdown documents
69
+ ```
45
70
 
46
- Displays help information.
71
+ ## Interactive Features
47
72
 
48
- ### Basic
73
+ ### UX Blocks - Interactive Forms
49
74
 
50
- ::: `mde`
75
+ Create interactive forms that prompt users for input:
51
76
 
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].
77
+ <pre><code>```ux
78
+ name: USER_NAME
79
+ prompt: Enter your name
80
+ init: Guest
81
+ ```
82
+ </code></pre>
83
+
84
+ <pre><code>```ux
85
+ name: ENVIRONMENT
86
+ allow:
87
+ - development
88
+ - staging
89
+ - production
90
+ prompt: Select environment
91
+ ```
92
+ </code></pre>
53
93
 
54
- ::: `mde my.md` or `mde -f my.md`
94
+ <pre><code>```ux
95
+ name: EMAIL
96
+ prompt: Enter email address
97
+ validate: '(?<local>[^@]+)@(?<domain>[^@]+)'
98
+ transform: '%{local}@%{domain}'
99
+ ```
100
+ </code></pre>
55
101
 
56
- Select a block to execute from `my.md`.
102
+ ### Cross-Document Navigation
57
103
 
58
- ::: `mde my.md myblock`
104
+ Navigate between documents while maintaining context:
59
105
 
60
- Execute the block named `myblock` from `my.md`.
106
+ <pre><code>```link
107
+ file: next-document.md
108
+ vars:
109
+ current_user: ${USER_NAME}
110
+ environment: ${ENVIRONMENT}
111
+ ```
112
+ </code></pre>
61
113
 
62
- ::: `mde .` or `mde -p .`
114
+ ### Template System
63
115
 
64
- Select a markdown file in the current folder. Select a block to execute from that file.
116
+ Use imports with parameter substitution:
65
117
 
66
- ### Report documents and blocks
118
+ ```
119
+ @import template.md USER_NAME=John ENVIRONMENT=production
120
+ ```
121
+ </code></pre>
67
122
 
68
- ::: `mde --list-blocks`
123
+ ### Block Dependencies
69
124
 
70
- List all blocks in the all the markdown documents in the current folder.
125
+ Create complex workflows with automatic dependency resolution:
71
126
 
72
- ::: `mde --list-docs`
127
+ <pre><code>```bash :deploy +setup +test +deploy
128
+ echo "Deploying to ${ENVIRONMENT}"
129
+ ```
130
+ </code></pre>
73
131
 
74
- List all markdown documents in the current folder.
132
+ <pre><code>```bash :setup
133
+ echo "Setting up environment"
134
+ ```
135
+ </code></pre>
75
136
 
76
- ### Configuration
137
+ <pre><code>```bash :test
138
+ echo "Running tests"
139
+ ```
140
+ </code></pre>
77
141
 
78
- ::: `mde --list-default-env` or `mde --list-default-yaml`
142
+ ## Advanced Usage
79
143
 
80
- List default values that can be set in configuration file, environment, and command line.
144
+ ### Configuration
81
145
 
82
- ::: `mde -0`
146
+ ```
147
+ # Environment variables
148
+ export MDE_SAVE_EXECUTED_SCRIPT=1
149
+ export MDE_USER_MUST_APPROVE=1
83
150
 
84
- Show current configuation values that will be applied to the current run. Does not interrupt processing.
151
+ # Configuration file (.mde.yml)
152
+ save_executed_script: true
153
+ user_must_approve: true
85
154
 
86
- ### Save scripts
155
+ # Command line
156
+ mde --save-executed-script 1 --user-must-approve 1
157
+ ```
87
158
 
88
- ::: `mde --save-executed-script 1`
159
+ ### Script Management
89
160
 
90
- Save executed script in saved script folder.
161
+ ```bash
162
+ mde --save-executed-script 1 # Save executed scripts
163
+ mde --list-recent-scripts # List saved scripts
164
+ mde --select-recent-script # Execute saved script
165
+ mde --save-execution-output 1 # Save execution output
166
+ ```
91
167
 
92
- ::: `mde --list-recent-scripts`
168
+ ## Block Types Reference
93
169
 
94
- List recent saved scripts in saved script folder.
170
+ ### Shell Blocks
171
+ <pre><code>```bash
172
+ echo "Hello World"
173
+ ```
174
+ </code></pre>
95
175
 
96
- ::: `mde --select-recent-script`
176
+ ### UX Blocks (Interactive Forms)
177
+ <pre><code>```ux
178
+ name: USER_NAME
179
+ prompt: Enter your name
180
+ init: Guest
181
+ ```
182
+ </code></pre>
183
+
184
+ <pre><code>```ux
185
+ name: ENVIRONMENT
186
+ allow:
187
+ - development
188
+ - staging
189
+ - production
190
+ act: :allow
191
+ ```
192
+ </code></pre>
97
193
 
98
- Select and execute a recently saved script in saved script folder.
194
+ <pre><code>```ux
195
+ name: CURRENT_DIR
196
+ exec: basename $(pwd)
197
+ transform: :chomp
198
+ ```
199
+ </code></pre>
99
200
 
100
- ### Save output
201
+ <pre><code>```ux
202
+ name: EMAIL
203
+ prompt: Enter email address
204
+ validate: '(?<local>[^@]+)@(?<domain>[^@]+)'
205
+ transform: '%{local}@%{domain}'
206
+ ```
207
+ </code></pre>
101
208
 
102
- ::: `mde --save-execution-output 1`
209
+ ### Variable Blocks
210
+ <pre><code>```vars
211
+ DATABASE_URL: postgresql://localhost:5432/myapp
212
+ DEBUG: true
213
+ ```
214
+ </code></pre>
103
215
 
104
- Save execution output in saved output folder.
216
+ ### Link Blocks (Cross-Document Navigation)
217
+ <pre><code>```link
218
+ file: next-page.md
219
+ vars:
220
+ current_user: ${USER_NAME}
221
+ ```
222
+ </code></pre>
223
+
224
+ ### Data Blocks (YAML)
225
+ <pre><code>```yaml
226
+ users:
227
+ - name: John
228
+ role: admin
229
+ - name: Jane
230
+ role: user
231
+ ```
232
+ </code></pre>
105
233
 
106
- ## Behavior
234
+ ### Import Directives
235
+ ```
236
+ @import template.md USER_NAME=John ENVIRONMENT=production
237
+ ```
107
238
 
108
- * If no file and no folder are specified, blocks within `./README.md` are presented.
109
- * If a file is specified, its blocks are presented.
110
- * If a folder is specified, its files are presented. When a file is selected, its blocks are presented.
239
+ ### Options Blocks
240
+ <pre><code>```opts :(document_opts)
241
+ user_must_approve: true
242
+ save_executed_script: true
243
+ menu_ux_row_format: 'DEFAULT %{name} = ${%{name}}'
244
+ ```
245
+ </code></pre>
111
246
 
112
247
  ## Configuration
113
248
 
114
249
  ### Environment Variables
115
-
116
- When executed, `mde` reads the current environment.
117
- * Configuration in current and children shells, e.g. `export MDE_SAVE_EXECUTED_SCRIPT=1`.
118
- * Configuration for the current command, e.g. `MDE_SAVE_EXECUTED_SCRIPT=1 mde`.
250
+ <pre><code>```bash
251
+ export MDE_SAVE_EXECUTED_SCRIPT=1
252
+ export MDE_USER_MUST_APPROVE=1
253
+ ```
254
+ </code></pre>
119
255
 
120
256
  ### Configuration Files
257
+ <pre><code>```yaml
258
+ # .mde.yml
259
+ save_executed_script: true
260
+ user_must_approve: true
261
+ menu_with_inherited_lines: true
262
+ ```
263
+ </code></pre>
121
264
 
122
- * Configuration in all shells, e.g. environment variables set in your user's `~/.bashrc` or `~/.bash_profile` files.
123
- * Configuration in the optional file `.mde.yml` in the current folder. .e.g. `save_executed_script: true`
124
- * Configuration in a YAML file and read while parsing the inputs, e.g. `--config my_path/my_file.yml`
125
-
126
- ### Program Arguments
127
-
128
- * Configuration in command options, e.g. `mde --save-executed-script 1`
129
-
130
- ## Representing boolean values
131
-
132
- Boolean values expressed as strings are interpreted as:
133
- | String | Boolean |
134
- | :---: | :---: |
135
- | *empty string* | False |
136
- | `0` | False |
137
- | `1` | True |
138
- | *anything else* | True |
139
-
140
- E.g. `opt1=1` will set option `opt1` to True.
141
-
142
- Boolean options configured with environment variables:
143
- - Set to `1` or non-empty value to save executed scripts; empty or `0` to disable saving.
144
- e.g. `export MDE_SAVE_EXECUTED_SCRIPT=1`
145
- e.g. `export MDE_SAVE_EXECUTED_SCRIPT=`
146
- - Specify variable on command line.
147
- e.g. `MDE_SAVE_EXECUTED_SCRIPT=1 mde`
265
+ ### Command Line Options
266
+ ```bash
267
+ mde --save-executed-script 1 --user-must-approve 1 --config my-config.yml
268
+ ```
148
269
 
149
270
  ## Tab Completion
150
271
 
@@ -152,7 +273,7 @@ Boolean options configured with environment variables:
152
273
 
153
274
  Append a command to load the completion script to your shell configuration file. `mde` must be executable for the command to be composed correctly.
154
275
 
155
- ```bash :()
276
+ ```bash
156
277
  echo "source $(mde --pwd)/bin/tab_completion.sh" >> ~/.bash_profile
157
278
  ```
158
279
 
@@ -179,29 +300,54 @@ In the table below, tab is indicated by `!`
179
300
  | `mde --user-must-approve !` | `mde --user-must-approve .BOOL.`|
180
301
  | `mde --user-must-approve .BOOL.!` | `mde --user-must-approve 1` |
181
302
 
182
- ## Example Blocks
303
+ ## Example: Interactive Workflow
183
304
 
184
- When prompted, select either the `awake` or `asleep` block.
305
+ This example demonstrates a complete interactive workflow with UX blocks, dependencies, and cross-document navigation:
185
306
 
186
- ``` :(day)
187
- export TIME=early
307
+ ### Step 1: User Input
308
+ <pre><code>```ux :user-setup
309
+ name: USER_NAME
310
+ prompt: Enter your name
311
+ init: Guest
188
312
  ```
189
-
190
- ``` :(night)
191
- export TIME=late
313
+ </code></pre>
314
+
315
+ <pre><code>```ux :environment
316
+ name: ENVIRONMENT
317
+ allow:
318
+ - development
319
+ - staging
320
+ - production
321
+ prompt: Select environment
192
322
  ```
323
+ </code></pre>
193
324
 
194
- ``` :awake +(day) +(report)
195
- export ACTIVITY=awake
325
+ ### Step 2: Automated Setup
326
+ Prompts the user for both values and generates output.
327
+ <pre><code>```bash :setup +user-setup +environment
328
+ echo "Setting up for user: ${USER_NAME}"
329
+ echo "Environment: ${ENVIRONMENT}"
196
330
  ```
197
-
198
- ``` :asleep +(night) +(report)
199
- export ACTIVITY=asleep
331
+ </code></pre>
332
+
333
+ ### Step 3: Conditional Logic
334
+ <pre><code>```bash :deploy +setup
335
+ if [ "${ENVIRONMENT}" = "production" ]; then
336
+ echo "Deploying to production with extra safety checks"
337
+ else
338
+ echo "Deploying to ${ENVIRONMENT}"
339
+ fi
200
340
  ```
201
-
202
- ``` :(report)
203
- echo "$TIME -> $ACTIVITY"
341
+ </code></pre>
342
+
343
+ ### Step 4: Cross-Document Navigation
344
+ <pre><code>```link
345
+ file: next-workflow.md
346
+ vars:
347
+ user: ${USER_NAME}
348
+ env: ${ENVIRONMENT}
204
349
  ```
350
+ </code></pre>
205
351
 
206
352
  # Testing
207
353
 
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env bats
2
+
3
+ load 'test_helper'
4
+
5
+ @test 'initial' {
6
+ spec_mde_xansi_dname_doc_blocks_expect docs/dev/block-type-shell-require-ux.md \
7
+ 'require-a-UX-block__FULL_NAME='
8
+ }
9
+
10
+ @test 'activated' {
11
+ # 2025-11-13 add a '.' block to force the display to update
12
+ spec_mde_xansi_dname_doc_blocks_expect docs/dev/block-type-shell-require-ux.md \
13
+ require-a-UX-block . \
14
+ '__require-a-UX-block_Mythical_Monkey_FULL_NAME=Mythical Monkey'
15
+ }
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env bats
2
+
3
+ load 'test_helper'
4
+
5
+ @test 'initial' {
6
+ spec_mde_xansi_dname_doc_blocks_expect docs/dev/block-type-ux-require-context.md \
7
+ 'Get the common name..._Entity: _ENTITY2: _UX1: _Common name: '
8
+ }
9
+
10
+ @test 'activated' {
11
+ spec_mde_xansi_dname_doc_blocks_expect docs/dev/block-type-ux-require-context.md \
12
+ \[ux1\] \
13
+ 'Get the common name..._Entity: _ENTITY2: Mythical Monkey_UX1: Mythical Monkey_Common name: Mythical Monkey'
14
+ }
@@ -5,5 +5,5 @@ load 'test_helper'
5
5
  @test '' {
6
6
  spec_mde_xansi_dname_doc_blocks_expect docs/dev/import-directive-line-continuation.md \
7
7
  --blocks dname \
8
- 'Stem: U1_Species: Illacme tobini_Genus: Illacme'
8
+ 'Stem: U1_Species: Illacme tobini'
9
9
  }
@@ -5,5 +5,5 @@ load 'test_helper'
5
5
  @test '' {
6
6
  spec_mde_xansi_dname_doc_blocks_expect docs/dev/import-directive-parameter-symbols.md \
7
7
  --blocks dname \
8
- 'Stem: U1_Species: Illacme tobini_Genus: Illacme_Stem: U2_Species: Hydrodynastes bicinctus_Genus: Hydrodynastes'
8
+ 'Stem: U1_Species: Illacme tobini_Stem: U2_Species: Hydrodynastes bicinctus'
9
9
  }
@@ -4,5 +4,5 @@ load 'test_helper'
4
4
 
5
5
  @test 'Initial values' {
6
6
  spec_mde_xansi_dname_doc_blocks_expect docs/dev/import-parameter-symbols.md \
7
- 'COMMON_NAME=Tapanuli Orangutan_Command substitution: Tapanuli Orangutan_echo "Command substitution: ${NAMEC}"__Evaluated expression: Tapanuli Orangutan_echo "Evaluated expression: ${NAMEE}"__Raw literal: Tapanuli Orangutan_echo "Raw literal: Tapanuli Orangutan"__Force-quoted literal: Tapanuli Orangutan_echo "Force-quoted literal: ${NAMEQ}"__Variable reference: Tapanuli Orangutan_echo "Variable reference: ${COMMON_NAME}"'
7
+ 'COMMON_NAME=Tapanuli Orangutan_Evaluated expression: Tapanuli Orangutan_echo "Evaluated expression: $(printf %s "$COMMON_NAME")"__Raw literal: Tapanuli Orangutan_echo "Raw literal: Tapanuli Orangutan"__Force-quoted literal: Tapanuli Orangutan_echo "Force-quoted literal: Tapanuli Orangutan"__Variable reference: Tapanuli Orangutan_echo "Variable reference: ${COMMON_NAME}"'
8
8
  }
data/bats/options.bats CHANGED
@@ -30,13 +30,13 @@ load 'test_helper'
30
30
  @test 'Options - list blocks' {
31
31
  BATS_OUTPUT_FILTER=A
32
32
  spec_mde_args_expect --list-blocks-message oname --list-blocks-type 0 examples/colors.md --list-blocks \
33
- 'load_colors load_colors2 Bash1 Edit1 History1 Link1 Load1 Opts1 Port1 Save1 Vars1'
33
+ 'load_colors load_colors2 Unspecified1 Unknown1 Bash1 Edit-inherited-blocks History1 Link1 Load1 Opts1 Port1 Save1 Vars1'
34
34
  }
35
35
 
36
36
  @test 'Options - list blocks, eval' {
37
37
  BATS_OUTPUT_FILTER=A
38
38
  spec_mde_args_expect --list-blocks-eval block.oname examples/colors.md --list-blocks \
39
- 'load_colors load_colors2 Bash1 Edit1 History1 Link1 Load1 Opts1 Port1 Save1 Vars1'
39
+ 'load_colors load_colors2 Unspecified1 Unknown1 Bash1 Edit-inherited-blocks History1 Link1 Load1 Opts1 Port1 Save1 Vars1'
40
40
  }
41
41
 
42
42
  @test 'Options - how' {
Binary file
Binary file
@@ -0,0 +1,18 @@
1
+ / No blocks are evaluated at initialization.
2
+ / When the shell block is activated, the UX block is required.
3
+ ```bash :require-a-UX-block +[ux1]
4
+ ENTITY='Mythical Monkey'
5
+ ```
6
+ / Display variables set in the UX block.
7
+ ${FIRST}
8
+ ${LAST}
9
+ / Parse and copy the name into variables.
10
+ ```ux :[ux1]
11
+ echo:
12
+ FIRST: '${ENTITY%% *}'
13
+ LAST: '${ENTITY##* }'
14
+ FULL_NAME: '$ENTITY'
15
+ init: false
16
+ readonly: true
17
+ ```
18
+ @import bats-document-configuration.md
@@ -0,0 +1,10 @@
1
+ / v2025-06-28
2
+ / Demonstrate using a format key does not inhibit activation of the same block
3
+ /
4
+ ```ux
5
+ act: :echo
6
+ echo: '`date`'
7
+ format: 'Date: ${DATE}'
8
+ name: DATE
9
+ ```
10
+ @import bats-document-configuration.md
@@ -0,0 +1,32 @@
1
+ / Neither block is evaluated at initialization.
2
+ / When the first UX block is activated, it is evaluated.
3
+ / The variable set in the first UX block is available to the second,
4
+ / which is required by the first, resulting in its evaluation.
5
+ ```ux :[ux1] +[ux2] +(ENTITY)
6
+ act: :echo
7
+ echo:
8
+ UX1: '$ENTITY'
9
+ format: |-
10
+ Get the common name...
11
+ init: false
12
+ ```
13
+ / The shell required code and the first evaluated UX block are the context
14
+ / when the the `echo` expressions are being evaluated in the second UX block.
15
+ / The first evaluated UX block is the context when the `format` value is being expanded.
16
+ ```ux :[ux2]
17
+ act: :echo
18
+ echo:
19
+ UX2: '$UX1'
20
+ ENTITY2: '$ENTITY'
21
+ format: |-
22
+ Entity: ${ENTITY}
23
+ ENTITY2: ${ENTITY2}
24
+ UX1: ${UX1}
25
+ Common name: ${UX2}
26
+ init: false
27
+ readonly: true
28
+ ```
29
+ ```bash :(ENTITY)
30
+ ENTITY='Mythical Monkey'
31
+ ```
32
+ @import bats-document-configuration.md