diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-05-05 06:00:47 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-05-05 06:00:47 +0000 |
commit | c2cbccd45a2c356e458abc8bbef3193434e8572a (patch) | |
tree | 139208361d500faa96ef568bb9a1f57b06ba93a3 /subplot.md | |
parent | 12059fcb1ce8237e5587773043cd442e036531c2 (diff) | |
parent | d8eb94901bd66e77e4366a29b67c71db934fadf9 (diff) | |
download | subplot-c2cbccd45a2c356e458abc8bbef3193434e8572a.tar.gz |
Merge branch 'fix-256' into 'main'
(subplot): Add support for example blocks
Closes #256
See merge request subplot/subplot!274
Diffstat (limited to 'subplot.md')
-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 |