markdown_exec 1.4 → 1.4.1
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/.pryrc +3 -1
- data/CHANGELOG.md +17 -0
- data/Gemfile.lock +1 -1
- data/bin/tab_completion.sh +2 -2
- data/examples/linked1.md +1 -0
- data/examples/linked2.md +0 -1
- data/lib/markdown_exec/version.rb +1 -1
- data/lib/markdown_exec.rb +15 -4
- data/lib/menu.yml +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6655d4d2fdbf1334fd7eb786e8b8e3e8401ac0e8cb0e10927c1e426be9422d83
|
4
|
+
data.tar.gz: 5e2e1272f186e8fb00d240fd11501cdc5630ab497298fcc02e43c42c9b3e0f45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63ab33098867f8f1af0b0281690e816cd657d9fc42181cdb895ee78ab2e722cc5c63303d2c2be7f9791a7cacc9503cbfc45d9277b1a35e5cdb33ef4217a8607a
|
7
|
+
data.tar.gz: 4535992b37f72e175388264c3e7ab9f5189a06e57b8a973521d95f62ea75a22de445518f19577563d78a81ebc2c8a99c3cc3e24639f04f792ad9017780c426bb
|
data/.pryrc
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
if defined?(PryByebug)
|
2
2
|
Pry.config.pager = false
|
3
3
|
Pry.commands.alias_command 'c', 'continue'
|
4
|
+
Pry.commands.alias_command 'd', 'down'
|
4
5
|
Pry.commands.alias_command 'f', 'finish'
|
5
|
-
Pry.commands.alias_command 's', 'step'
|
6
6
|
Pry.commands.alias_command 'n', 'next'
|
7
|
+
Pry.commands.alias_command 's', 'step'
|
8
|
+
Pry.commands.alias_command 'u', 'up'
|
7
9
|
|
8
10
|
Pry::Commands.command /^$/, 'repeat last command' do
|
9
11
|
_pry_.run_command Pry.history.to_a.last
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.4.1] - 2023-11-02
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- Support for nested links.
|
8
|
+
A Link block name can be followed by the block name to execute in the linked document.
|
9
|
+
Nested links result in scripts with nested required blocks.
|
10
|
+
|
11
|
+
## [1.4] - 2023-10-31
|
12
|
+
|
13
|
+
### Added
|
14
|
+
|
15
|
+
- Add required code blocks to link block types.
|
16
|
+
Allows for nested required code as links are navigated.
|
17
|
+
|
18
|
+
- Add fg_rgbh_* methods to process hex RGB specifications.
|
19
|
+
|
3
20
|
## [1.3.9] - 2023-10-29
|
4
21
|
|
5
22
|
Add block types for linking and variable control
|
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.4"
|
16
|
+
echo "1.4.1"
|
17
17
|
}
|
18
18
|
|
19
19
|
_mde() {
|
@@ -138,4 +138,4 @@ _mde() {
|
|
138
138
|
|
139
139
|
complete -o filenames -o nospace -F _mde mde
|
140
140
|
# _mde_echo_version
|
141
|
-
# echo "Updated: 2023-
|
141
|
+
# echo "Updated: 2023-11-02 13:20:09 UTC"
|
data/examples/linked1.md
CHANGED
@@ -15,6 +15,7 @@ colorize_env_vars 'vars for page3' PAGE3_VAR_VIA_INHERIT page3_var_via_environme
|
|
15
15
|
::: 1. requires a block that sets environment variable PAGE2_VAR_VIA_INHERIT,
|
16
16
|
::: 2. navigates to document 2, and
|
17
17
|
::: 3. executes block "show_vars" to display the imported PAGE2_VAR_VIA_INHERIT.
|
18
|
+
::: Any script generated by page 2 will contain the inherited code.
|
18
19
|
|
19
20
|
```bash :(vars2)
|
20
21
|
PAGE2_VAR_VIA_INHERIT=for_page2_from_page1_via_inherited_code_file
|
data/examples/linked2.md
CHANGED
@@ -11,7 +11,6 @@ colorize_env_vars 'vars for page2' PAGE2_VAR_VIA_INHERIT page2_var_via_environme
|
|
11
11
|
colorize_env_vars 'vars for page3' PAGE3_VAR_VIA_INHERIT page3_var_via_environment
|
12
12
|
```
|
13
13
|
|
14
|
-
|
15
14
|
::: This Link block requires a block that
|
16
15
|
::: 1. sets environment variable PAGE3_VAR_VIA_INHERIT,
|
17
16
|
::: 2. navigates to document 3, and
|
data/lib/markdown_exec.rb
CHANGED
@@ -9,6 +9,7 @@ require 'fileutils'
|
|
9
9
|
require 'open3'
|
10
10
|
require 'optparse'
|
11
11
|
require 'shellwords'
|
12
|
+
require 'tmpdir'
|
12
13
|
require 'tty-prompt'
|
13
14
|
require 'yaml'
|
14
15
|
|
@@ -505,13 +506,14 @@ module MarkdownExec
|
|
505
506
|
#
|
506
507
|
def execute_block_with_error_handling(rest)
|
507
508
|
finalize_cli_argument_processing(rest)
|
508
|
-
|
509
|
+
@options[:cli_rest] = rest
|
510
|
+
execute_code_block_based_on_options(@options)
|
509
511
|
rescue FileMissingError => err
|
510
512
|
puts "File missing: #{err}"
|
511
513
|
end
|
512
514
|
|
513
515
|
# Main method to execute a block based on options and block_name
|
514
|
-
def execute_code_block_based_on_options(options
|
516
|
+
def execute_code_block_based_on_options(options)
|
515
517
|
options = calculated_options.merge(options)
|
516
518
|
update_options(options, over: false)
|
517
519
|
|
@@ -1088,6 +1090,15 @@ module MarkdownExec
|
|
1088
1090
|
].compact)
|
1089
1091
|
end
|
1090
1092
|
|
1093
|
+
def next_block_name_from_command_line_arguments(opts)
|
1094
|
+
if opts[:cli_rest].present?
|
1095
|
+
opts[:block_name] = opts[:cli_rest].pop
|
1096
|
+
false # repeat_menu
|
1097
|
+
else
|
1098
|
+
true # repeat_menu
|
1099
|
+
end
|
1100
|
+
end
|
1101
|
+
|
1091
1102
|
# :reek:ControlParameter
|
1092
1103
|
def optsmerge(call_options = {}, options_block = nil)
|
1093
1104
|
class_call_options = @options.merge(call_options || {})
|
@@ -1337,11 +1348,12 @@ module MarkdownExec
|
|
1337
1348
|
load_file, next_block_name = approve_and_execute_block(opts, mdoc)
|
1338
1349
|
default = load_file == LOAD_FILE ? 1 : opts[:block_name]
|
1339
1350
|
opts[:block_name] = next_block_name
|
1340
|
-
|
1341
1351
|
break if state == :continue && load_file == LOAD_FILE
|
1342
1352
|
break unless repeat_menu
|
1343
1353
|
end
|
1344
1354
|
break if load_file != LOAD_FILE
|
1355
|
+
|
1356
|
+
repeat_menu = next_block_name_from_command_line_arguments(opts)
|
1345
1357
|
end
|
1346
1358
|
rescue StandardError => err
|
1347
1359
|
warn(error = "ERROR ** MarkParse.select_approve_and_execute_block(); #{err.inspect}")
|
@@ -1625,7 +1637,6 @@ module MarkdownExec
|
|
1625
1637
|
)[:code]).join("\n")
|
1626
1638
|
|
1627
1639
|
Dir::Tmpname.create(self.class.to_s) do |path|
|
1628
|
-
pp path
|
1629
1640
|
File.write(path, code_blocks)
|
1630
1641
|
ENV['MDE_LINK_REQUIRED_FILE'] = path
|
1631
1642
|
end
|
data/lib/menu.yml
CHANGED
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:
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fareed Stevenson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|