diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index be574f4..0bb3078 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -30,6 +30,17 @@ otcdocs_repo_name = 'docs/virtual-private-cloud' otcdocs_git_fqdn = 'gitea.eco.tsi-dev.otc-service.com' otcdocs_git_type = 'gitea' +# Those variables are needed for indexing into OpenSearch +otcdocs_doc_environment = 'internal' +otcdocs_doc_link = '/virtual-private-cloud/api-ref/' +otcdocs_doc_title = 'API Reference' +otcdocs_doc_type = 'api-ref' +otcdocs_service_category = 'network' +otcdocs_service_title = 'Virtual Private Cloud' +otcdocs_service_type = 'vpc' +otcdocs_search_environment = 'hc_de' +otcdocs_search_url = "https://opensearch.eco.tsi-dev.otc-service.com/" + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. diff --git a/tox.ini b/tox.ini index 3ca208b..25415b8 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,9 @@ commands = {posargs} # This env is invoked in the periodic pipeline and is therefore responsible to # build all relevant docs at once. [testenv:docs] -deps = -r{toxinidir}/doc/requirements.txt +deps = + -r{toxinidir}/doc/requirements.txt + -c https://raw.githubusercontent.com/opentelekomcloud-docs/docs-constraints/main/constraints.txt allowlist_externals = mkdir cp @@ -34,13 +36,13 @@ allowlist_externals = commands = rm -rf doc/build/html doc/build/doctrees sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html - {[testenv:api-ref]commands} - {[testenv:json-api-ref]commands} {[testenv:umn]commands} {[testenv:json-umn]commands} + {[testenv:api-ref]commands} + {[testenv:json-api-ref]commands} [testenv:docs-pdf] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = rm mkdir @@ -49,58 +51,13 @@ allowlist_externals = cp commands = mkdir -p doc/build/pdf - {[testenv:api-ref-pdf-docs]commands} {[testenv:umn-pdf-docs]commands} - - -# HTML version -[testenv:api-ref] -deps = -r{toxinidir}/doc/requirements.txt -allowlist_externals = - cp - mkdir -commands = - sphinx-build -W --keep-going -b html api-ref/source doc/build/html/api-ref - mkdir -p api-ref/build/html - cp -av doc/build/html/api-ref api-ref/build/html - -# Json version (for search) -[testenv:json-api-ref] -deps = -r{toxinidir}/doc/requirements.txt -allowlist_externals = - cp - mkdir - sh -commands = - sphinx-build -W --keep-going -b json api-ref/source doc/build/json/api-ref - # Drop data useless for the search - wrap it also with sh/xargs due to bugs - # in tox - sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf" - mkdir -p api-ref/build/json - cp -av doc/build/json/api-ref api-ref/build/json - -# PDF version -[testenv:api-ref-pdf-docs] -deps = -r{toxinidir}/doc/requirements.txt -allowlist_externals = - rm - mkdir - make - bash - cp -commands = - rm -rf api-ref/build/pdf - sphinx-build -W --keep-going -b latex api-ref/source api-ref/build/pdf/ - bash -c "for f in api-ref/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true" - bash -c "for f in api-ref/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" - make -C api-ref/build/pdf - mkdir -p doc/build/pdf - cp api-ref/build/pdf/vpc-api-ref.pdf doc/build/pdf/ + {[testenv:api-ref-pdf-docs]commands} # HTML version [testenv:umn] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = cp mkdir @@ -111,7 +68,7 @@ commands = # Json version (for search) [testenv:json-umn] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = cp mkdir @@ -126,7 +83,7 @@ commands = # PDF version [testenv:umn-pdf-docs] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = rm mkdir @@ -143,6 +100,51 @@ commands = cp umn/build/pdf/vpc-umn.pdf doc/build/pdf/ +# HTML version +[testenv:api-ref] +deps = {[testenv:docs]deps} +allowlist_externals = + cp + mkdir +commands = + sphinx-build -W --keep-going -b html api-ref/source doc/build/html/api-ref + mkdir -p api-ref/build/html + cp -av doc/build/html/api-ref api-ref/build/html + +# Json version (for search) +[testenv:json-api-ref] +deps = {[testenv:docs]deps} +allowlist_externals = + cp + mkdir + sh +commands = + sphinx-build -W --keep-going -b json api-ref/source doc/build/json/api-ref + # Drop data useless for the search - wrap it also with sh/xargs due to bugs + # in tox + sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf" + mkdir -p api-ref/build/json + cp -av doc/build/json/api-ref api-ref/build/json + +# PDF version +[testenv:api-ref-pdf-docs] +deps = {[testenv:docs]deps} +allowlist_externals = + rm + mkdir + make + bash + cp +commands = + rm -rf api-ref/build/pdf + sphinx-build -W --keep-going -b latex api-ref/source api-ref/build/pdf/ + bash -c "for f in api-ref/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true" + bash -c "for f in api-ref/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" + make -C api-ref/build/pdf + mkdir -p doc/build/pdf + cp api-ref/build/pdf/vpc-api-ref.pdf doc/build/pdf/ + + [doc8] ignore = D001 diff --git a/umn/source/conf.py b/umn/source/conf.py index 203841c..3b8cda4 100644 --- a/umn/source/conf.py +++ b/umn/source/conf.py @@ -30,6 +30,17 @@ otcdocs_repo_name = 'docs/virtual-private-cloud' otcdocs_git_fqdn = 'gitea.eco.tsi-dev.otc-service.com' otcdocs_git_type = 'gitea' +# Those variables are needed for indexing into OpenSearch +otcdocs_doc_environment = 'internal' +otcdocs_doc_link = '/virtual-private-cloud/umn/' +otcdocs_doc_title = 'User Guide' +otcdocs_doc_type = 'umn' +otcdocs_service_category = 'network' +otcdocs_service_title = 'Virtual Private Cloud' +otcdocs_service_type = 'vpc' +otcdocs_search_environment = 'hc_de' +otcdocs_search_url = "https://opensearch.eco.tsi-dev.otc-service.com/" + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here.