-
Notifications
You must be signed in to change notification settings - Fork 1
/
file-code-chunks-eval
executable file
·24 lines (18 loc) · 1.01 KB
/
file-code-chunks-eval
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env perl6
use v6.d;
use Text::CodeProcessing;
my %*SUB-MAIN-OPTS = :named-anywhere;
#| Evaluates code chunks in a file. (Markdown, Org-mode, or Pod6.)
sub MAIN(
Str $inputFileName where *.IO.f, #= Input file name.
Str :o(:$output) = 'Whatever', #= Output file; if not given the output file name is the input file name concatenated with "_woven".
Str :eval-output-prompt(:$evalOutputPrompt) = 'Whatever', #= Evaluation results prompt.
Str :eval-error-prompt(:$evalErrorPrompt) = 'Whatever', #= Evaluation errors prompt.
Bool :prompt-per-line(:$promptPerLine) = True #= Should prompts be printed per line or not?
) {
my $outputLocal = $output;
if $output.lc ∈ <whatever auto automatic> {
$outputLocal = Whatever
};
return FileCodeChunksEvaluation($inputFileName, outputFileName => $outputLocal, :$evalOutputPrompt, :$evalErrorPrompt, :noteOutputFileName, :$promptPerLine);
}