diff options
-rw-r--r-- | etc/pagemenu.html | 21 | ||||
-rwxr-xr-x | scripts/docs-build.sh | 15 |
2 files changed, 35 insertions, 1 deletions
diff --git a/etc/pagemenu.html b/etc/pagemenu.html new file mode 100644 index 000000000..67601b655 --- /dev/null +++ b/etc/pagemenu.html @@ -0,0 +1,21 @@ +{# + opnfvdocs/etc/pagemenu.html + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Sphinx sidebar template: link to pdfcrowd. + + :copyright: Copyright 2016 by OPNFV. + :license: Apache 2.0 . +#} +<div role="note" aria-label="source link"> + <h3>{{ _('This Page') }}</h3> + <ul class="this-page-menu"> + {%- if show_source and has_source and sourcename %} + <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" + rel="nofollow">{{ _('Show Source') }}</a></li> + {%- else %} + {# Note: single HTML won't have source rst #} + <li><a href="//pdfcrowd.com/url_to_pdf/">Save to PDF</a></li> + {%- endif %} + </ul> +</div> diff --git a/scripts/docs-build.sh b/scripts/docs-build.sh index 5a7dbc06e..7d8abf1ca 100755 --- a/scripts/docs-build.sh +++ b/scripts/docs-build.sh @@ -110,6 +110,8 @@ function prepare_config() { _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 @@ -126,6 +128,10 @@ function prepare_config() { add_config "$_conf" 'html_logo' "'opnfv-logo.png'" add_config "$_conf" 'latex_domain_indices' "False" add_config "$_conf" 'latex_logo' "'opnfv-logo.png'" + add_config "$_conf" 'html_sidebars' \ + "{'**': ['globaltoc.html', + '$(cd $OPNFVDOCS_DIR; pwd)/etc/pagemenu.html', + 'searchbox.html']}" # genarated params title=$(cd $_src; python -c "$get_title_script") @@ -184,7 +190,14 @@ if ! which virtualenv > /dev/null ; then exit 1 fi -virtualenv "$VENV_DIR" +# 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" |