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