diff --git a/README.rst b/README.rst index b9b1c0b26b..32beed9f2e 100644 --- a/README.rst +++ b/README.rst @@ -33,7 +33,6 @@ In addition to the guides, this repository contains: * docs.openstack.org contents: ``www`` - Building ======== @@ -43,7 +42,7 @@ Guides ------ All guides are in the RST format. You can use ``tox`` to prepare -virtual environment and build all guides:: +virtual environment and build all guides (HTML only): $ tox -e docs @@ -64,12 +63,15 @@ To build a specific guide with a PDF file, add a ``-pdf`` option like:: The generated PDF file will be copied to the root directory of the generated HTML documentation. -To install all requirements to execute the commands above check the -output of the ``bindep`` command, it reports missing requirements for -all build targets:: +To install all requirements to execute the commands above, on Linux you can +check the output of the ``bindep`` command. This tool reports missing +requirements for all build targets:: $ tox -e bindep +If you get this message `make: xelatex: No such file or directory` it means +your local environment does not have LaTeX installed. Read `Getting LaTeX + `_ for instructions. Testing of changes and building of the manual ============================================= diff --git a/tools/build-all-rst.sh b/tools/build-all-rst.sh index 4738bd8ff3..421aed8023 100755 --- a/tools/build-all-rst.sh +++ b/tools/build-all-rst.sh @@ -12,13 +12,19 @@ fi MARKER_TEXT="Project: $ZUUL_PROJECT Ref: $ZUUL_REFNAME Build: $ZUUL_UUID Revision: $ZUUL_NEWREV" LINKCHECK="" -if [[ $# > 0 ]] ; then - if [ "$1" = "--linkcheck" ] ; then - LINKCHECK="$1" - fi -fi - -PDF_OPTION="--pdf" +PDF_OPTION="" +while [[ $# > 0 ]] ; do + option="$1" + case $option in + --linkcheck) + LINKCHECK="--linkcheck" + ;; + --pdf) + PDF_OPTION="--pdf" + ;; + esac + shift +done # PDF targets for Install guides are dealt in build-install-guides-rst.sh PDF_TARGETS=( 'arch-design'\ @@ -54,7 +60,7 @@ for guide in networking-guide arch-design-draft config-reference; do fi done -tools/build-install-guides-rst.sh $LINKCHECK +tools/build-install-guides-rst.sh $LINKCHECK $PDF_OPTION # For master, just mark the root if [ "$ZUUL_REFNAME" = "master" ] ; then diff --git a/tools/build-install-guides-rst.sh b/tools/build-install-guides-rst.sh index ccda8b5ef0..56905ef984 100755 --- a/tools/build-install-guides-rst.sh +++ b/tools/build-install-guides-rst.sh @@ -3,15 +3,32 @@ mkdir -p publish-docs # Do not build debian debconf for now, there're no Ocata packages at all. -TAGS=${1:-obs rdo ubuntu} INDEX=doc/install-guide/source/index.rst +TAGS="obs rdo ubuntu" LINKCHECK="" -if [[ $# > 0 ]] ; then - if [ "$1" = "--linkcheck" ] ; then - LINKCHECK="$1" - fi -fi +PDF_OPTION="" +while [[ $# > 0 ]] ; do + option="$1" + case $option in + obs) + TAGS=obs + ;; + rdo) + TAGS=rdo + ;; + ubuntu) + TAGS=ubuntu + ;; + --linkcheck) + LINKCHECK="--linkcheck" + ;; + --pdf) + PDF_OPTION="--pdf" + ;; + esac + shift +done # For translation work, we should have only one index file, # because our tools generate translation resources from @@ -38,7 +55,7 @@ for tag in $TAGS; do # Build the guide with debconf # To use debian only contents, use "debian" tag. tools/build-rst.sh doc/install-guide-debconf \ - --tag debian --target "$TARGET" $LINKCHECK --pdf + --tag debian --target "$TARGET" $LINKCHECK $PDF_OPTION else ## # Because Sphinx uses the first heading as title regardless of @@ -51,7 +68,7 @@ for tag in $TAGS; do # Build the guide tools/build-rst.sh doc/install-guide \ - --tag ${tag} --target "$TARGET" $LINKCHECK --pdf + --tag ${tag} --target "$TARGET" $LINKCHECK $PDF_OPTION fi # Add this for stable branches if [ "$ZUUL_REFNAME" != "master" ] ; then diff --git a/tools/publishdocs.sh b/tools/publishdocs.sh index 2fd36a33e6..9420d14a16 100755 --- a/tools/publishdocs.sh +++ b/tools/publishdocs.sh @@ -46,8 +46,8 @@ function copy_to_branch { mkdir -p publish-docs -# Build all RST guides -tools/build-all-rst.sh +# Build all RST guides including PDF files +tools/build-all-rst.sh --pdf # Build the www pages so that openstack-indexpage creates a link to # www/www-index.html. diff --git a/tox.ini b/tox.ini index 6cf5fe6a1b..6751af6440 100644 --- a/tox.ini +++ b/tox.ini @@ -37,29 +37,33 @@ commands = commands = {toxinidir}/tools/build-all-rst.sh +[testenv:pdfs] +commands = + {toxinidir}/tools/build-all-rst.sh --pdf + [testenv:install-guides] commands = - {toxinidir}/tools/build-install-guides-rst.sh + {toxinidir}/tools/build-install-guides-rst.sh {posargs} [testenv:install-guide-debconf] commands = - {toxinidir}/tools/build-install-guides-rst.sh debconf + {toxinidir}/tools/build-install-guides-rst.sh debconf {posargs} [testenv:install-guide-debian] commands = - {toxinidir}/tools/build-install-guides-rst.sh debian + {toxinidir}/tools/build-install-guides-rst.sh debian {posargs} [testenv:install-guide-obs] commands = - {toxinidir}/tools/build-install-guides-rst.sh obs + {toxinidir}/tools/build-install-guides-rst.sh obs {posargs} [testenv:install-guide-rdo] commands = - {toxinidir}/tools/build-install-guides-rst.sh rdo + {toxinidir}/tools/build-install-guides-rst.sh rdo {posargs} [testenv:install-guide-ubuntu] commands = - {toxinidir}/tools/build-install-guides-rst.sh ubuntu + {toxinidir}/tools/build-install-guides-rst.sh ubuntu {posargs} [testenv:build] commands =