identity-api/v3/preprocess.sh
Diane Fleming d5a3839b47 Clean up files for identity v2.0 reference
Change-Id: I2c7539d889a8186c957b0bc7a695b32429b138bc
author: diane fleming
2014-05-20 11:31:07 -05:00

20 lines
564 B
Bash
Executable File

#!/bin/sh
# Converts the Markdown source into DocBook format suitable for using
# in the Maven build process.
#
# Adapted from:
# https://wiki.openstack.org/wiki/Documentation/Builds#Markdown_and_DocBook
SOURCES=`ls src/markdown/*.md`
FILENAME=identity-api-v3
DIRPATH=.
XSL=/usr/share/xml/docbook/stylesheet/docbook5/db4-upgrade.xsl
pandoc -f markdown -t docbook -s $SOURCES | \
xsltproc -o - $XSL - | \
xmllint --format -| \
sed -e "s,<article,<chapter xml:id=\"$FILENAME\"," | \
sed -e 's,</article>,</chapter>,' > ${DIRPATH}/$FILENAME.xml