summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-10-22 12:01:02 +0000
committerLars Wirzenius <liw@liw.fi>2022-10-22 12:01:02 +0000
commit080ff671f03385fa21fb5ac384a4788b563d684d (patch)
tree763cf148ba09aa8ffa3fc6dd6d6004162aea3bd9
parent1bcbb535490511e0bc4f2826356a16bdd05360b0 (diff)
parent03c871ab0cba16d355de0145f47acd547262ac4b (diff)
downloadsubplot-080ff671f03385fa21fb5ac384a4788b563d684d.tar.gz
Merge branch 'docgen-template-not-always-needed' into 'main'
(subplot.md): Add scenario about not needing a template for docgen Closes #306 See merge request subplot/subplot!296
-rw-r--r--subplot.md34
1 files changed, 34 insertions, 0 deletions
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