X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=doc%2Fsrc%2Frtd%2Fpublish_man.sh;fp=doc%2Fsrc%2Frtd%2Fpublish_man.sh;h=a0f71cd497d1a7456d0b00628a508738bba18cbf;hb=117030c67f7a3722e64f1ecc3305a5862b3b7ce9;hp=0000000000000000000000000000000000000000;hpb=2d9d6784b306047e94ca9816813e5007b00fd17e;p=ric-plt%2Flib%2Frmr.git diff --git a/doc/src/rtd/publish_man.sh b/doc/src/rtd/publish_man.sh new file mode 100755 index 0000000..a0f71cd --- /dev/null +++ b/doc/src/rtd/publish_man.sh @@ -0,0 +1,55 @@ +#/usr/bin/env bash +# vim: sw=4 ts=4 noet : + +#================================================================================== +# Copyright (c) 2020 Nokia +# Copyright (c) 2020 AT&T Intellectual Property. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#================================================================================== + +# build separate man pages as .rst files and publish to the scrapable directory if +# there are changes. We build the .rst and if it is different than what is in the +# scarper directory we will copy it over there. We inject a title so that the +# RTD scripts won't object. + +sdir="../../../docs" # the scraper dir + +if [[ ! -d $sdir ]] +then + echo "cannot find scraper directory: $sdir" + exit 1 +fi + +mkdir -p stuff +ls -al ../man/*.xfm|sed 's!^.*man/!!' | while read x +do + if [[ $x != *".7.xfm" ]] + then + out=stuff/${x%.*}.rst + target=${sdir}/${out##*/} + + INPUT_FILE=${x%%.*} GEN_TITLE=1 LIB=".." OUTPUT_TYPE=rst tfm ../man/$x stdout 2>/dev/null | sed 's/^ //' >$out + new_m5=$( md5sum $out | sed 's/ .*//' ) + if [[ ! -f $target || $new_m5 != $( md5sum $target | sed 's/ .*//' ) ]] + then + cp $out $target + fi + + echo "${target##*/}" + + rm $out + fi +done + +rmdir stuff