mdsh spec.
May 8, 2025 ยท View on GitHub
Each H4 section is converted into a test case by build.rs script. Each section
in spec.clear.md must correspond to the same section in spec.processed.md.
spec.processed.md is a version of this file after one mdsh pass.
spec.processed.md must be idempotent, i.e. any next passes result in the same content.
mdsh --clean pass on spec.processed.md must result in spec.clear.md.
- Producing raw markdown
- Executing shell commands
- Executing command in inline code and producing raw markdown
- Executing command in code blocks with data line and producing raw markdown
- Executing command in code blocks and producing raw markdown
- Executing command in one-line comments and producing raw markdown
- Executing command in multiline comments with data line and producing raw markdown
- Executing command in multiline comments and producing raw markdown
- Executing command in markdown link and producing raw markdown
- Reading files contents
- Using inlined values
- Executing shell commands
- Producing code blocks
- Executing shell commands
- Executing command in inline code and producing code block
- Executing command in code blocks with data line and producing code block
- Executing command in code blocks and producing code block
- Executing command in one-line comments and producing code block
- Executing command in multiline comments with data line and producing code block
- Executing command in multiline comments and producing code block
- Executing command in markdown link and producing code block
- Reading files contents
- Using inlined values
- Using inlined data in inline code and producing code block
- Using inlined data in code blocks and producing code block
- Using inlined data in one-line comments and producing code block
- Using inlined data in multiline comments and producing code block
- Using inlined data in markdown link and producing code block
- Executing shell commands
- Sourcing environment variables
- Executing shell commands
- Executing command in inline code and sourcing env variable(s)
- Executing command in code blocks with data line and sourcing env variable(s)
- Executing command in code blocks and sourcing env variable(s)
- Executing command in one-line comments and sourcing env variable(s)
- Executing command in multiline comments with data line and sourcing env variable(s)
- Executing command in multiline comments and sourcing env variable(s)
- Executing command in markdown link and sourcing env variable(s)
- Reading files contents
- Using inlined values
- Executing shell commands
Producing raw markdown
Executing shell commands
Executing command in inline code and producing raw markdown
> $ echo 'I am *markdown*'
I am markdown
Executing command in code blocks with data line and producing raw markdown
I am *markdown*
Hi, I am markdown
Executing command in code blocks and producing raw markdown
echo 'I am *markdown*'
I am markdown
Executing command in one-line comments and producing raw markdown
I am markdown
Executing command in multiline comments with data line and producing raw markdown
Hi, I am markdown
Executing command in multiline comments and producing raw markdown
I am markdown
Executing command in markdown link and producing raw markdown
I'm gen-md.sh
Reading files contents
Reading file in inline code and producing raw markdown
> < ./samples/example.md
this is part of the example.md file
Reading file in code blocks and producing raw markdown
./samples/example.md
this is part of the example.md file
Reading file in one-line comments and producing raw markdown
this is part of the example.md file
Reading file in multiline comments and producing raw markdown
this is part of the example.md file
Reading file in markdown link and producing raw markdown
this is part of the example.md file
Using inlined values
Producing code blocks
Executing shell commands
Executing command in inline code and producing code block
> yaml $ echo 'foo: true'
foo: true
Executing command in code blocks with data line and producing code block
foo: true
foo: true # hmm
Executing command in code blocks and producing code block
echo 'foo: true'
foo: true
Executing command in one-line comments and producing code block
foo: true
Executing command in multiline comments with data line and producing code block
foo: true # hmm
Executing command in multiline comments and producing code block
foo: true
Executing command in markdown link and producing code block
foo: bar
Reading files contents
Reading file in inline code and producing code block
> yaml < ./samples/example.yml
foo: bar
Reading file in code blocks and producing code block
./samples/example.yml
foo: bar
Reading file in one-line comments and producing code block
foo: bar
Reading file in multiline comments and producing code block
foo: bar
Reading file in markdown link and producing code block
foo: bar
Using inlined values
Using inlined data in inline code and producing code block
> yaml foo: true
foo: true
Using inlined data in code blocks and producing code block
foo: true
foo: true
Using inlined data in one-line comments and producing code block
foo: true
Using inlined data in multiline comments and producing code block
foo: true
Using inlined data in markdown link and producing code block
./samples/example.yml
Sourcing environment variables
Executing shell commands
Executing command in inline code and sourcing env variable(s)
! $ echo 'foo=bar'
> $ echo "\`\$foo\` is $foo"
$foo is bar
Executing command in code blocks with data line and sourcing env variable(s)
foo=bar
> $ echo "\`\$foo\` is $foo"
$foo is bar
Executing command in code blocks and sourcing env variable(s)
echo 'foo=bar'
> $ echo "\`\$foo\` is $foo"
$foo is bar
Executing command in one-line comments and sourcing env variable(s)
> $ echo "\`\$foo\` is $foo"
$foo is bar
Executing command in multiline comments with data line and sourcing env variable(s)
> $ echo "\`\$foo\` is $foo"
$foo is bar
Executing command in multiline comments and sourcing env variable(s)
> $ echo "\`\$foo\` is $foo"
$foo is bar
Executing command in markdown link and sourcing env variable(s)
> $ echo "\`\$foo\` is $foo"
$foo is bar
Reading files contents
Reading file in inline code and sourcing env variable(s)
! < ./samples/example.env
> $ echo "\`\$foo\` is $foo"
$foo is bar
Reading file in code blocks and sourcing env variable(s)
./samples/example.env
> $ echo "\`\$foo\` is $foo"
$foo is bar
Reading file in one-line comments and sourcing env variable(s)
> $ echo "\`\$foo\` is $foo"
$foo is bar
Reading file in multiline comments and sourcing env variable(s)
> $ echo "\`\$foo\` is $foo"
$foo is bar
Reading file in markdown link and sourcing env variable(s)
> $ echo "\`\$foo\` is $foo"
$foo is bar
Using inlined values
Using inlined data in inline code and sourcing env variable(s)
! foo=bar
> $ echo "\`\$foo\` is $foo"
$foo is bar
Using inlined data in code blocks and sourcing env variable(s)
foo=bar
> $ echo "\`\$foo\` is $foo"
$foo is bar
Using inlined data in one-line comments and sourcing env variable(s)
> $ echo "\`\$foo\` is $foo"
$foo is bar
Using inlined data in multiline comments and sourcing env variable(s)
> $ echo "\`\$foo\` is $foo"
$foo is bar
The end!