From 6a703bed8ba8251f9d664cc0d5ec3b489d8f10d4 Mon Sep 17 00:00:00 2001
From: carlocamilloni <carlo.camilloni@gmail.com>
Date: Tue, 25 Jul 2017 12:18:28 +0200
Subject: [PATCH] Users manual: implementation of module's related tutorials
 tutorials and resources that are module specific should be moved in the
 subfolder tutorials/others/ i.e. isdb-xxx.txt then will generate a
 ISDB_TUTORIALS.list that can be referenced in the manual

---
 user-doc/extract       | 19 +++++++++++++++++--
 user-doc/go-doxygen    |  2 +-
 user-doc/report_errors | 20 ++++++++++++++++++++
 3 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/user-doc/extract b/user-doc/extract
index 60c54b47a..115ee2f27 100755
--- a/user-doc/extract
+++ b/user-doc/extract
@@ -182,7 +182,7 @@ please do not print it!
 EOF
 fi
 
-# Generate links to tutorial pages
+# Generate links to standard tutorial pages
 for file in ./tutorials/*.txt ; do
 
     link=`grep link: $file | sed -e 's/link://'`
@@ -202,6 +202,21 @@ for file in ./tutorials/*.site; do
 
 done
 
+# Generate links for module specific tutorials
+for file in ./tutorials/others/*.txt ; do
+
+    arrIN=(${file//.\/tutorials\/others\// }); 
+    temp=$(echo $arrIN | tr "-" "\n"); 
+    modtut=$(echo $temp | awk '{print toupper($1)}')
+
+    link=`grep link: $file | sed -e 's/link://'`
+    describe=`grep description: $file | sed -e 's/description://'`
+
+    echo "<tr> <td> $link </td> <td> $describe </td> </tr>" >> automatic/"$modtut"_TUTORIALS.list  
+
+done
+
+
 # Find what modules the user has installed
 # Find the list of modules
 # if [ -d ../mymodules ] ;  then
@@ -324,7 +339,7 @@ if test -f "$ff" ; then
 mv $ff $ff.1
   {
     cat $ff.1
-    echo "In addition to the keyword above, by enabling optional modules you can access to the following keywords:"
+    echo "In addition to the keywords above, by enabling optional modules you can access to the following keywords:"
     cat $file
   } > $ff
 fi
diff --git a/user-doc/go-doxygen b/user-doc/go-doxygen
index fff47ed0c..93d7e7be8 100755
--- a/user-doc/go-doxygen
+++ b/user-doc/go-doxygen
@@ -21,7 +21,7 @@ LIST="
    TutorialsPP.md
  PerformancesPP.md
  GlossaryPP.md
- automatic tutorials"
+ automatic tutorials tutorials/others"
 
 {
   cat Doxyfile
diff --git a/user-doc/report_errors b/user-doc/report_errors
index aabfc94ca..f93ea57e8 100755
--- a/user-doc/report_errors
+++ b/user-doc/report_errors
@@ -28,6 +28,26 @@ for file in ./tutorials/*.txt ; do
 
 done
 
+for file in ./tutorials/others/*.txt ; do
+
+   check=`grep additional-files: $file | wc -l`
+   if [ $check -gt 1 ] ; then
+        echo Input files for tutorials should all be given in a single tarball. $file contains $check files >> errors
+   elif [ $check -gt 0 ] ; then
+      resources=`grep additional-files: $file | sed -e 's/additional-files: //'`
+     for addfile in $resources; do 
+        if test -d tutorials/others/$addfile; then
+          cd tutorials
+          tar czf ../html/tutorial-resources/$addfile.tar.gz others/$addfile
+          cd -
+        else
+          cp tutorials/others/$addfile html/tutorial-resources
+        fi
+     done
+   fi
+
+done
+
 nerrors=`wc -l errors | awk '{print NF}'`
 if [ $nerrors -eq 0 ] ; then
   rm errors
-- 
GitLab