ofs | hex dump | ascii |
---|
0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 04 2c 00 00 03 53 08 02 00 00 00 ea a3 1b | .PNG........IHDR...,...S........ |
0020 | 5d 00 00 00 03 73 42 49 54 08 08 08 db e1 4f e0 00 00 00 19 74 45 58 74 53 6f 66 74 77 61 72 65 | ]....sBIT.....O.....tEXtSoftware |
0040 | 00 67 6e 6f 6d 65 2d 73 63 72 65 65 6e 73 68 6f 74 ef 03 bf 3e 00 00 20 00 49 44 41 54 78 9c ec | .gnome-screenshot...>....IDATx.. |
0060 | dd 77 40 13 67 ff 00 f0 ef 73 77 b9 4c 32 08 7b c9 10 44 14 1c 80 7b d7 81 a3 ad 03 ad ad f5 b5 | .w@.g....sw.L2.{..D...{......... |
0080 | 75 b5 55 db aa 1d da 9f b5 da e5 6a 6b a7 ab 4b 3b b5 c3 f9 da 56 ab d6 5d f5 55 b4 05 b7 16 d4 | u.U........jk..K;....V..].U..... |
00a0 | ba 00 21 6c 42 d6 f3 fb e3 42 88 49 c0 30 04 91 ef e7 0f 25 97 e3 b9 e7 c2 e5 ee f9 3e 93 24 26 | ..!lB....B.I.0.....%........>.$& |
00c0 | 26 c2 fd e2 ec d9 b3 d1 d1 d1 0d 9d 0b 84 2a 9c 3d 7b 36 34 34 b4 a1 73 81 10 42 08 21 74 6f 61 | &.............*.={644..s..B.!toa |
00e0 | 1a 3a 03 08 21 84 10 42 08 a1 a6 05 83 10 84 10 42 08 21 84 50 bd e2 ea 2a 21 4a a9 5e af 2f 29 | .:..!..B........B.!.P...*!J.^./) |
0100 | 29 31 1a 8d 16 8b 85 52 0a 00 84 10 86 61 38 8e 93 cb e5 12 89 84 10 52 57 87 43 08 21 84 10 42 | )1.....R.....a8........RW.C.!..B |
0120 | 08 35 52 75 10 84 94 95 95 e9 74 3a b3 d9 5c 56 56 56 5c 5c 6c b1 58 cc 66 b3 c5 62 01 00 86 61 | .5Ru......t:..\VVV\\l.X.f..b...a |
0140 | 58 96 65 18 46 2e 97 8b c5 62 8e e3 d4 6a b5 58 2c ae fd 41 11 42 08 21 84 10 42 8d 54 ad 82 10 | X.e.F....b...j.X,..A.B.!..B.T... |
0160 | 83 c1 a0 d3 e9 ca ca ca 72 73 73 8d 46 a3 f3 0e 66 b3 d9 6c 36 03 80 5e af 07 00 91 48 54 56 56 | ........rss.F...f..l6..^....HTVV |
0180 | 26 16 8b 35 1a 0d cf f3 b5 39 34 42 08 21 84 10 42 a8 91 aa 79 10 52 50 50 a0 d3 e9 f2 f3 f3 cb | &..5.....94B.!..B...y.RPP....... |
01a0 | ca ca dc fc 15 a3 d1 98 99 99 29 16 8b f5 7a bd 46 a3 51 2a 95 35 3e 3a 42 08 21 84 10 42 a8 91 | ..........)...z.F.Q*.5>:B.!..B.. |
01c0 | aa e1 c0 f4 5b b7 6e 65 66 66 66 65 65 55 16 81 3c 16 ae fe ae 47 88 4a e4 22 fd b2 b2 b2 ac ac | ....[.nefffeeU..<....G.J."...... |
01e0 | ac ac ac ac 5b b7 6e d5 ec e8 08 21 84 10 42 08 a1 c6 ab 26 2d 21 37 6f de cc cb cb 2b 2c 2c ac | ....[.n....!..B....&-!7o....+,,. |
0200 | 6c 87 c1 41 1e cb 3b 07 01 c0 56 79 d8 90 9d 19 f9 46 8b f3 3e 3a 9d ce 64 32 99 4c 26 3f 3f bf | l..A..;...Vy.....F..>:..d2.L&??. |
0220 | 1a e4 01 21 84 10 42 08 21 d4 48 55 bb 25 e4 d6 ad 5b 55 47 20 00 20 44 20 00 10 eb 29 7d 26 da | ...!..B.!.HU.%...[UG...D....)}&. |
0240 | ab b2 dd 0a 0b 0b f3 f2 f2 b0 3d 04 21 84 10 42 08 a1 26 a5 7a 2d 21 c2 38 90 2a 22 90 58 8d e4 | ..........=.!..B..&.z-!.8.*".X.. |
0260 | 99 16 5a 15 cf da b6 cc 8e f3 19 1c e4 71 20 ab 78 7f 66 f1 90 20 65 37 5f f9 f7 e9 79 8b d2 b2 | ..Z..........q..x.f...e7_...y... |
0280 | 84 77 0b 0b 0b 39 8e e3 79 1e c7 87 20 84 10 42 08 21 d4 44 54 23 08 11 e6 c2 ca cb cb 13 5e 86 | .w...9..y......B.!.DT#........^. |
02a0 | c8 45 83 82 94 2a 9e 51 f3 6c 9e c1 7c 30 b3 64 76 9c 4f 37 5f b9 f3 2f c6 7a 4a ed 9b 44 06 07 | .E...*.Q.l..|0.dv.O7_../.zJ..D.. |
02c0 | 79 d8 82 10 00 d0 e9 74 22 91 48 2a 95 8a 44 a2 5a 9c 08 42 08 21 84 10 42 a8 71 a8 46 10 22 cc | y......t".H*..D.Z..B.!..B.q.F.". |
02e0 | 85 65 7b f9 5d cf 90 58 8d b4 26 c7 74 5a b1 b0 a0 a0 40 22 91 f8 fa fa d6 24 35 84 10 42 08 21 | .e{.]..X..&.tZ....@".....$5..B.! |
0300 | 84 50 a3 e2 6e 10 52 56 ce b6 25 df e0 62 b8 39 00 e4 1b cc bf 5c 2d f8 fe 9f bc 03 59 c5 b6 8d | .P..n.RV..%..b.9.....\-.....Y... |
0320 | b1 1a c9 e0 20 e5 33 d1 5a 15 cf c6 6a a4 83 83 3c 7e b9 5a d1 a7 4b af d7 97 95 95 19 0c 86 7a | ......3.Z...j...<~.Z..K........z |
0340 | 5e 3c 84 61 98 ee dd bb 9b 4c a6 6e dd ba 1d 3c 78 b0 79 f3 e6 9e 9e 9e 7f fc f1 87 d1 68 3c 75 | ^<.a.....L.n...<x.y..........h<u |
0360 | ea 54 5c 5c 5c df be 7d f7 ed db 97 90 90 20 12 89 f6 ef df df bf 7f ff fd fb f7 1f 39 72 44 58 | .T\\\..}....................9rDX |
0380 | 8a 11 a1 7a d0 aa 55 ab 0b 17 2e 18 0c 86 86 ce 08 42 08 21 84 50 9d 61 03 03 03 dd d9 2f 27 27 | ...z..U..........B.!.P.a...../'' |
03a0 | 27 3b 3b db be f0 3d 38 48 19 a5 72 5c fb 3c 4d 57 3a 64 67 c6 f7 e9 79 57 8a 6f 5b bb 30 4b 6f | ';;...=8H..r\.<MW:dg...yW.o[.0Ko |
03c0 | 3a 90 55 bc fa 42 ae 84 25 89 5e b2 be 01 1e 1b 2e e7 db cf 9a 65 34 1a 59 96 55 28 14 b5 38 17 | :.U..B..%.^..........e4.Y.U(..8. |
03e0 | b8 75 eb 96 97 57 a5 e3 e0 9d 45 47 47 fb f8 f8 8c 19 33 e6 fc f9 f3 21 21 21 09 09 09 fb f7 ef | .u...W....EGG.....3....!!!...... |
0400 | 1f 39 72 a4 9f 9f df d1 a3 47 e7 cd 9b 97 96 96 96 90 90 10 19 19 79 e0 c0 81 b1 63 c7 16 14 14 | .9r......G............y....c.... |
0420 | f0 3c ef e1 e1 71 e5 ca 95 da e4 13 35 1d b7 6e dd 52 ab d5 ee ec 19 1c 1c 12 1b 1b 1b 1a da 0c | .<...q......5..n.R.............. |
0440 | 00 ec 9b 1c df 78 f3 ad f6 ed da 1f 3a 74 d8 6c 36 dd ad 5c 22 84 10 ba 07 a8 54 2a 89 54 5a a6 | .....x......:t.l6..\".....T*.TZ. |
0460 | d7 37 74 46 10 ba 33 5f 5f df f8 84 84 d6 b1 b1 fe fe fe 25 25 25 25 25 25 d5 4d c1 ad 96 10 4a | .7tF..3__..........%%%%%%.M....J |
0480 | a9 c9 64 72 58 13 fd 40 76 f1 e0 66 1e 84 10 4a a9 f0 ef 49 9d 7e c8 0e d7 13 f2 0a f2 8d 96 57 | ..drX..@v..f...J...I.~.........W |
04a0 | 52 6e a6 e9 f4 2b ba 05 2d 4c f0 1b b3 f7 5f db 5b 06 83 c1 6c 36 0b 49 55 f7 1c 6a 4c 2c 16 8f | Rn...+..-L...._.[...l6.IU..jL,.. |
04c0 | 18 31 e2 d0 a1 43 32 99 2c 36 36 76 fd fa f5 49 49 49 39 39 39 17 2f 5e 0c 08 08 d8 b3 67 4f 78 | .1...C2.,66v...III999./^.....gOx |
04e0 | 78 78 50 50 d0 a6 4d 9b 86 0f 1f 7e f9 f2 e5 eb d7 af f7 #!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2016 NEC and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
set +e
DOCS_DIR=${DOCS_DIR:-docs}
INDEX_RST=${INDEX_RST:-index.rst}
BUILD_DIR=${BUILD_DIR:-docs_build}
OUTPUT_DIR=${OUTPUT_DIR:-docs_output}
SRC_DIR=${SRC_DIR:-$BUILD_DIR/_src}
VENV_DIR=${VENV_DIR:-$BUILD_DIR/_venv}
OPNFVDOCS_DIR=${OPNFVDOCS_DIR:-$BUILD_DIR/_opnfvdocs}
GERRIT_COMMENT=${GERRIT_COMMENT:-}
revision="$(git rev-parse --short HEAD)"
rev_full="$(git rev-parse HEAD)"
version="$(git tag | tail -1)"
project="$(basename $(git rev-parse --show-toplevel))"
html_notes=" Revision: $rev_full\n Build date: $(date -u +'%Y-%m-%d')"
opnfv_logo="$OPNFVDOCS_DIR/etc/opnfv-logo.png"
copyright="$(date +%Y), OPNFV."
copyrightlong="$(date +%Y), OPNFV. Licensed under CC BY 4.0."
error_count=0
function set_error() {
# TODO(yujunz) log detail errors
error_count=$((error_count + 1))
}
if [ "$(uname)" == "Darwin" ]; then
# Override system $SED/$FIND with gnu $SED and gnu $FIND
# If not found, install with
# $ brew install gnu-sed findutils
echo "macOS detected."
SED="gsed"
FIND="gfind"
else
SED="sed"
FIND="find"
fi
function check_rst_doc() {
_src="$1"
# Note: This check may fail in many jobs for building project docs, since
# the old sample has lines more than 120. We ignore failures on this
# check right now, but these have to be fixed before OPNFV B release.
_out=$(doc8 --max-line-length 240 --ignore D000 "$_src") || {
_msg='Warning: rst validation (doc8) has failed, please fix the following error(s).'
_errs=$(echo "$_out" | $SED -n -e "/^$_src/s/^/ /p")
echo
echo -e "$_msg\n$_errs"
echo
if [ -n "$GERRIT_COMMENT" ]; then
echo -e "$_msg\n$_errs" >> "$GERRIT_COMMENT"
fi
}
}
function add_html_notes() {
_src="$1"
$FIND "$_src" -name '*.rst' | while read file
do
if grep -q -e ' _sha1_' "$file" ; then
# TODO: remove this, once old templates were removed from all repos.
echo
echo "Warn: '_sha1_' was found in [$file], use the latest document template."
echo " See http://artifacts.opnfv.org/opnfvdocs/docs/how-to-use-docs ."
echo
$SED -i "s/ _sha1_/ $git_sha1/g" "$file"
fi
$SED -i -e "\$a\\\n..\n$html_notes" "$file"
done
}
function prepare_src_files() {
mkdir -p "$(dirname $SRC_DIR)"
if [ -e "$SRC_DIR" ]; then
rm -rf "$SRC_DIR"
fi
cp -r "$DOCS_DIR" "$SRC_DIR"
add_html_notes "$SRC_DIR"
}
function add_config() {
_conf="$1"
_param="$2"
_val="$3"
if ! grep -q -e "^$_param = " "$_conf" ; then
echo "Adding '$_param' into $_conf ..."
echo "$_param = $_val" >> "$_conf"
fi
}
# Note: User can customize config for specific document by creating 'conf.py'
# in the taeget document dir (e.g. docs/abc/conf.py). This config file does
# not need to cover all config parameter, as all missing parameter will be
# automatically filled by this function.
function prepare_config() {
_src="$1"
_name="$2"
_conf="$_src/conf.py"
touch "$_conf"
# default params
# Note: If you want to add a new sphinx extention here, you may need python
# package for it (e.g. python package 'sphinxcontrib-httpdomain' is
# required by 'sphinxcontrib.httpdomain'). If you need such python
# package, add the name of the python package into the requirement
# list 'docs/etc/requirements.txt' .
add_config "$_conf" 'extensions' \
"['sphinxcontrib.httpdomain', 'sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon']"
add_config "$_conf" 'needs_sphinx' "'1.3'"
add_config "$_conf" 'numfig' "True"
add_config "$_conf" 'master_doc' "'index'"
add_config "$_conf" 'pygments_style' "'sphinx'"
add_config "$_conf" 'html_use_index' "False"
add_config "$_conf" 'html_last_updated_fmt' "'%b %d, %Y'"
add_config "$_conf" 'html_logo' "'opnfv-logo.png'"
add_config "$_conf" 'html_sidebars' \
"{'**': ['globaltoc.html',
'$(cd $OPNFVDOCS_DIR; pwd)/etc/pagemenu.html',
'searchbox.html']}"
# genarated params
add_config "$_conf" 'release' "u'$version'"
add_config "$_conf" 'version' "u'$version'"
add_config "$_conf" 'project' "u'$project'"
add_config "$_conf" 'copyright' "u'$copyrightlong'"
add_config "$_conf" 'rst_epilog' "u'$html_notes'"
echo "sphinx config to be used:"
echo
$SED -e "s/^/ /" "$_conf"
echo
}
function is_top_dir() {
[[ "$1" == "$DOCS_DIR" ]]
}
function generate_name_for_top_dir() {
for suffix in '' '.top' '.all' '.master' '_' '__' '___'
do
_name="$(basename $DOCS_DIR)$suffix"
[[ -e "$DOCS_DIR/$_name" ]] && continue
echo "$_name"
return
done
echo "Error: cannot find name for top directory [$DOCS_DIR]"
set_error
}
function generate_name() {
_dir=$1
if is_top_dir "$_dir" ; then
_name=$(generate_name_for_top_dir $DOCS_DIR)
else
_name="${_dir#$DOCS_DIR/}"
fi
# Replace '/' by '_'
echo "${_name////_}"
}
if [[ ! -d "$OPNFVDOCS_DIR" ]] ; then
echo "Error: $OPNFVDOCS_DIR dir not found."
echo "See http://artifacts.opnfv.org/opnfvdocs/docs/how-to-use-docs ."
set_error
fi
if ! which virtualenv > /dev/null ; then
echo "Error: 'virtualenv' not found. Exec 'sudo pip install virtualenv' first."
set_error
fi
# workaround for doc8 error in python2.6
if [[ $(python -V 2>&1) == Python\ 2.6.* ]] && [ -e /usr/bin/python2.7 ]; then
echo "creating venv with Python 2.7 instead of Python 2.6.x ..."
virtualenv "$VENV_DIR" --python=/usr/bin/python2.7
else
virtualenv "$VENV_DIR"
fi
source "$VENV_DIR/bin/activate"
pip install -r "$OPNFVDOCS_DIR/etc/requirements.txt"
check_rst_doc $DOCS_DIR
prepare_src_files
if [ -e "$DOCS_DIR/pre-hook.sh" ]; then
source "$DOCS_DIR/pre-hook.sh"
fi
$FIND $DOCS_DIR -name $INDEX_RST -printf '%h\n' | while read dir
do
name=$(generate_name $dir)
if is_top_dir "$dir" ; then
src="$SRC_DIR"
else
src="$SRC_DIR/${dir#$DOCS_DIR/}"
fi
build="$BUILD_DIR/$name"
output="$OUTPUT_DIR/$name"
echo
echo "#################${dir//?/#}"
echo "Building DOCS in $dir"
echo "#################${dir//?/#}"
echo
prepare_config "$src" "$name"
cp -f $opnfv_logo "$src/opnfv-logo.png"
mkdir -p "$output"
{
sphinx-build -b singlehtml -t singlehtml -E "$src" "$output"
} || {
msg="Error: HTML creation for $dir has failed."
echo
echo "$msg"
echo
if [ -n "$GERRIT_COMMENT" ]; then
echo "$msg" >> "$GERRIT_COMMENT"
fi
}
if is_top_dir "$dir" ; then
# NOTE: Having top level document (docs/index.rst) is not recommended.
# It may cause conflicts with other docs (mostly with HTML
# folders for contents in top level docs and other document
# folders). But, let's try merge of those contents into the top
# docs directory.
(
cd $output
$FIND . -type d -print | xargs -I d mkdir -p ../d
$FIND . -type f -print | xargs -I f mv -b f ../f
)
rm -rf "$output"
fi
done
deactivate
exit $error_count
|