From 00dd15a972aa3f794404b16beefe682c90d9e5d3 Mon Sep 17 00:00:00 2001
From: Bernd Flemisch <bernd@iws.uni-stuttgart.de>
Date: Fri, 9 Aug 2019 12:19:59 +0200
Subject: [PATCH] [doc] add a script that appends Markdown and C++ files

---
 bin/doc/merge_cpp_and_md.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 bin/doc/merge_cpp_and_md.sh

diff --git a/bin/doc/merge_cpp_and_md.sh b/bin/doc/merge_cpp_and_md.sh
new file mode 100644
index 0000000000..eec5a49f47
--- /dev/null
+++ b/bin/doc/merge_cpp_and_md.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# The arguments should be names of Markdown and/or C++ files.
+# The script loops through all arguments. If a Markdown file is encountered,
+# its content is forwarded to stdout. For another file, a Markdown header
+# stating the filename is printed and the script cpp_to_md.sh is applied.
+
+for filename in "$@"
+do
+  if [[ ${filename: -3} == ".md" ]]; then
+    cat $filename
+  else
+    echo ""
+    echo ""
+    echo "## The file \`$filename\`"
+    echo ""
+    bash cpp_to_md.sh $filename
+    echo ""
+  fi
+done
-- 
GitLab