7.2. call_apiref.sh

The wrapper call_apiref.sh implements a wrapper for the generation of the API reference. The curent default call is:

epydoc

The call itself is deactivated by default, and requires for activation the parameter ‘–apiref’:

python setup.py build_docs --apiref

The expected output is the documentation as prepared HTML, containing the generated API specification in a format similar to javadoc.

7.2.6. Source

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
PROJECT='setupdocx'
VERSION=${DOCX_VERSION:-`date +%Y.%m.%d`}
RELEASE=${DOCX_RELEASE:-$VERSION}
AUTHOR='Arno-Can Uestuensoez'
COPYRIGHT='Copyright (C) 2019 Arno-Can Uestuensoez @Ingenieurbuero Arno-Can Uestuensoez'
LICENSE='Artistic-License-2.0 + Forced-Fairplay-Constraints'
STATUS='beta'
MISSION='Support extensions for setuptools / distutils.'
BUILDDATE=`date`

cat <<EOF
################################################################
#                                                              #
$(printf "# PROJECT = %-51s#" $PROJECT)
#                                                              #
# Generate API reference - default: epydoc                     #
#                                                              #
################################################################
EOF

# the absolute pathname for this source
MYPATH="${BASH_SOURCE%/*}/"
if [ "X${MYPATH#.}" != "X$MYPATH" ];then
	MYPATH="${PWD}/${MYPATH#.}";MYPATH="${MYPATH//\/\//\/}"
fi

# input base directory
INDIR="${INDIR:-$PWD}"
if [ "X${INDIR#.}" != "X$INDIR" ];then
	INDIR="${PWD}/${INDIR#.}";INDIR="${INDIR//\/\//\/}"
fi
INDIR="${INDIR}/"

# output base directory
DOCX_BUILDDIR="${DOCX_BUILDDIR:-build}/"
if [ ! -e "${DOCX_BUILDDIR}" ];then
	mkdir -p "${DOCX_BUILDDIR}"
fi
export PYTHONPATH="$PWD:$PYTHONPATH"

# document source directory
DOCX_DOCSRC="${DOCX_DOCSRC:-docsrc}"
DOCX_DOCSRC="${DOCX_DOCSRC%%/}"


# document source directory
DOCX_DOCNAME="${DOCX_DOCNAME:-$PROJECT}"


DOCX_VERBOSE=${DOCX_VERBOSE:-0}
if((DOCX_VERBOSE > 1));then
	echo "${0##*/}:Called:"
	echo "  $0 $@"
	echo "${0##*/}:Environ Options:"
	echo "  DOCX_APIREF      = '$DOCX_APIREF'"
	echo "  DOCX_BUILDDIR    = '$DOCX_BUILDDIR'"
	echo "  DOCX_CONFDIR     = '$DOCX_CONFDIR'"
	echo "  DOCX_DOCNAME     = '$DOCX_DOCNAME'"
	echo "  DOCX_DOCSRC      = '$DOCX_DOCSRC'"
	echo "  DOCX_DOCTYPE     = '$DOCX_DOCTYPE'"
	echo "  DOCX_NAME        = '$DOCX_NAME'"
	echo "  DOCX_INDEXSRC    = '$DOCX_INDEXSRC'"
	echo "  DOCX_RAWDOC      = '$DOCX_RAWDOC'"
	echo "  DOCX_RELEASE     = '$DOCX_RELEASE'"
	echo "  DOCX_SRCDIR      = '$DOCX_SRCDIR'"
	echo "  DOCX_VERBOSE     = '$DOCX_VERBOSE'"
	echo "  DOCX_VERSION     = '$DOCX_VERSION'"

	echo "  PATH             = '$PATH'"
	echo "  PYTHONPATH       = '$PYTHONPATH'"
	echo "  MYPATH           = '$MYPATH'"
	echo "  INDIR            = '$INDIR'"
	echo
fi

#
# *** start exec ***
#

if [ -e "${DOCX_CONFDIR}/epydoc.conf" ];then
	REFCONF="${DOCX_CONFDIR}/epydoc.conf"
else
	REFCONF="${DOCX_DOCSRC}/conf/epydoc.conf"	
fi
if [ -e "${DOCX_CONFDIR}/epydoc.css" ];then
	REFCSS="${DOCX_CONFDIR}/epydoc.css"
else
	REFCSS="${DOCX_DOCSRC}/conf/epydoc.css"	
fi


CALL=""
CALL="$CALL export PYTHONPATH=$PWD:$PYTHONPATH;"
CALL="$CALL epydoc "
CALL="$CALL --html "
CALL="$CALL --name '${DOCX_NAME}'"
# CALL="$CALL --url 'https://my/url'"
CALL="$CALL --config '${REFCONF}'"
CALL="$CALL --css '${REFCSS}'"
CALL="$CALL --output '${DOCX_BUILDDIR}/apidoc/${DOCX_DOCNAME}/apiref' "

if((DOCX_VERBOSE > 1));then
	for((i=0;i<DOCX_VERBOSE;i++));do
		CALL="$CALL -v "
	done
fi

CALL="$CALL $@"

if [ ! -e "${DOCX_BUILDDIR}/sphinx/apidoc/apiref" ];then
	mkdir -p "${DOCX_BUILDDIR}/sphinx/apidoc/apiref"
fi

if((DOCX_VERBOSE > 1));then
	echo
	echo "${0##*/}:Call: $CALL"
	echo
fi


eval $CALL

echo

7.2.7. Download

call_apiref.sh