Commit b97c6125 authored by guzman's avatar guzman
Browse files

Improve scripts

parent 039fa6fd
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -24,14 +24,9 @@ Before proceeding, **make sure that there are no uncommitted changes in your wor
Then run:

```bash
# Clean previous html
make clean
# Fix references to sections in other docs
for i in [0-1]*.md; do sed -i "s/\.md\#/\.html\#/g" $i; done
# Build html documentation
make html
# Restore the markdown files to their previous state
git reset --hard
./fix_cross_references.sh 
```

The generated HTML output is stored in `_build/html`. You can go to that folder and publish the content locally with a Simple HTTP Server in Python.
+10 −0
Original line number Diff line number Diff line
#!/bin/bash
#
# This is needed to fix a bug in sphinx
# Otherwise, cross-references in html will point to a .md file
#
for file in $(find _build -name "*.html")
do
	sed -r -E -i "s/href=\"(.*)\.md\#/href=\"\1.html#/g"  ${file}
done
+35 −10
Original line number Diff line number Diff line
#!/bin/bash
#
# Script to upload documentation to ETSI site
#

SERVER="ftp://osm-download.etsi.org"
FOLDER="user-guid"
FTP_OPTS=""
#
# Generate Statit Site
#
make clean
for i in [0-1]*.md; do sed -i "s/\.md\#/\.html\#/g" $i; done
make html
read -p "Please enter your username for FTP server (ETSI On Line account): " USER_INPUT
read -sp "Please enter your password for FTP server: " PASSWORD_INPUT
echo
lftp -u $USER_INPUT,$PASSWORD_INPUT ftp://osm-download.etsi.org << !

#
# Fix cross-references
#
./fix_cross_references.sh 

#
# Get credentias (file or interactive)
#
if [ local/.credentials ]; then
	source local/.credentials
	echo SERVER=${SERVER}
	echo USERNAME=${USERNAME}
else
	echo "Enter credentials for ${SERVER} (ETSI On Line account)"
	read -p  "Username: " USERNAME
	read -sp "Password: " PASSWORD
fi

lftp ${FTP_OPTS} -u ${USERNAME},${PASSWORD} ${SERVER} << !
   set ftp:ssl-allow no
   lcd _build
   cd Documentation
   mirror -R html user-guide-new
   rm -r user-guide
   mv user-guide-new user-guide

   mirror -R html ${FOLDER}-new
   rm -r ${FOLDER}-old
   mv ${FOLDER} ${FOLDER}-old
   mv ${FOLDER}-new ${FOLDER}
   bye
!
git reset --hard