correct file path in imported rst files 05/10005/9
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Mon, 15 Feb 2016 15:11:04 +0000 (00:11 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Tue, 16 Feb 2016 04:27:34 +0000 (13:27 +0900)
Change-Id: I2d3a784dd3fcd41b2ba637cef633a4cf42ebadae
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
build-composite.sh
docs/configguide/index.rst

index 12c134b..714bd5b 100755 (executable)
@@ -65,9 +65,16 @@ done
 # NOTE: Removing index.rst in project repos to reduce number of docs.
 find docs/projects -type f -name 'index.rst' -print | xargs -I i rm -f i
 
-# Correct Image file path (workaround)
-sed -i -e '/^.. figure::/s|images|../projects/promise/configguide/images|' \
-    docs/projects/promise/configguide/featureconfig.rst
+# fix relative file paths
+pattern='.. \(include\|figure\):: *[^ \/]'
+base_path="/$(pwd)/docs_build/_src"
+find docs/projects -type f -name '*.rst' -print | while read f
+do
+    sed -i -e "/$pattern/s|:: *|:: $base_path/$(dirname ${f#docs/})/|" $f
+done
+
+# for debug
+grep -e '.. include::' -e '.. figure::' -r docs/projects
 
 # NOTE: automated link generation is not ready...
 echo
index 1d042fb..dfd8c4d 100644 (file)
@@ -6,6 +6,8 @@
 OPNFV Configuration Guide
 *************************
 
+.. test
+
 .. toctree::
    :maxdepth: 2