markdown_exec 1.8.1 → 1.8.4
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/CHANGELOG.md +16 -0
 - data/Gemfile.lock +1 -1
 - data/bin/tab_completion.sh +15 -3
 - data/examples/colors.md +37 -20
 - data/examples/linked1.md +1 -1
 - data/examples/linked2.md +4 -0
 - data/lib/ansi_formatter.rb +0 -3
 - data/lib/constants.rb +1 -1
 - data/lib/hash_delegator.rb +448 -649
 - data/lib/link_history.rb +131 -0
 - data/lib/markdown_exec/version.rb +1 -1
 - data/lib/markdown_exec.rb +22 -51
 - data/lib/mdoc.rb +40 -34
 - data/lib/menu.src.yml +24 -21
 - data/lib/menu.yml +25 -22
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: c5acb96c20743bda8d745d4dece7997ff6cd5b5474fdeba4b7401474c7500528
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 8e52cb02c35801816c9472c94112b521b110a758f602fdf0b19c4dd851c23243
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: bb66529f2a2766cb1f8cbdd8b071c02eb29ef0c55e29507576a3cb9a0fc4920093fb03af95ddd480a8f6a189d3a86c4b504315f2faadba173a345d07fd16de8e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 19af41e603d32a7acc84151ac4db6e4ae4b746990289cb3c89bf8e436a5bf1c98b2e73814f94b4ee348f6a9bcb3fbce35d195c4588a10965bea9e88c0f486b53
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,5 +1,21 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Changelog
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            ## [1.8.4] - 2023-12-15
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            ### Added
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            - Options to dump blocks when processed.
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            ### Changed
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            - Refactor code generation for and after Link blocks
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            ## [1.8.2] - 2023-12-12
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            ### Changed
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            - Set default colors.
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
       3 
19 
     | 
    
         
             
            ## [1.8.1] - 2023-12-11
         
     | 
| 
       4 
20 
     | 
    
         | 
| 
       5 
21 
     | 
    
         
             
            ### Changed
         
     | 
    
        data/Gemfile.lock
    CHANGED
    
    
    
        data/bin/tab_completion.sh
    CHANGED
    
    | 
         @@ -13,7 +13,7 @@ __filedirs_all() 
     | 
|
| 
       13 
13 
     | 
    
         
             
            }
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
            _mde_echo_version() {
         
     | 
| 
       16 
     | 
    
         
            -
              echo "1.8. 
     | 
| 
      
 16 
     | 
    
         
            +
              echo "1.8.4"
         
     | 
| 
       17 
17 
     | 
    
         
             
            }
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
            _mde() {
         
     | 
| 
         @@ -36,6 +36,12 @@ _mde() { 
     | 
|
| 
       36 
36 
     | 
    
         | 
| 
       37 
37 
     | 
    
         
             
                          -d) COMPREPLY="0"; return 0 ;;
         
     | 
| 
       38 
38 
     | 
    
         | 
| 
      
 39 
     | 
    
         
            +
                          --dump-blocks-in-file) COMPREPLY="0"; return 0 ;;
         
     | 
| 
      
 40 
     | 
    
         
            +
                        
         
     | 
| 
      
 41 
     | 
    
         
            +
                          --dump-menu-blocks) COMPREPLY="0"; return 0 ;;
         
     | 
| 
      
 42 
     | 
    
         
            +
                        
         
     | 
| 
      
 43 
     | 
    
         
            +
                          --dump-selected-block) COMPREPLY="0"; return 0 ;;
         
     | 
| 
      
 44 
     | 
    
         
            +
                        
         
     | 
| 
       39 
45 
     | 
    
         
             
                          --filename) COMPREPLY="."; return 0 ;;
         
     | 
| 
       40 
46 
     | 
    
         | 
| 
       41 
47 
     | 
    
         
             
                          -f) COMPREPLY="."; return 0 ;;
         
     | 
| 
         @@ -82,7 +88,7 @@ _mde() { 
     | 
|
| 
       82 
88 
     | 
    
         
             
              # present matching option names
         
     | 
| 
       83 
89 
     | 
    
         
             
              #
         
     | 
| 
       84 
90 
     | 
    
         
             
              if [[ ${cur} == -* ]] ; then
         
     | 
| 
       85 
     | 
    
         
            -
                opts=("--block-name" "--config" "--debug" "--exit" "--filename" "--find" "--help" "--how" "--list-blocks" "--list-count" "--list-default-env" "--list-default-yaml" "--list-docs" "--list-recent-output" "--list-recent-scripts" "--output-execution-summary" "--output-script" "--output-stdout" "--path" "--pwd" "--run-last-script" "--save-executed-script" "--save-execution-output" "--saved-script-folder" "--saved-stdout-folder" "--select-recent-output" "--select-recent-script" "--tab-completions" "--user-must-approve" "--version" "--display-level")
         
     | 
| 
      
 91 
     | 
    
         
            +
                opts=("--block-name" "--config" "--debug" "--dump-blocks-in-file" "--dump-menu-blocks" "--dump-selected-block" "--exit" "--filename" "--find" "--help" "--how" "--list-blocks" "--list-count" "--list-default-env" "--list-default-yaml" "--list-docs" "--list-recent-output" "--list-recent-scripts" "--output-execution-summary" "--output-script" "--output-stdout" "--path" "--pwd" "--run-last-script" "--save-executed-script" "--save-execution-output" "--saved-script-folder" "--saved-stdout-folder" "--select-recent-output" "--select-recent-script" "--tab-completions" "--user-must-approve" "--version" "--display-level")
         
     | 
| 
       86 
92 
     | 
    
         
             
                COMPREPLY=( $(compgen -W "$(printf "'%s' " "${opts[@]}")" -- "${cur}") )
         
     | 
| 
       87 
93 
     | 
    
         | 
| 
       88 
94 
     | 
    
         
             
                return 0
         
     | 
| 
         @@ -105,6 +111,12 @@ _mde() { 
     | 
|
| 
       105 
111 
     | 
    
         | 
| 
       106 
112 
     | 
    
         
             
                      -d) COMPREPLY=".BOOL."; return 0 ;;
         
     | 
| 
       107 
113 
     | 
    
         | 
| 
      
 114 
     | 
    
         
            +
                      --dump-blocks-in-file) COMPREPLY=".BOOL."; return 0 ;;
         
     | 
| 
      
 115 
     | 
    
         
            +
                    
         
     | 
| 
      
 116 
     | 
    
         
            +
                      --dump-menu-blocks) COMPREPLY=".BOOL."; return 0 ;;
         
     | 
| 
      
 117 
     | 
    
         
            +
                    
         
     | 
| 
      
 118 
     | 
    
         
            +
                      --dump-selected-block) COMPREPLY=".BOOL."; return 0 ;;
         
     | 
| 
      
 119 
     | 
    
         
            +
                    
         
     | 
| 
       108 
120 
     | 
    
         
             
                      --filename) COMPREPLY=".RELATIVE_PATH."; return 0 ;;
         
     | 
| 
       109 
121 
     | 
    
         | 
| 
       110 
122 
     | 
    
         
             
                      -f) COMPREPLY=".RELATIVE_PATH."; return 0 ;;
         
     | 
| 
         @@ -154,4 +166,4 @@ _mde() { 
     | 
|
| 
       154 
166 
     | 
    
         | 
| 
       155 
167 
     | 
    
         
             
            complete -o filenames -o nospace -F _mde mde
         
     | 
| 
       156 
168 
     | 
    
         
             
            # _mde_echo_version
         
     | 
| 
       157 
     | 
    
         
            -
            # echo "Updated: 2023-12- 
     | 
| 
      
 169 
     | 
    
         
            +
            # echo "Updated: 2023-12-16 00:15:53 UTC"
         
     | 
    
        data/examples/colors.md
    CHANGED
    
    | 
         @@ -2,28 +2,44 @@ 
     | 
|
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            ::: These Opts blocks set the color for all elements.
         
     | 
| 
       4 
4 
     | 
    
         | 
| 
      
 5 
     | 
    
         
            +
            <https://en.wikipedia.org/wiki/Complementary_colors#/media/File:RGB_color_wheel.svg>
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ff0000 red - exception text
         
     | 
| 
      
 8 
     | 
    
         
            +
            ff7f00 orange - warning text
         
     | 
| 
      
 9 
     | 
    
         
            +
            ffff00 yellow - notification text
         
     | 
| 
      
 10 
     | 
    
         
            +
            7fff00 chartreuse green - output frame
         
     | 
| 
      
 11 
     | 
    
         
            +
            00ff00 green - prompt
         
     | 
| 
      
 12 
     | 
    
         
            +
            00ff7f spring green - input frame
         
     | 
| 
      
 13 
     | 
    
         
            +
            00ffff cyan - menu text
         
     | 
| 
      
 14 
     | 
    
         
            +
            007fff azure - menu frame
         
     | 
| 
      
 15 
     | 
    
         
            +
            0000ff blue
         
     | 
| 
      
 16 
     | 
    
         
            +
            7f00ff violet - opts frame
         
     | 
| 
      
 17 
     | 
    
         
            +
            ff00ff magenta - opts text
         
     | 
| 
      
 18 
     | 
    
         
            +
            ff007f rose - exception frame
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
       5 
20 
     | 
    
         
             
            ```opts :(document_options)
         
     | 
| 
       6 
21 
     | 
    
         
             
            ```
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
             
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
             
     | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
       26 
     | 
    
         
            -
             
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            ```opts :load_colors
         
     | 
| 
      
 24 
     | 
    
         
            +
            exception_color_detail: fg_rgbh_ff_00_7f
         
     | 
| 
      
 25 
     | 
    
         
            +
            exception_color_name: fg_rgbh_ff_00_00
         
     | 
| 
      
 26 
     | 
    
         
            +
            execution_report_preview_frame_color: fg_rgbh_7f_ff_00
         
     | 
| 
      
 27 
     | 
    
         
            +
            menu_bash_color: fg_rgbh_00_c0_c0
         
     | 
| 
      
 28 
     | 
    
         
            +
            menu_chrome_color: fg_rgbh_40_c0_c0
         
     | 
| 
      
 29 
     | 
    
         
            +
            menu_divider_color: fg_rgbh_80_d0_c0
         
     | 
| 
      
 30 
     | 
    
         
            +
            menu_link_color: fg_rgbh_e0_e0_20
         
     | 
| 
      
 31 
     | 
    
         
            +
            menu_note_color: fg_rgbh_b0_b0_b0
         
     | 
| 
      
 32 
     | 
    
         
            +
            menu_opts_color: fg_rgbh_ff_00_ff
         
     | 
| 
      
 33 
     | 
    
         
            +
            menu_opts_set_color: fg_rgbh_7f_00_ff
         
     | 
| 
      
 34 
     | 
    
         
            +
            menu_task_color: fg_rgbh_ff_ff_ff
         
     | 
| 
      
 35 
     | 
    
         
            +
            menu_vars_color: fg_rgbh_ff_a0_ff
         
     | 
| 
      
 36 
     | 
    
         
            +
            menu_vars_set_color: fg_rgbh_00_ff_ff
         
     | 
| 
      
 37 
     | 
    
         
            +
            output_execution_label_name_color: fg_rgbh_00_ff_00
         
     | 
| 
      
 38 
     | 
    
         
            +
            output_execution_label_value_color: fg_rgbh_00_ff_00
         
     | 
| 
      
 39 
     | 
    
         
            +
            prompt_color_after_script_execution: fg_rgbh_00_ff_00
         
     | 
| 
      
 40 
     | 
    
         
            +
            script_execution_frame_color: fg_rgbh_00_ff_7f
         
     | 
| 
      
 41 
     | 
    
         
            +
            script_preview_frame_color: fg_rgbh_7f_ff_00
         
     | 
| 
      
 42 
     | 
    
         
            +
            warning_color: fg_rgbh_ff_7f_00
         
     | 
| 
       27 
43 
     | 
    
         
             
            ```
         
     | 
| 
       28 
44 
     | 
    
         | 
| 
       29 
45 
     | 
    
         
             
            ::: Example blocks
         
     | 
| 
         @@ -39,6 +55,7 @@ warning_color:                         fg_rgbh_E0_E0_20  # Color of warning mess 
     | 
|
| 
       39 
55 
     | 
    
         
             
            ```vars :Vars1
         
     | 
| 
       40 
56 
     | 
    
         
             
            ```
         
     | 
| 
       41 
57 
     | 
    
         
             
            [ ] Task1
         
     | 
| 
      
 58 
     | 
    
         
            +
             
     | 
| 
       42 
59 
     | 
    
         
             
            blue;    fg_rgbh_00_00_FF
         
     | 
| 
       43 
60 
     | 
    
         
             
            green;   fg_rgbh_00_FF_00
         
     | 
| 
       44 
61 
     | 
    
         
             
            indigo;  fg_rgbh_4B_00_82
         
     | 
    
        data/examples/linked1.md
    CHANGED
    
    
    
        data/examples/linked2.md
    CHANGED
    
    | 
         @@ -20,6 +20,10 @@ colorize_env_vars 'vars for page3' PAGE3_VAR_VIA_INHERIT page3_var_via_environme 
     | 
|
| 
       20 
20 
     | 
    
         
             
            PAGE3_VAR_VIA_INHERIT=for_page3_from_page2_via_inherited_code_file
         
     | 
| 
       21 
21 
     | 
    
         
             
            ```
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
      
 23 
     | 
    
         
            +
            ```link :(linked3) +(vars3)
         
     | 
| 
      
 24 
     | 
    
         
            +
            file: examples/linked3.md
         
     | 
| 
      
 25 
     | 
    
         
            +
            ```
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
       23 
27 
     | 
    
         
             
            ```link :linked3_import_vars +(vars3)
         
     | 
| 
       24 
28 
     | 
    
         
             
            file: examples/linked3.md
         
     | 
| 
       25 
29 
     | 
    
         
             
            block: show_vars
         
     | 
    
        data/lib/ansi_formatter.rb
    CHANGED
    
    | 
         @@ -145,9 +145,6 @@ class AnsiFormatter 
     | 
|
| 
       145 
145 
     | 
    
         
             
                results
         
     | 
| 
       146 
146 
     | 
    
         
             
              end
         
     | 
| 
       147 
147 
     | 
    
         | 
| 
       148 
     | 
    
         
            -
              # # Example usage
         
     | 
| 
       149 
     | 
    
         
            -
              # scan_and_process_string("Hello world, hello universe", "hello", :plain, :color)
         
     | 
| 
       150 
     | 
    
         
            -
             
     | 
| 
       151 
148 
     | 
    
         
             
              # Applies a color method to a string based on the provided color symbol.
         
     | 
| 
       152 
149 
     | 
    
         
             
              # The color method is fetched from @options and applied to the string.
         
     | 
| 
       153 
150 
     | 
    
         
             
              # @param string [String] The string to which the color will be applied.
         
     |