WIP: script: gather feature config guides automatically 87/9687/7
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Wed, 10 Feb 2016 03:53:08 +0000 (12:53 +0900)
committerChristopher Price <christopher.price@ericsson.com>
Thu, 11 Feb 2016 09:55:15 +0000 (09:55 +0000)
Change-Id: Iedc50c723ee3ec0fa0e07848d633d35c67d5aa94
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
build-composite.sh
docs/configguide/feature-config.rst
docs/configguide/featureconfig-copper.rst [deleted file]
docs/configguide/featureconfig-doctor.rst [deleted file]
docs/configguide/featureconfig-ipv6.rst [deleted file]
docs/configguide/featureconfig-promise.rst [deleted file]
docs/configguide/featureconfig-sdnvpn.rst [deleted file]

index 4aef860..574c4ec 100755 (executable)
@@ -70,21 +70,32 @@ sed -i -e '/^.. figure::/s|images|../projects/promise/configguide/images|' \
     docs/projects/promise/configguide/featureconfig.rst
 
 # NOTE: automated link generation is not ready...
-#echo
-#echo "Creating document links"
-#echo
-#for guide in configguide userguide
-#do
-#    link_list=$WORKSPACE/docs/$guide/projects-$guide.rst
-#    for repo in $repos
-#    do
-#        file=projects/$repo/$guide/$guide.rst
-#        [[ -e $WORKSPACE/docs/$file ]] || continue
-#        echo "" >> $link_list
-#        echo "$repo:" >> $link_list
-#        echo ".. include:: ../$file" >> $link_list
-#    done
-#done
+echo
+echo "Creating document links"
+echo
+#for guide in configguide/installer-config.rst configguide/feature-config.rst \
+#             configguide/postinatall.rst \
+#             userguide/feature-usage.rst userguide/test-usage.rst
+for guide in configguide/feature-config.rst
+do
+    mainfile="$WORKSPACE/docs/$guide"
+    for repo in $repos
+    do
+        projectfile="projects/$repo/${guide//-/}"
+        projectlink="${mainfile%/*}/featureconfig-$repo.rst"
+        [[ -e "$WORKSPACE/docs/$projectfile" ]] || continue
+        echo "Adding $repo to $guide ..."
+        echo "" >> $mainfile
+        echo ".. toctree::" >> $mainfile
+        echo "" >> $mainfile
+        echo "    $projectlink" >> $mainfile
+        echo ".. include:: ../$projectfile" >> $projectlink
+    done
+    echo
+    echo "Generated $guide:"
+    cat $mainfile
+    echo
+done
 
 $WORKSPACE/releng/utils/docs-build.sh
 
index 96409b8..29e7e09 100644 (file)
@@ -8,23 +8,3 @@ Feature Configuration
 
 The following sections describe the configuration options for specific platform features provided in Brahmaputra.
 Further details for each feature are captured in the referred project documentation.
-
-.. toctree::
-
-    featureconfig-copper
-
-.. toctree::
-
-    featureconfig-doctor
-
-.. toctree::
-
-    featureconfig-ipv6
-
-.. toctree::
-
-    featureconfig-promise
-
-.. toctree::
-
-    featureconfig-sdnvpn
diff --git a/docs/configguide/featureconfig-copper.rst b/docs/configguide/featureconfig-copper.rst
deleted file mode 100644 (file)
index 5a348de..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-
-.. include:: ../projects/copper/configguide/featureconfig.rst
diff --git a/docs/configguide/featureconfig-doctor.rst b/docs/configguide/featureconfig-doctor.rst
deleted file mode 100644 (file)
index ef99064..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-
-.. include:: ../projects/doctor/configguide/configguide.rst
diff --git a/docs/configguide/featureconfig-ipv6.rst b/docs/configguide/featureconfig-ipv6.rst
deleted file mode 100644 (file)
index 49211f5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-
-.. include:: ../projects/ipv6/configguide/featureconfig.rst
diff --git a/docs/configguide/featureconfig-promise.rst b/docs/configguide/featureconfig-promise.rst
deleted file mode 100644 (file)
index bd1d7f5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-
-.. include:: ../projects/promise/configguide/featureconfig.rst
diff --git a/docs/configguide/featureconfig-sdnvpn.rst b/docs/configguide/featureconfig-sdnvpn.rst
deleted file mode 100644 (file)
index dc4d2d9..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-.. This work is licensed under a Creative Commons Attribution 4.0 International License.
-.. http://creativecommons.org/licenses/by/4.0
-
-.. include:: ../projects/sdnvpn/configguide/configguide.rst