From: Victor Laza Date: Tue, 28 Apr 2015 08:46:50 +0000 (+0300) Subject: Updated docs/enable_docu_gen.rst with latest image include code X-Git-Tag: arno.2015.1.0~7 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F424%2F2;p=opnfvdocs.git Updated docs/enable_docu_gen.rst with latest image include code JIRA: Updated docs/enable_docu_gen.rst with latest image include code that will make visible images in .html artifacts also Change-Id: Ie2938a1feeb815ddf51cafb53c96df3690ec6f4c Signed-off-by: Victor Laza --- diff --git a/docs/enable_docu_gen.rst b/docs/enable_docu_gen.rst index d36dba331..8dd1c02fc 100644 --- a/docs/enable_docu_gen.rst +++ b/docs/enable_docu_gen.rst @@ -129,6 +129,27 @@ example: cp releng/jjb/opnfvdocs/build-docu.sh releng/jjb//:: done + images=() + while read -r -d ''; do + images+=("$REPLY") + done < <(find * -type f \( -iname \*.jpg -o -iname \*.png \) -print0) + + for img in "${{images[@]}}"; do + + # uploading found images + echo "uploading $img" + cat "$img" | gsutil cp -L gsoutput.txt - \ + gs://artifacts.opnfv.org/"$project"/"$img" + gsutil setmeta -h "Content-Type:image/jpeg" \ + -h "Cache-Control:private, max-age=0, no-transform" \ + gs://artifacts.opnfv.org/"$project"/"$img" + cat gsoutput.txt + rm -f gsoutput.txt + + done + + + #the double {{ in file_cut="${{file%.*}}" is to escape jjb's yaml @@ -232,6 +253,20 @@ You must include at the bottom of every document that you want to track the foll # add one "_" at the end of each trigger variable (they have also a prefix "_") when inserting them into documents to enable auto-replacement +**Image inclusion for artifacts** + +Create a folder called images in the same folder where you documentation resides and copy .jpg or .png files there, according to the guide here: https://wiki.opnfv.org/documentation + +Here is an example of what you need to include in the .rst files to include an image:: + + .. image:: images/smiley.png + :height: 200 + :width: 200 + :alt: Just a smiley face! + :align: left + +The image will be shown in both .html and .pdf resulting artifacts. + NOTE: ------