From 03c871ab0cba16d355de0145f47acd547262ac4b Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 22 Oct 2022 11:00:01 +0100 Subject: (subplot.md): Add scenario about not needing a template for docgen Signed-off-by: Daniel Silverstone --- subplot.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/subplot.md b/subplot.md index 27da981..2d494b3 100644 --- a/subplot.md +++ b/subplot.md @@ -1123,6 +1123,40 @@ But there are no scenarios in this file, and thus nothing can be generated in a ~~~ +## No template means you can docgen but not codegen + +When running `docgen` you do not **need** a template to have been defined in the +subplot input document. If you have template-specific bindings then you **should** +provide one, but if not, then it is unnecessary. This means you can use `docgen` +to build documents before you have any inkling of the implementation language +necessary to validate the scenarios. + +~~~scenario +given file notemplate.subplot +given file notemplate.md +and an installed subplot +when I run subplot docgen notemplate.subplot -o notemplate.html +then file notemplate.html exists +when I try to run subplot codegen notemplate.subplot -o test.py +then command fails +and stderr contains "document has no template" +~~~ + +~~~{#notemplate.subplot .file .yaml .numberLines} +title: No templates in here +markdowns: [notemplate.md] +impls: { } +~~~ + +~~~{#notemplate.md .file .markdown .numberLines} +# This is a title + +```scenario +then failure ensues +``` + +~~~ + ## Keywords Subplot supports the keywords **given**, **when**, and **then**, and -- cgit v1.2.1