markdown_exec 3.0.8 → 3.1.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.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/Gemfile.lock +1 -1
  4. data/bats/block-type-ux-required-variables.bats +0 -12
  5. data/bats/block-type-ux-sources.bats +0 -8
  6. data/bats/cli.bats +12 -0
  7. data/bats/import-with-text-substitution.bats +9 -0
  8. data/bats/load-vars-state-demo.bats +26 -0
  9. data/bats/options.bats +1 -1
  10. data/docs/dev/import-substitution-basic.md +5 -0
  11. data/docs/dev/import-substitution-compare.md +12 -0
  12. data/docs/dev/import-substitution-export.md +18 -0
  13. data/docs/dev/import-substitution-long.md +12 -0
  14. data/docs/dev/import-substitution-mixed.md +9 -0
  15. data/docs/dev/import-substitution-plant.md +11 -0
  16. data/docs/dev/import-substitution-quotes.md +7 -0
  17. data/docs/dev/import-substitution-research.md +11 -0
  18. data/docs/dev/import-substitution-simple.md +5 -0
  19. data/docs/dev/import-substitution-special.md +10 -0
  20. data/docs/dev/import-substitution-taxonomy.md +14 -0
  21. data/docs/dev/import-with-text-substitution.md +57 -0
  22. data/docs/dev/linked-file.md +3 -0
  23. data/docs/dev/load-mode-demo.md +163 -0
  24. data/docs/dev/requiring-blocks.md +1 -0
  25. data/examples/import_with_substitution_demo.md +48 -0
  26. data/examples/imports/mixed_template.md +33 -0
  27. data/examples/imports/organism_template.md +42 -0
  28. data/examples/imports/template_mustache.md +22 -0
  29. data/examples/imports/template_vars.md +22 -0
  30. data/examples/raw_replacement_demo.md +42 -0
  31. data/examples/recent_discoveries_demo.md +43 -0
  32. data/examples/template_syntax_demo.md +24 -0
  33. data/lib/cached_nested_file_reader.rb +174 -28
  34. data/lib/command_result.rb +3 -2
  35. data/lib/constants.rb +5 -0
  36. data/lib/evaluate_shell_expressions.rb +0 -1
  37. data/lib/exceptions.rb +10 -2
  38. data/lib/fcb.rb +20 -14
  39. data/lib/hash_delegator.rb +192 -125
  40. data/lib/markdown_exec/version.rb +1 -1
  41. data/lib/mdoc.rb +2 -1
  42. data/lib/menu.src.yml +2 -1
  43. data/lib/menu.yml +2 -1
  44. data/lib/ww.rb +24 -0
  45. metadata +25 -2
data/lib/menu.src.yml CHANGED
@@ -580,7 +580,8 @@
580
580
 
581
581
  - :opt_name: import_pattern
582
582
  :env_var: MDE_IMPORT_PATTERN
583
- :default: "^(?<indention> *)@import +(?<name>.+?) *$"
583
+ :default: >-
584
+ ^(?<indention> *)@import +(?<name>\S+)(?<params>(?: +[A-Za-z_]\w*=(?:"[^"]*"|'[^']*'|\S+))*) *$
584
585
  :procname: val_as_str
585
586
 
586
587
  - :opt_name: line_decor_main
data/lib/menu.yml CHANGED
@@ -490,7 +490,8 @@
490
490
  :procname: val_as_str
491
491
  - :opt_name: import_pattern
492
492
  :env_var: MDE_IMPORT_PATTERN
493
- :default: "^(?<indention> *)@import +(?<name>.+?) *$"
493
+ :default: '^(?<indention> *)@import +(?<name>\S+)(?<params>(?: +[A-Za-z_]\w*=(?:"[^"]*"|''[^'']*''|\S+))*)
494
+ *$'
494
495
  :procname: val_as_str
495
496
  - :opt_name: line_decor_main
496
497
  :env_var: MDE_LINE_DECOR_MAIN
data/lib/ww.rb CHANGED
@@ -22,6 +22,30 @@ def ww(*objs, **kwargs)
22
22
  ww0(*objs, **kwargs.merge(locations: caller_locations))
23
23
  end
24
24
 
25
+ # select enabled, for exceptions
26
+ # print a data object for the error, and the failing line
27
+ def wwe(*objs, **kwargs)
28
+ ww0(*objs, **kwargs.merge(locations: caller_locations[0..0]))
29
+
30
+ raise StandardError, objs.first[:error]
31
+ end
32
+
33
+ # selectively enabled, for process tracking
34
+ # print the failing line
35
+ def wwp(*objs, **kwargs)
36
+ ww(*objs, **kwargs.merge(locations: caller_locations[0..0]))
37
+ end
38
+
39
+ # selectively enabled, for tagged
40
+ # print the failing line
41
+ # eg wwt :line, 'data:', data
42
+ def wwt(*objs, **kwargs)
43
+ # return if [:line].include? objs.first
44
+
45
+ formatted = ['Tagged', objs.first] + objs[1..]
46
+ ww(*formatted, **kwargs.merge(locations: caller_locations[0..0]))
47
+ end
48
+
25
49
  def ww0(*objs,
26
50
  category: nil,
27
51
  full_backtrace: false,
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: 3.0.8
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fareed Stevenson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-06-11 00:00:00.000000000 Z
11
+ date: 2025-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard
@@ -139,11 +139,13 @@ files:
139
139
  - bats/history.bats
140
140
  - bats/import-conflict.bats
141
141
  - bats/import-duplicates.bats
142
+ - bats/import-with-text-substitution.bats
142
143
  - bats/import.bats
143
144
  - bats/indented-block-type-vars.bats
144
145
  - bats/indented-multi-line-output.bats
145
146
  - bats/line-decor-dynamic.bats
146
147
  - bats/line-wrapping.bats
148
+ - bats/load-vars-state-demo.bats
147
149
  - bats/markup.bats
148
150
  - bats/mde.bats
149
151
  - bats/option-expansion.bats
@@ -197,12 +199,25 @@ files:
197
199
  - docs/dev/import-duplicates-0.md
198
200
  - docs/dev/import-duplicates-1.md
199
201
  - docs/dev/import-missing.md
202
+ - docs/dev/import-substitution-basic.md
203
+ - docs/dev/import-substitution-compare.md
204
+ - docs/dev/import-substitution-export.md
205
+ - docs/dev/import-substitution-long.md
206
+ - docs/dev/import-substitution-mixed.md
207
+ - docs/dev/import-substitution-plant.md
208
+ - docs/dev/import-substitution-quotes.md
209
+ - docs/dev/import-substitution-research.md
210
+ - docs/dev/import-substitution-simple.md
211
+ - docs/dev/import-substitution-special.md
212
+ - docs/dev/import-substitution-taxonomy.md
213
+ - docs/dev/import-with-text-substitution.md
200
214
  - docs/dev/import.md
201
215
  - docs/dev/indented-block-type-vars.md
202
216
  - docs/dev/indented-multi-line-output.md
203
217
  - docs/dev/line-decor-dynamic.md
204
218
  - docs/dev/line-wrapping.md
205
219
  - docs/dev/linked-file.md
220
+ - docs/dev/load-mode-demo.md
206
221
  - docs/dev/load1.sh
207
222
  - docs/dev/load_code.md
208
223
  - docs/dev/manage-saved-documents.md
@@ -236,6 +251,11 @@ files:
236
251
  - examples/example-document-opts.md
237
252
  - examples/import0.md
238
253
  - examples/import1.md
254
+ - examples/import_with_substitution_demo.md
255
+ - examples/imports/mixed_template.md
256
+ - examples/imports/organism_template.md
257
+ - examples/imports/template_mustache.md
258
+ - examples/imports/template_vars.md
239
259
  - examples/include.md
240
260
  - examples/indent.md
241
261
  - examples/index.md
@@ -259,9 +279,12 @@ files:
259
279
  - examples/pause-after-execution.md
260
280
  - examples/plant.md
261
281
  - examples/port-blocks.md
282
+ - examples/raw_replacement_demo.md
283
+ - examples/recent_discoveries_demo.md
262
284
  - examples/save.md
263
285
  - examples/search.md
264
286
  - examples/table-markup.md
287
+ - examples/template_syntax_demo.md
265
288
  - examples/text-markup.md
266
289
  - examples/title.md
267
290
  - examples/variable-expansion-save-block.md