diff --git a/.gitignore b/.gitignore index e35d8850c9688b1ce82711694692cc574a799396..6a35bdace76e6166634820391e0681d8816a694a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -_build +_build*/ +local/ diff --git a/README.md b/README.md index ebbf539e731b5d65f8d804ea8324853a1d314fa6..22b043cc96f6216692488a57dca25078bb7b0919 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ This document collects Open Source MANO User Guide. +It is published at [https://osm.etsi.org/docs/user-guide/](https://osm.etsi.org/docs/user-guide/) + ## Guidelines for contributors - OSM [Workflow for documentation production](https://osm.etsi.org/gitlab/osm-doc/documentation-how-to/blob/master/Workflow%20for%20documentation%20production%20in%20OSM.md#guide-for-contributors) must be used. @@ -24,14 +26,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. diff --git a/env b/env new file mode 100644 index 0000000000000000000000000000000000000000..df7a01d00d31c1c4bbad06ce4c03b4baa59472c0 --- /dev/null +++ b/env @@ -0,0 +1,9 @@ +#!/bin/bash +SERVER="ftp://osm-download.etsi.org" +FOLDER="user-guide" +FTP_OPTS="" + +# Define your FTP credentials in a separate (private file) +# local/.credentials +# USERNAME= +# PASSWORD= diff --git a/fix_cross_references.sh b/fix_cross_references.sh new file mode 100755 index 0000000000000000000000000000000000000000..ab23e752b1f7042cf627e1ea2bf8b739900a779e --- /dev/null +++ b/fix_cross_references.sh @@ -0,0 +1,10 @@ +#!/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 + diff --git a/updater.sh b/updater.sh new file mode 100755 index 0000000000000000000000000000000000000000..c0c2df79807e7ba3727fe96e0a3328f3b7721670 --- /dev/null +++ b/updater.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# URL References +for file in *.md; +do + echo ${file} + sed -i "s/\/ReleaseNINE/\/ReleaseTEN/g" ${file}; + sed -i "s/\/osm-9.0-nine\//\/osm-10.0-ten\//g" ${file}; + sed -i "s/releasenine/releaseten/g" ${file}; +done + +# Special +sed -i "s/NINE/TEN/g" 01-quickstart.md diff --git a/upload-doc.sh b/upload-doc.sh index 3a19fef5f6b735caa2292d32c23b1c67a3afcded..e7dc23e472654adfbea625e5f5a1aa3488fd2f83 100755 --- a/upload-doc.sh +++ b/upload-doc.sh @@ -1,18 +1,42 @@ #!/bin/bash +# +# Script to upload documentation to ETSI site +# + +source ./env + +# +# 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 -