diff --git a/gh-pages/README.rst b/gh-pages/README.rst new file mode 100644 index 0000000000000000000000000000000000000000..1a05d47b360b7f59d3b7a11b512eb8f8b8d2682d --- /dev/null +++ b/gh-pages/README.rst @@ -0,0 +1,3 @@ +This branch contains the GitHub Pages for PythonicGCodeMachine. + +These pages are generated by the documentation tool. diff --git a/gh-pages/html-rsync-filter.txt b/gh-pages/html-rsync-filter.txt new file mode 100644 index 0000000000000000000000000000000000000000..97ec06b8c11af1d689759795d8eb075a3e805082 --- /dev/null +++ b/gh-pages/html-rsync-filter.txt @@ -0,0 +1,7 @@ +.buildinfo +.git +.gitignore +README.rst +push-to-github.sh +html-rsync-filter.txt +update.sh diff --git a/gh-pages/update-gh-pages b/gh-pages/update-gh-pages new file mode 100755 index 0000000000000000000000000000000000000000..4c9e033810a907ab29b61df344535a1d3531d211 --- /dev/null +++ b/gh-pages/update-gh-pages @@ -0,0 +1,55 @@ +#! /bin/bash + +#################################################################################################### + +root_dir=$(dirname $(dirname $(realpath $0))) +html_build="${root_dir}/doc/sphinx/build/html" +source_gh_pages=${root_dir}/gh-pages + +echo Source Path: ${root_dir} +echo HTML Build Path: ${html_build} + +origin='git@github.com:FabriceSalvaire/PythonicGCodeMachine.git' + +#################################################################################################### + +tmp_dir=$(mktemp -d) +if [ -e ${tmp_dir} ]; then + pushd ${tmp_dir} + + # To create gh-pages branch + # git clone ${origin} PythonicGCodeMachine-gh-pages + # pushd PythonicGCodeMachine-gh-pages + # git checkout --orphan gh-pages + # git rm --cached -r . + + git clone ${origin} PythonicGCodeMachine-gh-pages --branch gh-pages --single-branch + pushd PythonicGCodeMachine-gh-pages + # sync with origin if already cloned + # git fetch origin + git checkout gh-pages + + rm -rf static images + rsync --delete -av --exclude-from=${source_gh_pages}/html-rsync-filter.txt ${html_build}/ . + cp ${source_gh_pages}/README.rst . + if [ -e _images ]; then + mv _images images + find . -name "*.html" -exec sed -e 's/_images/images/g;' -i {} \; + fi + if [ -e _static ]; then + mv _static static + find . -name "*.html" -exec sed -e 's/_static/static/g;' -i {} \; + fi + if [ -e _downloads ]; then + mv _downloads downloads + find . -name "*.html" -exec sed -e 's/_downloads/downloads/g;' -i {} \; + fi + find . -name '.#*html' -exec rm {} \; + + git add --all * + git commit -m 'update' + git push -u origin gh-pages + + popd -1 ; popd + rm -rf ${tmp_dir} +fi