+# 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"
+
+ # 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_logo' "'opnfv-logo.png'"
+ add_config "$_conf" 'latex_domain_indices' "False"
+ add_config "$_conf" 'latex_logo' "'opnfv-logo.png'"
+
+ # genarated params
+ title=$(cd $_src; python -c "$get_title_script")
+ latex_conf="[('index', '$_name.tex', \"$title\", 'OPNFV', 'manual'),]"
+ add_config "$_conf" 'latex_documents' "$latex_conf"
+ add_config "$_conf" 'release' "u'$version'"
+ add_config "$_conf" 'version' "u'$version'"
+ add_config "$_conf" 'project' "u'$project'"
+ add_config "$_conf" 'copyright' "u'$copyright'"
+ add_config "$_conf" 'rst_epilog' "u'$html_notes'"
+
+ echo "sphinx config to be used:"
+ echo
+ sed -e "s/^/ /" "$_conf"
+ echo
+}
+