diff --git a/os_doc_tools/doctest.py b/os_doc_tools/doctest.py index fadde0e3..a72f4955 100755 --- a/os_doc_tools/doctest.py +++ b/os_doc_tools/doctest.py @@ -973,36 +973,6 @@ def build_book(book, publish_path, log_path): ["mvn", "generate-sources", comments, release, "-B"], stderr=subprocess.STDOUT ) - # Repository: identity-api - elif (cfg.CONF.repo_name == "identity-api" - and book.endswith("v3")): - output = subprocess.check_output( - ["bash", os.path.join(SCRIPTS_DIR, "markdown-docbook.sh"), - "identity-api-v3"], - stderr=subprocess.STDOUT - ) - out_file.write(output) - # File gets generated at wrong directory, we need to move it - # around - if os.path.isfile('identity-api-v3.xml'): - os.remove('identity-api-v3.xml') - shutil.move("src/markdown/identity-api-v3.xml", ".") - output = subprocess.check_output( - ["mvn", "generate-sources", comments, release, "-B"], - stderr=subprocess.STDOUT - ) - # Repository: image-api - elif base_book == 'image-api-v2': - output = subprocess.check_output( - ["bash", os.path.join(SCRIPTS_DIR, "markdown-docbook.sh"), - "image-api-v2.0"], - stderr=subprocess.STDOUT - ) - out_file.write(output) - output = subprocess.check_output( - ["mvn", "generate-sources", comments, release, "-B"], - stderr=subprocess.STDOUT - ) else: output = subprocess.check_output( ["mvn", "generate-sources", comments, release, "-B"], diff --git a/os_doc_tools/scripts/markdown-docbook.sh b/os_doc_tools/scripts/markdown-docbook.sh deleted file mode 100755 index 2805c8e0..00000000 --- a/os_doc_tools/scripts/markdown-docbook.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -ex - -# Documentation can be submitted in markdown and then converted to -# docbook so it can be built with the maven plugin. This is used by -# Jenkins when invoking certain docs jobs and the resulting output is -# made available to maven. - -# In case we start doing something more sophisticated with other refs -# later (such as tags). -BRANCH=$ZUUL_REFNAME -shopt -s extglob - -# This function figures out the location of the original script (as -# opposed to any chain of symlinks pointing to it). Source: -# http://muffinresearch.co.uk/archives/2008/10/10/bash-resolving-symlinks-to-shellscripts/ -function resolve_symlink { - SCRIPT=$1 NEWSCRIPT='' - until [ "$SCRIPT" = "$NEWSCRIPT" ]; do - if [ "${SCRIPT:0:1}" = '.' ]; then - SCRIPT=$PWD/$SCRIPT; - fi - cd $(dirname $SCRIPT) - if [ ! "${SCRIPT:0:1}" = '.' ]; then - SCRIPT=$(basename $SCRIPT); - fi - SCRIPT=${NEWSCRIPT:=$SCRIPT} - NEWSCRIPT=$(ls -l $SCRIPT | awk '{ print $NF }') - done - if [ ! "${SCRIPT:0:1}" = '/' ]; then - SCRIPT=$PWD/$SCRIPT; - fi - echo $(dirname $SCRIPT) -} -DIR=$(resolve_symlink $0) - -# Find location of db4-upgrade-xsl: -if [ -e /usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl ] ; then - DB_UPGRADE=/usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl -elif [ -e /usr/share/xml/docbook/stylesheet/upgrade/db4-upgrade.xsl ] ; then - DB_UPGRADE=/usr/share/xml/docbook/stylesheet/upgrade/db4-upgrade.xsl -else - echo "db4-upgrade.xsl not found" - exit 1 -fi - -# Need to get the file name to insert here so it can be reused for -# multiple projects Filenames for the known repos that could do this -# are openstackapi-programming.mdown and images-api-v2.0.md and -# openstackapi-programming and images-api-v2.0 are the names for the -# ID and xml filename. - -FILENAME=$1 -FILEPATH=`find ./ -regextype posix-extended \ - -regex ".*${FILENAME}\.(md|markdown|mdown)"` -DIRPATH=`dirname $FILEPATH` -SOURCES=`ls $DIRPATH/*.md` - -# Check for requirements -type -P pandoc > /dev/null 2>&1 || \ - { echo >&2 "pandoc not installed. Aborting."; exit 1; } -type -P xsltproc > /dev/null 2>&1 || \ - { echo >&2 "xsltproc not installed. Aborting."; exit 1; } -type -P xmllint > /dev/null 2>&1 || \ - { echo >&2 "xmllint not installed. Aborting."; exit 1; } - -TITLE=`head -n1 $DIRPATH/$FILENAME.md|sed -e 's/^#* *//'` -pandoc -V xmlid=$FILENAME --template=$DIR/pandoc-template.docbook \ - -f markdown -t docbook -s ${SOURCES} |\ - xsltproc -o - ${DB_UPGRADE} - |\ - xmllint --format - |\ - sed -e "s|NO TITLE|$TITLE|" > \ - ${DIRPATH}/$FILENAME.xml - -pwd diff --git a/os_doc_tools/scripts/pandoc-template.docbook b/os_doc_tools/scripts/pandoc-template.docbook deleted file mode 100644 index a314bdee..00000000 --- a/os_doc_tools/scripts/pandoc-template.docbook +++ /dev/null @@ -1,21 +0,0 @@ - - - - $if(title)$ $title$ $else$NO TITLE$endif$ -$for(author)$ - - $author$ - -$endfor$ -$if(date)$ - $date$ -$endif$ - -$for(include-before)$ -$include-before$ -$endfor$ -$body$ -$for(include-after)$ -$include-after$ -$endfor$ - diff --git a/tox.ini b/tox.ini index cc7e00b4..5c4eaa27 100644 --- a/tox.ini +++ b/tox.ini @@ -21,8 +21,7 @@ commands = # the check and gate queues. bashate autogenerate_config_docs/autohelp-wrapper \ bin/doc-tools-check-languages \ - cleanup/remove_trailing_whitespaces.sh \ - os_doc_tools/scripts/markdown-docbook.sh + cleanup/remove_trailing_whitespaces.sh [testenv:pylint] commands = pylint os_doc_tools cleanup