diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2022-05-04 20:20:07 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2022-05-04 20:20:07 +0100 |
commit | d8eb94901bd66e77e4366a29b67c71db934fadf9 (patch) | |
tree | 139208361d500faa96ef568bb9a1f57b06ba93a3 | |
parent | 6448825a8f9beca0333464c9bfbc8fb96d142189 (diff) | |
download | subplot-d8eb94901bd66e77e4366a29b67c71db934fadf9.tar.gz |
(subplot.md): Add example scenarios covering example blocks
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-rw-r--r-- | subplot.md | 57 |
1 files changed, 57 insertions, 0 deletions
@@ -2779,6 +2779,63 @@ This is the embedded file. ``` ~~~~ +## Example blocks + +Similar to embedded files, Subplot permits you to mark blocks as examples. +Example blocks are formatted just like file blocks, but they may not be +used by scenarios and their names are separated from files, and are not +subject to the same naming constraints (caseless uniqueness). + +### Examples may be unused + +~~~scenario +given file unusedexample.md +and an installed subplot +when I try to run subplot docgen --merciful unusedexample.md -o unusedexample.html +then command is successful +and file unusedexample.html exists +and stderr doesn't contain "thisisnotused.txt" +~~~ + +~~~{#unusedexample.md .file .markdown .numberLines} +--- +title: Example is not an embedded file +... + +```{#thisisnotused.txt .example} +This is the embedded example. +``` +~~~ + +### Examples are not files + +~~~scenario +given file examplesnotfiles.md +and an installed subplot +when I try to run subplot codegen examplesnotfiles.md -t python -o examplesnotfiles.html +then command fails +and file examplesnotfiles.html does not exist +and stderr contains "thisisanexample.txt" +~~~ + +~~~{#examplesnotfiles.md .file .markdown .numberLines} +--- +title: Examples are not files +impls: + python: [] +... + +# Try and use an example as a file + +```scenario +given file thisisanexample.txt +``` + +```{#thisisanexample.txt .example} +This is an embedded example +``` + +~~~ ## Steps must match bindings |