blob: 435751eb6a22fecc26a93b049805b1c5cd980df0 [file] [log] [blame]
Herbert Eiselt092189e2019-04-03 17:24:29 +02001#!/bin/bash
2
3BASEDIR=$(dirname "$0")"/../../../"
4PATH_HELPSERVER_RES=$BASEDIR"sdnr/wt/helpserver/provider/src/main/resources/help/"
5PATH_DOC_DST=$BASEDIR"docs/"
6PATH_DOC_USERDOC_DST=$PATH_DOC_DST"guides/onap-user/"
7
8echo "==================Find .md files in helpserver===================================="
9markdown_files=$(find $PATH_HELPSERVER_RES"sdnr" -type f -iname "*.md")
10echo "$markdown_files[@]"
11
12echo "=============Converting md to rst files=================================="
13for file in ${markdown_files[@]}; do
14 append_name=`echo "$file" | awk -F"/" '{print $(NF-1)}'`
15 f="$(basename -- $file)"
16 if [ "${f,,}" = "readme.md" ]; then
17 rstfile=$append_name".rst"
18 else
19 rstfile=${f%.md}".rst"
20 fi
21
22 echo "$file to $PATH_DOC_USERDOC_DST$rstfile"
23 pandoc -s --toc -f markdown -t rst $file > $PATH_DOC_USERDOC_DST"$rstfile"
24done
25
sai-neetha96a53312019-08-08 12:46:00 +020026cp "$BASEDIR"sdnr/wt/readthedocs/src/home.rst "$PATH_DOC_USERDOC_DST"
27cp "$BASEDIR"sdnr/wt/readthedocs/src/index.rst "$PATH_DOC_DST"
Herbert Eiselt092189e2019-04-03 17:24:29 +020028
sai-neetha96a53312019-08-08 12:46:00 +020029#echo "================Creating html=========================================="
30#/usr/local/bin/sphinx-build -b html $PATH_DOC_DST /home/jack/public_html/sdnr-trial/
Herbert Eiselt092189e2019-04-03 17:24:29 +020031