Sha256: ece7c30a9971a34724d293faf8d9996cac1473843bbdb96b8155c914c7e14b62
Contents?: true
Size: 1.1 KB
Versions: 5
Compression:
Stored size: 1.1 KB
Contents
# Demonstrate data blocks ```opts :(document_options) pause_after_script_execution: true ``` ## Create a data file by requiring a YAML block. ::: YAML into a file / YAML block that loads data into a file. ```yaml :(test1) >test1.yml a: species b: genus ``` This is a Bash block that - requires a hidden YAML block (that creates a file), and - displays the file. ```bash +(test1) echo "- The data file created" ls -al *.yml echo -e "\n- Contents of the file" cat -n test1.yml echo -e "\n- Remove the data file" rm test1.yml ``` ## Load data by requiring a yaml block. ::: YAML into a shell variable / YAML block that loads data into a variable. ```yaml :(test2) >$test2 c: family d: order ``` This is a Bash block that - requires a hidden YAML block (that sets a variable), and - displays the variable. ```bash +(test2) echo 'data:' echo "$test2" ``` ## Visible YAML block that is not executable. ::: Non-interactive data ```yaml e: class f: phylum ``` # Related MDE options block_stdin_scan | Match to place block body into a file or a variable block_stdout_scan | Match to place block body into a file or a variable
Version data entries
5 entries across 5 versions & 1 rubygems