Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorClare Macrae2020-10-23 17:36:30 +0100
committerMartin Hořeňovský2020-10-28 11:38:06 +0100
commit8c3970465d3175e18927e2e33d3ebcee03be0e95 (patch)
treeb1958249f1027a683d6b251338b061ec8ad214df
parentf57689f888848ae948e276774b424fad04e6e216 (diff)
downloadcatch3-8c3970465d3175e18927e2e33d3ebcee03be0e95.tar.gz
Add infrastructure for embedding code samples in docs.
-rw-r--r--mdsnippets.json9
-rwxr-xr-xtools/scripts/updateDocumentSnippets.py23
2 files changed, 32 insertions, 0 deletions
diff --git a/mdsnippets.json b/mdsnippets.json
new file mode 100644
index 00000000..5a60dadb
--- /dev/null
+++ b/mdsnippets.json
@@ -0,0 +1,9 @@
+{
+ "ReadOnly": false,
+ "TocLevel": 5,
+ "Exclude": [
+ "cmake-build"
+ ],
+ "WriteHeader": false,
+ "Convention": "InPlaceOverwrite"
+}
diff --git a/tools/scripts/updateDocumentSnippets.py b/tools/scripts/updateDocumentSnippets.py
new file mode 100755
index 00000000..a070eea8
--- /dev/null
+++ b/tools/scripts/updateDocumentSnippets.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+
+from scriptCommon import catchPath
+import os
+import subprocess
+
+# ---------------------------------------------------
+# Update code examples
+# ---------------------------------------------------
+# For info on mdsnippets, see https://github.com/SimonCropp/MarkdownSnippets
+
+# install dotnet SDK from http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409
+# Then install MarkdownSnippets.Tool with
+# dotnet tool install -g MarkdownSnippets.Tool
+# To update:
+# dotnet tool update -g MarkdownSnippets.Tool
+# To uninstall (e.g. to downgrade to a lower version)
+# dotnet tool uninstall -g MarkdownSnippets.Tool
+
+os.chdir(catchPath)
+
+subprocess.run('dotnet tool update -g MarkdownSnippets.Tool --version 21.2.0', shell=True, check=True)
+subprocess.run('mdsnippets', shell=True, check=True)