summaryrefslogtreecommitdiff
path: root/subplot.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-02-15 07:20:05 +0000
committerLars Wirzenius <liw@liw.fi>2020-02-15 07:20:05 +0000
commit62df0717e7087a051ec697b59b21feefaa27ece7 (patch)
tree9e33c085db46629672b566bfd7712c002a2c6ed3 /subplot.md
parentb0c3b2f3158611caf3f7bcc4ce8b277abde1e035 (diff)
parente975bd5b30eb7f3f46cba32e16ca813e110bc497 (diff)
downloadsubplot-62df0717e7087a051ec697b59b21feefaa27ece7.tar.gz
Merge branch 'liw/titles' into 'master'
Change: require docgen, codegen to fail if document has no title See merge request larswirzenius/subplot!2
Diffstat (limited to 'subplot.md')
-rw-r--r--subplot.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/subplot.md b/subplot.md
index 7c72ea8..59e9736 100644
--- a/subplot.md
+++ b/subplot.md
@@ -736,6 +736,49 @@ given precondition foo
~~~~
+### Document titles
+
+The document and code generators require a document title, because
+it's a common user error to not have one, and Subplot should help make
+good documents. The Pandoc filter, however, mustn't require a document
+title, because it's used for things like formatting websites using
+ikiwiki, and ikiwiki has a different way of specifying page titles.
+
+#### Document generator gives an error if input document lacks title
+
+~~~scenario
+given file notitle.md
+when I try to run sp-docgen notitle.md -o foo.md
+then exit code is non-zero
+~~~
+
+~~~{.file #notitle.md .markdown .numberLines}
+---
+bindings: b.yaml
+functions: f.py
+...
+
+
+# Introduction
+
+This is a very simple Markdown file without a YAML metadata block,
+and thus also no document title.
+
+```scenario
+given precondition foo
+when I do bar
+then bar was done
+~~~
+
+#### Code generator gives an error if input document lacks title
+
+~~~scenario
+given file notitle.md
+when I try to run sp-codegen --run notitle.md -o test.py
+then exit code is non-zero
+~~~
+
+
Using a Pandoc filter
-----------------------------------------------------------------------------