markdown_exec 3.5.1 → 3.6.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/.ai-agent-instructions +54 -0
- data/.cursorrules +198 -0
- data/.rubocop.wide.yml +5 -0
- data/.rubocop.yml +7 -2
- data/CHANGELOG.md +19 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/ai-principles.md +516 -0
- data/architecture-decisions.md +190 -0
- data/bats/block-hide.bats +1 -1
- data/bats/block-type-bash.bats +5 -5
- data/bats/block-type-link.bats +1 -1
- data/bats/block-type-opts.bats +3 -3
- data/bats/block-type-port.bats +2 -2
- data/bats/block-type-shell-context-eval.bats +48 -0
- data/bats/block-type-shell-require-ux.bats +2 -2
- data/bats/block-type-ux-allowed.bats +4 -4
- data/bats/block-type-ux-auto.bats +1 -1
- data/bats/block-type-ux-chained.bats +1 -1
- data/bats/block-type-ux-default.bats +1 -1
- data/bats/block-type-ux-echo-hash-transform.bats +1 -1
- data/bats/block-type-ux-echo-hash.bats +2 -2
- data/bats/block-type-ux-echo.bats +4 -4
- data/bats/block-type-ux-exec-hash-transform.bats +1 -1
- data/bats/block-type-ux-exec-hash.bats +2 -2
- data/bats/block-type-ux-exec.bats +1 -1
- data/bats/block-type-ux-force.bats +2 -2
- data/bats/block-type-ux-formats.bats +1 -1
- data/bats/block-type-ux-hidden.bats +1 -1
- data/bats/block-type-ux-invalid.bats +2 -2
- data/bats/block-type-ux-readonly.bats +1 -1
- data/bats/block-type-ux-require-chained.bats +2 -2
- data/bats/block-type-ux-require-context.bats +2 -2
- data/bats/block-type-ux-require.bats +3 -3
- data/bats/block-type-ux-required-variables.bats +1 -1
- data/bats/block-type-ux-row-format.bats +1 -1
- data/bats/block-type-ux-sources.bats +4 -4
- data/bats/block-type-ux-transform.bats +1 -1
- data/bats/block-type-vars.bats +3 -3
- data/bats/border.bats +1 -1
- data/bats/cli.bats +11 -11
- data/bats/command-substitution-options.bats +2 -2
- data/bats/command-substitution.bats +1 -1
- data/bats/document-shell.bats +3 -3
- data/bats/history.bats +5 -5
- data/bats/import-conflict.bats +1 -1
- data/bats/import-directive-line-continuation.bats +1 -1
- data/bats/import-directive-parameter-symbols.bats +1 -1
- data/bats/import-duplicates.bats +6 -6
- data/bats/import-parameter-symbols.bats +1 -1
- data/bats/import-with-text-substitution.bats +1 -1
- data/bats/import.bats +4 -4
- data/bats/indented-block-type-vars.bats +1 -1
- data/bats/indented-multi-line-output.bats +1 -1
- data/bats/line-decor-dynamic.bats +1 -1
- data/bats/line-wrapping.bats +1 -1
- data/bats/load-vars-state-demo.bats +8 -8
- data/bats/markup.bats +4 -4
- data/bats/mde.bats +4 -4
- data/bats/option-expansion.bats +1 -1
- data/bats/options-collapse.bats +4 -4
- data/bats/options.bats +47 -17
- data/bats/plain.bats +1 -1
- data/bats/publish.bats +2 -2
- data/bats/table-column-truncate.bats +1 -1
- data/bats/table.bats +2 -2
- data/bats/variable-expansion-multiline.bats +1 -1
- data/bats/variable-expansion.bats +6 -6
- data/bin/tab_completion.sh +3 -3
- data/conversation-template.md +611 -0
- data/docs/block-execution-modes.md +177 -0
- data/docs/block-filtering.md +252 -0
- data/docs/block-naming-patterns.md +210 -0
- data/docs/block-scanning-patterns.md +248 -0
- data/docs/cli-reference.md +370 -0
- data/docs/dev/bats-document-configuration.md +1 -1
- data/docs/dev/block-hide.md +1 -1
- data/docs/dev/block-type-shell-context-eval.md +52 -0
- data/docs/dev/block-type-shell-require-ux.md +6 -2
- data/docs/dev/block-type-ux-echo.md +3 -3
- data/docs/dev/block-type-ux-force.md +1 -1
- data/docs/dev/block-type-ux-require-chained.md +1 -1
- data/docs/dev/block-type-ux-require.md +2 -2
- data/docs/dev/block-type-ux-transform.md +5 -4
- data/docs/dev/import-parameter-symbols.md +1 -1
- data/docs/dev/linked-file.md +1 -1
- data/docs/dev/load-vars-state-demo.md +1 -1
- data/docs/dev/print_bytes.md +3 -0
- data/docs/dev/requiring-blocks.md +1 -1
- data/docs/dev/shebang.md +6 -0
- data/docs/dev/specs.md +2 -2
- data/docs/docker-testing.md +5 -0
- data/docs/execution-control.md +384 -0
- data/docs/getting-started.md +209 -0
- data/docs/import-options.md +391 -0
- data/docs/shell-script-evaluation.md +78 -0
- data/docs/tab-completion.md +7 -0
- data/docs/ux-blocks.md +376 -0
- data/examples/link-blocks-vars.md +2 -2
- data/examples/linked.md +1 -1
- data/examples/linked1.md +1 -1
- data/examples/opts-blocks.md +2 -2
- data/examples/port-blocks.md +1 -1
- data/examples/variable-expansion.md +1 -1
- data/implementation-decisions.md +212 -0
- data/lib/cached_nested_file_reader.rb +145 -5
- data/lib/command_result.rb +27 -6
- data/lib/executed_shell_command.rb +512 -0
- data/lib/filter.rb +7 -7
- data/lib/hash_delegator.rb +699 -605
- data/lib/input_sequencer.rb +4 -3
- data/lib/link_history.rb +95 -36
- data/lib/markdown_exec/version.rb +1 -1
- data/lib/mdoc.rb +138 -51
- data/lib/menu.src.yml +115 -88
- data/lib/menu.yml +154 -88
- data/lib/transformed_shell_command.rb +449 -0
- data/lib/wl.rb +15 -0
- data/lib/ww.rb +17 -6
- data/requirements.md +111 -0
- data/semantic-tokens.md +132 -0
- data/tasks.md +69 -0
- metadata +29 -4
- data/docs/ux-blocks-examples.md +0 -120
- data/docs/ux-blocks-init-act.md +0 -100
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test 'dname' {
|
|
5
|
+
@test 'displays dname source values' {
|
|
6
6
|
spec_mde_xansi_message_doc_blocks_expect docs/dev/block-type-ux-sources.md \
|
|
7
7
|
dname \
|
|
8
8
|
'USER_NAME=Guest_CURRENT_DIR=markdown_exec_SHELL_VERSION=/bin/bash_ENVIRONMENT=development_USER_EMAIL=_VERSION='
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
@test 'init_source' {
|
|
11
|
+
@test 'displays init_source values' {
|
|
12
12
|
spec_mde_xansi_message_doc_blocks_expect docs/dev/block-type-ux-sources.md \
|
|
13
13
|
export_init \
|
|
14
14
|
'Guest_exec_echo_allow_false_false'
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@test 'act_source' {
|
|
17
|
+
@test 'displays act_source values' {
|
|
18
18
|
spec_mde_xansi_message_doc_blocks_expect docs/dev/block-type-ux-sources.md \
|
|
19
19
|
export_act \
|
|
20
20
|
'edit_edit_edit_allow_edit_edit'
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
@test 'is_disabled
|
|
23
|
+
@test 'checks is_disabled status' {
|
|
24
24
|
spec_mde_xansi_message_doc_blocks_expect docs/dev/block-type-ux-sources.md \
|
|
25
25
|
is_disabled? \
|
|
26
26
|
'false_false_false_false_false_false'
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'transforms output of executed commands' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/block-type-ux-transform.md \
|
|
7
7
|
'_Execution output has a trailing newline._Var0=markdown_exec__ 6d 61 72 6b 64 6f 77 6e 5f 65 78 65 63 0a __With validate and transform, output has no newline._Var1=markdown_exec_ 6d 61 72 6b 64 6f 77 6e 5f 65 78 65 63 __With transform :chomp, output has no newline._Var2=markdown_exec_ 6d 61 72 6b 64 6f 77 6e 5f 65 78 65 63 __With transform :upcase, output is in upper case w/ newline._Var3=MARKDOWN_EXEC__ 4d 41 52 4b 44 4f 57 4e 5f 45 58 45 43 0a '
|
|
8
8
|
}
|
data/bats/block-type-vars.bats
CHANGED
|
@@ -5,21 +5,21 @@ load 'test_helper'
|
|
|
5
5
|
# Type: Vars
|
|
6
6
|
|
|
7
7
|
# includes output from automatic vars blocks
|
|
8
|
-
@test '
|
|
8
|
+
@test 'loads vars block automatically' {
|
|
9
9
|
BATS_OUTPUT_FILTER=A
|
|
10
10
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/block-type-vars.md show \
|
|
11
11
|
'Species = Not specified_Genus = Not specified__Species: Not specified_VAULT: '
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
# includes output from assignment and from shell block
|
|
15
|
-
@test '
|
|
15
|
+
@test 'sets variable in vars block' {
|
|
16
16
|
BATS_OUTPUT_FILTER=A
|
|
17
17
|
spec_mde_args_expect docs/dev/block-type-vars.md '[set_vault_1]' show \
|
|
18
18
|
'Species = Not specified Genus = Not specified VAULT = 1 Species: Not specified VAULT: 1'
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
# handles invalid YAML in block
|
|
22
|
-
@test '
|
|
22
|
+
@test 'handles invalid YAML in vars block' {
|
|
23
23
|
BATS_OUTPUT_FILTER=A
|
|
24
24
|
spec_mde_args_expect docs/dev/block-type-vars.md '[invalid_yaml]' show \
|
|
25
25
|
'Species = Not specified Genus = Not specified Species: Not specified VAULT: '
|
data/bats/border.bats
CHANGED
data/bats/cli.bats
CHANGED
|
@@ -8,21 +8,21 @@ load 'test_helper'
|
|
|
8
8
|
' ARGS: 1 23'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
@test '
|
|
11
|
+
@test 'searches current directory when file not found' {
|
|
12
12
|
skip 'algorithm to exit waiting MDE is not ready'
|
|
13
13
|
BATS_OUTPUT_FILTER=A
|
|
14
14
|
BATS_SLEEP=8
|
|
15
15
|
spec_mde_args_expect NotFoundAnywhere 'Searching in: .'
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
@test '
|
|
18
|
+
@test 'reports error when block not found' {
|
|
19
19
|
BATS_OUTPUT_FILTER=A
|
|
20
20
|
BATS_STATUS=1
|
|
21
21
|
spec_mde_args_expect docs/dev/pass-through-arguments.md NonExistentBlock \
|
|
22
22
|
' Error: Block not found -- name: NonExistentBlock'
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
@test '
|
|
25
|
+
@test 'reports error when linked block missing' {
|
|
26
26
|
BATS_STATUS=1
|
|
27
27
|
spec_mde_args_expect docs/dev/requiring-blocks.md '[link-missing-local-block]' \
|
|
28
28
|
'Block missing'
|
|
@@ -30,46 +30,46 @@ load 'test_helper'
|
|
|
30
30
|
|
|
31
31
|
# Requiring blocks
|
|
32
32
|
|
|
33
|
-
@test 'bash block
|
|
33
|
+
@test 'bash block requires another bash block' {
|
|
34
34
|
BATS_OUTPUT_FILTER=A
|
|
35
35
|
spec_mde_args_expect docs/dev/requiring-blocks.md '[set-env]' \
|
|
36
36
|
' ARG1: 37'
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
@test 'vars
|
|
39
|
+
@test 'appends vars from link block to inherited lines - local' {
|
|
40
40
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/requiring-blocks.md \
|
|
41
41
|
'[link-local-block-with-vars]' \
|
|
42
42
|
'* Exit_# [link-local-block-with-vars]_ARG1="37"_block: echo-ARG1_ file: docs/dev/linked-file.md_ vars:_ ARG1: arg1-from-link-file_block: output_arguments_ vars:_ ARG1: 37_block: missing_ARG1=37_output_arguments'
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
@test 'vars
|
|
45
|
+
@test 'appends vars from link block to inherited lines - external' {
|
|
46
46
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/requiring-blocks.md \
|
|
47
47
|
'[link-file-block-with-vars]' \
|
|
48
48
|
'* Exit_# [link-file-block-with-vars]_ARG1="arg1-from-link-file"_echo-ARG1'
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
# the last block is a link block, so menu is displayed
|
|
52
|
-
@test 'link block
|
|
52
|
+
@test 'link block requires bash block' {
|
|
53
53
|
BATS_OUTPUT_FILTER=A
|
|
54
54
|
spec_mde_args_expect docs/dev/requiring-blocks.md '[link-local-block-with-vars]' $EXIT_MENU \
|
|
55
55
|
' ARG1: 37'
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
# the last block is a link block, so menu is displayed
|
|
59
|
-
@test 'link block
|
|
59
|
+
@test 'link block calls bash block in external file' {
|
|
60
60
|
BATS_OUTPUT_FILTER=A
|
|
61
61
|
spec_mde_args_expect docs/dev/requiring-blocks.md '[link-file-block-with-vars]' $EXIT_MENU \
|
|
62
62
|
' ARG1: arg1-from-link-file'
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
@test 'history' {
|
|
65
|
+
@test 'lists history files' {
|
|
66
66
|
file_name="$(most_recent_history_file_name)"
|
|
67
67
|
BATS_OUTPUT_GREP="$file_name"
|
|
68
68
|
spec_mde_args_expect examples/save.md --history \
|
|
69
69
|
"$file_name"
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
@test '
|
|
72
|
+
@test 'sifts history with text format' {
|
|
73
73
|
file_name="$(most_recent_history_file_name)"
|
|
74
74
|
date="$(date_from_history_file_name "$file_name")"
|
|
75
75
|
BATS_OUTPUT_GREP="$file_name"
|
|
@@ -77,7 +77,7 @@ load 'test_helper'
|
|
|
77
77
|
"$file_name"
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
@test '
|
|
80
|
+
@test 'sifts history with yaml format' {
|
|
81
81
|
file_name="$(most_recent_history_file_name)"
|
|
82
82
|
date="$(date_from_history_file_name "$file_name")"
|
|
83
83
|
BATS_OUTPUT_GREP="$file_name"
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'uses $ operator for variable expansion' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/command-substitution-options.md \
|
|
7
7
|
'operator_$' \
|
|
8
8
|
'Command substitution__The current value of environment variable Common_Name_is displayed using two different operators._The command echo $SHLVL is executed via command_substitution, using two different operators.__| Operator | Variable Expansion | Command Substitution |_| -------- | ------------------ | -------------------- |_| $ | Tapanuli Orangutan | Pongo tapanuliensis |_| @ | @{Common_Name} | @(echo $Species) |__Toggle between operators.__operator_$__operator_@'
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
@test '
|
|
11
|
+
@test 'uses @ operator for command substitution' {
|
|
12
12
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/command-substitution-options.md \
|
|
13
13
|
'Command substitution__The current value of environment variable Common_Name_is displayed using two different operators._The command echo $SHLVL is executed via command_substitution, using two different operators.__| Operator | Variable Expansion | Command Substitution |_| -------- | ------------------ | -------------------- |_| $ | ${Common_Name} | $(echo $Species) |_| @ | Tapanuli Orangutan | Pongo tapanuliensis |__Toggle between operators.__operator_$__operator_@'
|
|
14
14
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'substitutes command output in variables' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/command-substitution.md \
|
|
7
7
|
'CURRENT BASE NAME IS: MARKDOWN_EXEC_current base name is: markdown_exec_current base name is: markdown_exec_| current base name |_| ----------------- |_| markdown_exec |_: notice the string is not expanded in Shell block types (names or body)._echo "current base name is now $(basename `pwd`)"_load: file_markdown_exec.sh_Status not zero: $(err)'
|
|
8
8
|
}
|
data/bats/document-shell.bats
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test 'document_shell
|
|
5
|
+
@test 'requires document_shell for inherited lines' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/document-shell.md \
|
|
7
|
-
--dump-
|
|
8
|
-
'
|
|
7
|
+
--dump-context-code t '* Exit' \
|
|
8
|
+
' context_code_ - : : from required_ - : : from document_shell'
|
|
9
9
|
}
|
data/bats/history.bats
CHANGED
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'lists history files sorted' {
|
|
6
6
|
local log_files="$(ls -1t logs/*examples_save_md*)"
|
|
7
7
|
spec_mde_args_expect examples/save.md --history \
|
|
8
8
|
"$log_files"
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
@test '
|
|
11
|
+
@test 'digs through all history files' {
|
|
12
12
|
skip 'test hangs on menu'
|
|
13
13
|
local log_files="$(ls -1 logs/*)"
|
|
14
14
|
spec_mde_args_expect --history --dig \
|
|
15
15
|
"$log_files"
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
@test '
|
|
18
|
+
@test 'probes history files for pattern' {
|
|
19
19
|
local log_files="$(grep --files-with-matches '04:31' logs/* 2>/dev/null)"
|
|
20
20
|
spec_mde_args_expect examples/save.md --probe '04:31' --history \
|
|
21
21
|
"$log_files"
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
@test '
|
|
24
|
+
@test 'sifts history files by date pattern' {
|
|
25
25
|
local log_files="$(ls -1 logs/*-31-*examples_save_md*)"
|
|
26
26
|
spec_mde_args_expect examples/save.md --sift -31- --history \
|
|
27
27
|
"$log_files"
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
@test '
|
|
30
|
+
@test 'sifts and probes history files' {
|
|
31
31
|
local log_files="$(grep --files-with-matches 'e' logs/*-31-*examples_save_md* 2>/dev/null)"
|
|
32
32
|
spec_mde_args_expect examples/save.md --sift -31- --probe e --history \
|
|
33
33
|
"$log_files"
|
data/bats/import-conflict.bats
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'executes blocks with same name but different requirements' {
|
|
6
6
|
BATS_OUTPUT_FILTER=A
|
|
7
7
|
BATS_SAFE=_
|
|
8
8
|
spec_mde_args_expect docs/dev/import-conflict-0.md \
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '' {
|
|
5
|
+
@test 'expands parameter symbols in import directive' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/import-directive-parameter-symbols.md \
|
|
7
7
|
--blocks dname \
|
|
8
8
|
'Stem: U1_Species: Illacme tobini_Stem: U2_Species: Hydrodynastes bicinctus'
|
data/bats/import-duplicates.bats
CHANGED
|
@@ -4,7 +4,7 @@ load 'test_helper'
|
|
|
4
4
|
|
|
5
5
|
# Imported blocks `[du]1.*` appear before principal blocks `[du]0.*` in the code evaluated because the import of `import-duplicates-1.md` is above the `0.*` definitions in the principal file.
|
|
6
6
|
|
|
7
|
-
@test '
|
|
7
|
+
@test 'executes unique block from main file 0' {
|
|
8
8
|
BATS_OUTPUT_FILTER=A
|
|
9
9
|
BATS_SAFE=_
|
|
10
10
|
spec_mde_args_expect docs/dev/import-duplicates-0.md \
|
|
@@ -12,7 +12,7 @@ load 'test_helper'
|
|
|
12
12
|
'_d1.0_d1.1_d0.0_d0.1_u0.0'
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
@test '
|
|
15
|
+
@test 'executes unique block from main file 1' {
|
|
16
16
|
BATS_OUTPUT_FILTER=A
|
|
17
17
|
BATS_SAFE=_
|
|
18
18
|
spec_mde_args_expect docs/dev/import-duplicates-0.md \
|
|
@@ -21,7 +21,7 @@ load 'test_helper'
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
# a name in the CLI that matches multiple blocks only loads the first
|
|
24
|
-
@test '
|
|
24
|
+
@test 'executes first matching duplicate block 0' {
|
|
25
25
|
BATS_OUTPUT_FILTER=A
|
|
26
26
|
BATS_SAFE=_
|
|
27
27
|
spec_mde_args_expect docs/dev/import-duplicates-0.md \
|
|
@@ -30,7 +30,7 @@ load 'test_helper'
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
# a name in the CLI that matches multiple blocks only loads the first
|
|
33
|
-
@test '
|
|
33
|
+
@test 'executes first matching duplicate block 1' {
|
|
34
34
|
BATS_OUTPUT_FILTER=A
|
|
35
35
|
BATS_SAFE=_
|
|
36
36
|
spec_mde_args_expect docs/dev/import-duplicates-0.md \
|
|
@@ -38,7 +38,7 @@ load 'test_helper'
|
|
|
38
38
|
'_d1.1'
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
@test '
|
|
41
|
+
@test 'executes unique block from imported file 0' {
|
|
42
42
|
BATS_OUTPUT_FILTER=A
|
|
43
43
|
BATS_SAFE=_
|
|
44
44
|
spec_mde_args_expect docs/dev/import-duplicates-0.md \
|
|
@@ -46,7 +46,7 @@ load 'test_helper'
|
|
|
46
46
|
'_d1.0_d1.1_u1.0_d0.0_d0.1'
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
@test '
|
|
49
|
+
@test 'executes unique block from imported file 1' {
|
|
50
50
|
BATS_OUTPUT_FILTER=A
|
|
51
51
|
BATS_SAFE=_
|
|
52
52
|
spec_mde_args_expect docs/dev/import-duplicates-0.md \
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'expands parameter symbols in import directives' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/import-parameter-symbols.md \
|
|
7
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
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'substitutes text in enhanced import directives' {
|
|
6
6
|
BATS_OUTPUT_FILTER=A
|
|
7
7
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/import-with-text-substitution.md \
|
|
8
8
|
'IMPORT SUBSTITUTION COMPREHENSIVE TEST__Tests enhanced @import ./functionality with text_substitution using biological entity data.__Basic Import (Backward Compatibility)__Basic import without parameters.__Content: Static biological reference data._Source: Living entities research database._Format: Markdown with embedded data. __Raw Replacement - Simple Parameters__Genus: Pongo_Family: Hominidae _Order: Primates__Classification hierarchy shows Pongo within Hominidae of_Primates.__Raw Replacement - Quoted Values__Common Name: Tapanuli Orangutan_Scientific Name: Pongo tapanuliensis_Discovery Location: Sumatra, Indonesia__Organism Tapanuli Orangutan (Pongo tapanuliensis) found_in Sumatra, Indonesia.__Note: Tapanuli Orangutan contains spaces, Pongo_tapanuliensis contains spaces, Sumatra, Indonesia_contains punctuation.__Raw Replacement - Mixed Parameters__Species: Psychedelic Frogfish (Histiophryne psychedelica)_Discovery: 2009_Depth Range: 15-65 meters_Habitat: Coral reefs__Marine organism Psychedelic Frogfish discovered in 2009._Lives at 15-65 meters in Coral reefs environment.__Test: 2009 is numeric, 15-65 meters contains units, Coral_reefs contains spaces.__Raw Replacement - Numbers and Special Characters__Organism: Yeti Crab_Year: 2005 _Depth: 2200 meters_Temperature: 2°C_Location: Easter Island microplate__Discovery data: Yeti Crab found 2005 at 2200 meters depth._Environment: 2°C water near Easter Island microplate.__Tests: Numbers (2005, 2200), special chars (2°C °C),_complex location.__Raw Replacement - Long Scientific Names__Classification of Ecuadorian Glassfrog:__Scientific Name: Hyalinobatrachium yaku_Genus: Hyalinobatrachium_Family: Centrolenidae_Order: Anura _Class: Amphibia__Full classification: Amphibia > Anura > Centrolenidae >_Hyalinobatrachium > Hyalinobatrachium yaku__Long names test: Hyalinobatrachium and Centrolenidae are_lengthy taxonomic terms._Species Hyalinobatrachium yaku demonstrates complex_scientific nomenclature.__Raw Replacement - Plant Data__Plant Species: Spiny Dandelion (Taraxacum japonicum)__Kingdom: Plantae_Phylum: Tracheophyta _Class: Magnoliopsida__Plant classification differs from animal taxonomy._Spiny Dandelion belongs to Plantae with phylum_Tracheophyta._Classification ends at Magnoliopsida level for this plant.__Test: Plant-specific taxonomic structure. __Raw Replacement - Multiple Species Comparison__Species Comparison:__Species A: Kiwa hirsuta (2005)_Species B: Phyllopteryx dewysea (2015)__Habitat A: Deep sea_Habitat B: Coastal waters__Discovery timeline: Kiwa hirsuta found 2005, Phyllopteryx_dewysea found 2015._Environment: Deep sea vs Coastal waters.__Test: Numbered parameters (Kiwa hirsuta/Phyllopteryx_dewysea) and temporal data.__Raw Replacement - Taxonomic Hierarchy__Complete Taxonomic Classification:__Domain: Eukaryota_Kingdom: Animalia_Phylum: Chordata_Class: Mammalia_Order: Primates_Family: Hominidae_Genus: Homo_Species: Homo luzonensis__Full hierarchy: Eukaryota > Animalia > Chordata >_Mammalia > Primates > Hominidae > Homo > Homo luzonensis__Test: Complete 8-level taxonomic classification with all_major ranks.__Raw Replacement - Research Data__Research Study:__Lead Researcher: Dr. Matthew Leach_Institution: California Academy of Sciences_Method: Genetic analysis_Sample Size: 47 specimens__Study conducted by Dr. Matthew Leach at California_Academy of Sciences._Used Genetic analysis with 47 total samples.__Test: Researcher names, institution names, methodology_terms, numeric data.__Export and Variables__Organism Data Export:__export Illacme tobini_NAME="Illacme tobini"_export 2016=2016_export 414=414_export California="California"_export Endemic="Endemic"__echo "Processing Illacme tobini from 2016"_echo "Characteristics: 414 legs"_echo "Location: California (Endemic)"__Variable assignment test: Illacme tobini has 414 legs,_found in California._Status: Endemic as of 2016 discovery.__Test: Shell exports, numeric values, status terms. __Expected output shows proper text substitution with word_boundary protection.'
|
data/bats/import.bats
CHANGED
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'lists indented blocks from imported file' {
|
|
6
6
|
BATS_OUTPUT_FILTER=A
|
|
7
7
|
spec_mde_args_expect docs/dev/import.md \
|
|
8
8
|
--list-blocks-message indent --list-blocks \
|
|
9
9
|
' '
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
@test '
|
|
12
|
+
@test 'reports error when imported file missing' {
|
|
13
13
|
BATS_OUTPUT_FILTER=A
|
|
14
14
|
spec_mde_args_expect docs/dev/import-missing.md \
|
|
15
15
|
' Error: CachedNestedFileReader.readlines -- No such file or directory - this-is-missing.md @@ '
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
@test '
|
|
18
|
+
@test 'lists block ids from imported file' {
|
|
19
19
|
BATS_OUTPUT_FILTER=A
|
|
20
20
|
BATS_SAFE=_
|
|
21
21
|
spec_mde_args_expect docs/dev/import.md \
|
|
22
22
|
--list-block-message id --list-blocks \
|
|
23
|
-
'
|
|
23
|
+
'IBNF:1¤./docs/dev/specs-import.md:0_IBNF:4¤./docs/dev/specs-import.md:3_IBNF:7¤./docs/dev/specs-import.md:6'
|
|
24
24
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'renders indented vars block with multiple lines' {
|
|
6
6
|
BATS_OUTPUT_FILTER=A
|
|
7
7
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/indented-block-type-vars.md \
|
|
8
8
|
' Species: Pongo tapanuliensis_ Genus: Pongo'
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'retains whitespace in shell block output' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/indented-multi-line-output.md \
|
|
7
7
|
'[make-output]' \
|
|
8
8
|
'_Species_ Genus_ Family_Order'
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'applies dynamic line decoration with ANSI codes' {
|
|
6
6
|
spec_mde_dname_doc_blocks_expect docs/dev/line-decor-dynamic.md \
|
|
7
7
|
$'\e[1m\e[3m\e[38;2;200;200;33m\e[48;2;60;60;32mSpecies\e[22;23;0m'
|
|
8
8
|
}
|
data/bats/line-wrapping.bats
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'wraps text and headings to screen width' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/line-wrapping.md \
|
|
7
7
|
" DEMO WRAPPING LONG LINES__MDE detects the screen's dimensions:_height (lines) and width (characters)__Normal document text is displayed as_disabled menu lines. The width of these_lines is limited according to the_screen's width.__Test Indented Lines__ Indented with two spaces, this line_ should wrap in an aesthetically_ pleasing way.__ Indented with a tab, this line should_ wrap in an aesthetically pleasing_ way.__ SPECIES GENUS FAMILY ORDER CLASS PHYLUM_ KINGDOM DOMAIN_species genus family order class phylum_kingdom domain"
|
|
8
8
|
}
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test 'document initial state' {
|
|
5
|
+
@test 'displays document initial state' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/load-vars-state-demo.md \
|
|
7
|
-
'var1 = line1_var3 = line6_
|
|
7
|
+
'var1 = line1_var3 = line6_ context_code_ - : var1="line1"_ - : var3="line6"_ LOAD BLOCK STATE MODIFICATION DEMO__This document demonstrates how a LOAD block can modify_the inherited state that was initially set by VARS_blocks.__First, establish baseline variables using a VARS block:__Use a LOAD block to modify the initial state:__load-mode-default_load-mode-append_load-mode-replace'
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
@test 'load-mode-default' {
|
|
10
|
+
@test 'applies load-mode-default to inherited state' {
|
|
11
11
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/load-vars-state-demo.md \
|
|
12
12
|
load-mode-default \
|
|
13
|
-
'var1 = line1_var3 = line6_
|
|
13
|
+
'var1 = line1_var3 = line6_ context_code_ - : var1="line1"_ - : var3="line6"_ context_code_ - : var1="line1"_ - : var3="line6"_ - : # line 1_ - : var1=line2_ - : # line 3_ - : var2=line4_ - : # line 5_ LOAD BLOCK STATE MODIFICATION DEMO__This document demonstrates how a LOAD block can modify_the inherited state that was initially set by VARS_blocks.__First, establish baseline variables using a VARS block:__Use a LOAD block to modify the initial state:__load-mode-default_load-mode-append_load-mode-replace'
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
@test 'load-mode-append' {
|
|
16
|
+
@test 'appends to inherited state with load-mode-append' {
|
|
17
17
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/load-vars-state-demo.md \
|
|
18
18
|
load-mode-append \
|
|
19
|
-
'var1 = line1_var3 = line6_
|
|
19
|
+
'var1 = line1_var3 = line6_ context_code_ - : var1="line1"_ - : var3="line6"_ context_code_ - : var1="line1"_ - : var3="line6"_ - : # line 1_ - : var1=line2_ - : # line 3_ - : var2=line4_ - : # line 5_ LOAD BLOCK STATE MODIFICATION DEMO__This document demonstrates how a LOAD block can modify_the inherited state that was initially set by VARS_blocks.__First, establish baseline variables using a VARS block:__Use a LOAD block to modify the initial state:__load-mode-default_load-mode-append_load-mode-replace'
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
@test 'load-mode-replace' {
|
|
22
|
+
@test 'replaces inherited state with load-mode-replace' {
|
|
23
23
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/load-vars-state-demo.md \
|
|
24
24
|
load-mode-replace \
|
|
25
|
-
'var1 = line1_var3 = line6_
|
|
25
|
+
'var1 = line1_var3 = line6_ context_code_ - : var1="line1"_ - : var3="line6"_ context_code_ - : # line 1_ - : var1=line2_ - : # line 3_ - : var2=line4_ - : # line 5_ LOAD BLOCK STATE MODIFICATION DEMO__This document demonstrates how a LOAD block can modify_the inherited state that was initially set by VARS_blocks.__First, establish baseline variables using a VARS block:__Use a LOAD block to modify the initial state:__load-mode-default_load-mode-append_load-mode-replace'
|
|
26
26
|
}
|
data/bats/markup.bats
CHANGED
|
@@ -4,17 +4,17 @@ load 'test_helper'
|
|
|
4
4
|
|
|
5
5
|
# Text Decoration
|
|
6
6
|
|
|
7
|
-
@test '
|
|
7
|
+
@test 'displays text decoration with markup' {
|
|
8
8
|
spec_mde_xansi_oname_doc_blocks_expect docs/dev/text-decoration.md \
|
|
9
9
|
'- **_Bold-Underline_**_- **Bold**_- **~Bold-Italic~**_- __Underline___- _~Underline-Italic~__- `Italic`_- ~~Strikethrough~~'
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
@test '
|
|
12
|
+
@test 'extracts markup from text decoration' {
|
|
13
13
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/text-decoration.md \
|
|
14
14
|
'- Bold-Underline_- Bold_- Bold-Italic_- Underline_- Underline-Italic_- Italic_- Strikethrough'
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@test '
|
|
17
|
+
@test 'applies ANSI decoration to text' {
|
|
18
18
|
spec_mde_args_expect docs/dev/text-decoration.md \
|
|
19
19
|
--blocks dname \
|
|
20
20
|
$'\x1b\x5b\x33\x38\x3b\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x6d\x2d\x20\x1b\x5b\x30\x6d\x1b\x5b\x31\x6d\x1b\x5b\x34\x6d\x42\x6f\x6c\x64\x2d\x55\x6e\x64\x65\x72\x6c\x69\x6e\x65\x1b\x5b\x32\x32\x6d\x1b\x5b\x32\x34\x6d\x0a\x1b\x5b\x33\x38\x3b\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x6d\x2d\x20\x1b\x5b\x30\x6d\x1b\x5b\x31\x6d\x42\x6f\x6c\x64\x1b\x5b\x32\x32\x6d\x0a\x1b\x5b\x33\x38\x3b\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x6d\x2d\x20\x1b\x5b\x30\x6d\x1b\x5b\x31\x6d\x1b\x5b\x33\x6d\x42\x6f\x6c\x64\x2d\x49\x74\x61\x6c\x69\x63\x1b\x5b\x32\x32\x6d\x1b\x5b\x32\x33\x6d\x0a\x1b\x5b\x33\x38\x3b\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x6d\x2d\x20\x1b\x5b\x30\x6d\x1b\x5b\x34\x6d\x55\x6e\x64\x65\x72\x6c\x69\x6e\x65\x1b\x5b\x32\x34\x6d\x0a\x1b\x5b\x33\x38\x3b\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x6d\x2d\x20\x1b\x5b\x30\x6d\x1b\x5b\x34\x6d\x1b\x5b\x33\x6d\x55\x6e\x64\x65\x72\x6c\x69\x6e\x65\x2d\x49\x74\x61\x6c\x69\x63\x1b\x5b\x32\x33\x6d\x1b\x5b\x32\x34\x6d\x0a\x1b\x5b\x33\x38\x3b\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x6d\x2d\x20\x1b\x5b\x30\x6d\x1b\x5b\x33\x6d\x49\x74\x61\x6c\x69\x63\x1b\x5b\x32\x33\x6d\x0a\x1b\x5b\x33\x38\x3b\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x3b\x31\x39\x32\x6d\x2d\x20\x1b\x5b\x30\x6d\x1b\x5b\x39\x6d\x53\x74\x72\x69\x6b\x65\x74\x68\x72\x6f\x75\x67\x68\x1b\x5b\x32\x39\x6d'
|
|
@@ -32,7 +32,7 @@ load 'test_helper'
|
|
|
32
32
|
# }
|
|
33
33
|
|
|
34
34
|
# test ANSI escape sequence removal within BATS
|
|
35
|
-
@test
|
|
35
|
+
@test 'removes ANSI escape sequences' {
|
|
36
36
|
actual="Hello, \e[31mWorld\e[0m!"
|
|
37
37
|
echo 'actual'
|
|
38
38
|
echo -en "$actual" | hexdump -C
|
data/bats/mde.bats
CHANGED
|
@@ -4,14 +4,14 @@ load 'test_helper'
|
|
|
4
4
|
|
|
5
5
|
# Directives
|
|
6
6
|
|
|
7
|
-
@test '
|
|
7
|
+
@test 'executes block from imported file' {
|
|
8
8
|
# this shell block is in the import, not the primary document
|
|
9
9
|
run_mde_specs_md_args_expect_xansi 'shell-block-in-import' ' shell-block-in-import'
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
# Blocks, Wrapped
|
|
13
13
|
|
|
14
|
-
@test '
|
|
14
|
+
@test 'executes wrapped blocks with nested and inverted nesting' {
|
|
15
15
|
run_mde_specs_md_args_expect_xansi '[single]' ' outer-before single-body outer-after'
|
|
16
16
|
run_mde_specs_md_args_expect_xansi '[nested]' ' outer-before inner-before nested-body inner-after outer-after'
|
|
17
17
|
run_mde_specs_md_args_expect_xansi '[inverted-nesting]' ' inner-before outer-before inverted-nesting outer-after inner-after'
|
|
@@ -19,11 +19,11 @@ load 'test_helper'
|
|
|
19
19
|
|
|
20
20
|
# Blocks, Wrapped, Imported
|
|
21
21
|
|
|
22
|
-
@test '
|
|
22
|
+
@test 'executes wrapped block from imported file' {
|
|
23
23
|
# the wrap blocks are in the import, not the primary document
|
|
24
24
|
run_mde_specs_md_args_expect_xansi '[test-wrap-from-import]' ' wrap-from-import-before test-wrap-from-import wrap-from-import-after'
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
@test '
|
|
27
|
+
@test 'executes required wrapped block' {
|
|
28
28
|
run_mde_specs_md_args_expect_xansi '[test-require-wrapped-block]' ' outer-before single-body outer-after test-require-wrapped-block'
|
|
29
29
|
}
|
data/bats/option-expansion.bats
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '' {
|
|
5
|
+
@test 'expands options in table columns' {
|
|
6
6
|
spec_mde_xansi_dname_doc_blocks_expect docs/dev/option-expansion.md \
|
|
7
7
|
'_| Opti | Description | Valu | Va | Defau |_| ---- | ---------------------------- | ---- | -- | ----- |_| scre | Screen width for document an | 2 | 64 | 0 |_| tabl | | 5 | fa | true |'
|
|
8
8
|
}
|
data/bats/options-collapse.bats
CHANGED
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
load 'test_helper'
|
|
4
4
|
|
|
5
|
-
@test '
|
|
5
|
+
@test 'collapses document options by default' {
|
|
6
6
|
spec_mde_xansi_oname_doc_blocks_expect docs/dev/options-collapse.md \
|
|
7
7
|
'H1.1_L1.1_H2.1_H1.2_H1.3_L1.3_H2.3_L2.3_h3.3_L3.3_D4.3_L4.3'
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
@test '
|
|
10
|
+
@test 'expands collapsible heading when selected' {
|
|
11
11
|
spec_mde_xansi_oname_doc_blocks_expect docs/dev/options-collapse.md \
|
|
12
12
|
H2.1 \
|
|
13
13
|
'H1.1_L1.1_H2.1_L2.1_h3.1_L3.1_D4.1_L4.1_H1.2_H1.3_L1.3_H2.3_L2.3_h3.3_L3.3_D4.3_L4.3'
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
@test '
|
|
16
|
+
@test 'expands collapsible divider when selected' {
|
|
17
17
|
spec_mde_xansi_oname_doc_blocks_expect docs/dev/options-collapse.md \
|
|
18
18
|
D4.3 \
|
|
19
19
|
'H1.1_L1.1_H2.1_H1.2_H1.3_L1.3_H2.3_L2.3_h3.3_L3.3_D4.3'
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
@test '
|
|
22
|
+
@test 'reveals multiple collapsed sections' {
|
|
23
23
|
spec_mde_xansi_oname_doc_blocks_expect docs/dev/options-collapse.md \
|
|
24
24
|
H1.2 H2.2 h3.2 D4.2 \
|
|
25
25
|
'H1.1_L1.1_H2.1_H1.2_L1.2_H2.2_L2.2_h3.2_L3.2_D4.2_L4.2_H1.3_L1.3_H2.3_L2.3_h3.3_L3.3_D4.3_L4.3'
|