Browse Source

Remove markdown script

The image-api and identity-api repositories are retired, remove
support for building it. This also includes removing the now
obsolete markdown script and the obsolete pandoc-template.docbook.

Change-Id: I619244c755b9f85102743196c8ec5fcc09dc76a6
changes/66/284366/2
Andreas Jaeger 5 years ago
parent
commit
92944e11b3
4 changed files with 1 additions and 127 deletions
  1. +0
    -30
      os_doc_tools/doctest.py
  2. +0
    -74
      os_doc_tools/scripts/markdown-docbook.sh
  3. +0
    -21
      os_doc_tools/scripts/pandoc-template.docbook
  4. +1
    -2
      tox.ini

+ 0
- 30
os_doc_tools/doctest.py View File

@ -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"],


+ 0
- 74
os_doc_tools/scripts/markdown-docbook.sh View File

@ -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|<title>NO TITLE</title>|<title>$TITLE</title>|" > \
${DIRPATH}/$FILENAME.xml
pwd

+ 0
- 21
os_doc_tools/scripts/pandoc-template.docbook View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<chapter id="$xmlid$">
<chapterinfo>
<title>$if(title)$ $title$ $else$NO TITLE$endif$</title>
$for(author)$
<author>
$author$
</author>
$endfor$
$if(date)$
<date>$date$</date>
$endif$
</chapterinfo>
$for(include-before)$
$include-before$
$endfor$
$body$
$for(include-after)$
$include-after$
$endfor$
</chapter>

+ 1
- 2
tox.ini View File

@ -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


Loading…
Cancel
Save