Herbert Eiselt | 092189e | 2019-04-03 17:24:29 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | BASEDIR=$(dirname "$0")"/../../../" |
| 4 | PATH_HELPSERVER_RES=$BASEDIR"sdnr/wt/helpserver/provider/src/main/resources/help/" |
| 5 | PATH_DOC_DST=$BASEDIR"docs/" |
| 6 | PATH_DOC_USERDOC_DST=$PATH_DOC_DST"guides/onap-user/" |
| 7 | |
| 8 | echo "==================Find .md files in helpserver====================================" |
| 9 | markdown_files=$(find $PATH_HELPSERVER_RES"sdnr" -type f -iname "*.md") |
| 10 | echo "$markdown_files[@]" |
| 11 | |
| 12 | echo "=============Converting md to rst files==================================" |
| 13 | for 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" |
| 24 | done |
| 25 | |
| 26 | cp -r "$BASEDIR"sdnr/wt/readthedocs/src/home.rst "$BASEDIR"docs/guides/onap-user/ |
| 27 | cp -r "$BASEDIR"sdnr/wt/readthedocs/src/index.rst "$BASEDIR"docs/ |
| 28 | |
| 29 | echo "================Creating html==========================================" |
| 30 | /usr/local/bin/sphinx-build -b html $PATH_DOC_DST /home/jack/public_html/sdnr-trial/ |
| 31 | |