diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index 03130d3..7e052d5 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -30,6 +30,17 @@ otcdocs_repo_name = 'docs/web-application-firewall-dedicated' 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 = '/web-application-firewall-dedicated/api-ref/' +otcdocs_doc_title = 'API Reference' +otcdocs_doc_type = 'api-ref' +otcdocs_service_category = 'security-services' +otcdocs_service_title = 'Dedicated Web Application Firewall' +otcdocs_service_type = 'wafd' +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/doc/best-practice/source/_static/.placeholder b/doc/best-practice/source/_static/.placeholder new file mode 100644 index 0000000..e69de29 diff --git a/doc/best-practice/source/conf.py b/doc/best-practice/source/conf.py new file mode 100644 index 0000000..d6e726e --- /dev/null +++ b/doc/best-practice/source/conf.py @@ -0,0 +1,117 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# !!! +# This file is generated out of template in doc-exports repository. +# Beware overwriting it locally. + +import os +import sys + +extensions = [ + 'otcdocstheme', +] + +otcdocs_auto_name = False +otcdocs_auto_version = False + +project = 'Dedicated Web Application Firewall' +otcdocs_repo_name = 'docs/web-application-firewall-dedicated' +# Those variables are required for edit/bug links +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 = '/web-application-firewall-dedicated/best-practice/' +otcdocs_doc_title = 'Best Practice' +otcdocs_doc_type = 'best-practice' +otcdocs_service_category = 'security-services' +otcdocs_service_title = 'Dedicated Web Application Firewall' +otcdocs_service_type = 'wafd' +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. +sys.path.insert(0, os.path.abspath('../../')) +sys.path.insert(0, os.path.abspath('../')) +sys.path.insert(0, os.path.abspath('./')) + +# -- General configuration ---------------------------------------------------- +# https://docutils.sourceforge.io/docs/user/smartquotes.html - it does not +# what it is expected +smartquotes = False + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +# +source_encoding = 'utf-8' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +copyright = u'2022-present, Open Telekom Cloud' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +language = 'en' + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +show_authors = False + +# -- Options for HTML output -------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. Major themes that come with +# Sphinx are currently 'default' and 'sphinxdoc'. +# html_theme_path = ["."] +html_theme = 'otcdocs' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +html_theme_options = { + "disable_search": True, + "site_name": "Internal Documentation Portal", + "logo_url": "https://docs-int.otc-service.com", +} + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". + +html_title = "Dedicated Web Application Firewall - Best Practice" + + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Do not include sources into the rendered results +html_copy_source = False + +# -- Options for PDF output -------------------------------------------------- +latex_documents = [ + ('index', + 'wafd-best-practice.tex', + u'Dedicated Web Application Firewall - Best Practice', + u'OpenTelekomCloud', 'manual'), +] diff --git a/doc/best-practice/source/index.rst b/doc/best-practice/source/index.rst new file mode 100644 index 0000000..0d12113 --- /dev/null +++ b/doc/best-practice/source/index.rst @@ -0,0 +1,3 @@ +================================================================== +Welcome to the documentation of web-application-firewall-dedicated +================================================================== diff --git a/doc/source/conf.py b/doc/source/conf.py index 447c27b..f937988 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -31,6 +31,17 @@ otcdocs_repo_name = 'docs/web-application-firewall-dedicated' 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 = '' +otcdocs_doc_link = '' +otcdocs_doc_title = '' +otcdocs_doc_type = '' +otcdocs_service_category = '' +otcdocs_service_title = '' +otcdocs_service_type = 'wafd' +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 8cadfda..2d64950 100644 --- a/tox.ini +++ b/tox.ini @@ -36,6 +36,8 @@ commands = 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:best-practice]commands} + {[testenv:json-best-practice]commands} {[testenv:umn]commands} {[testenv:json-umn]commands} @@ -50,6 +52,7 @@ allowlist_externals = commands = mkdir -p doc/build/pdf {[testenv:api-ref-pdf-docs]commands} + {[testenv:best-practice-pdf-docs]commands} {[testenv:umn-pdf-docs]commands} @@ -98,6 +101,47 @@ commands = cp api-ref/build/pdf/wafd-api-ref.pdf doc/build/pdf/ +# HTML version +[testenv:best-practice] +deps = -r{toxinidir}/doc/requirements.txt +allowlist_externals = + cp + mkdir +commands = + sphinx-build -W --keep-going -b html doc/best-practice/source doc/build/html/best-practice + +# Json version (for search) +[testenv:json-best-practice] +deps = -r{toxinidir}/doc/requirements.txt +allowlist_externals = + cp + mkdir + sh +commands = + sphinx-build -W --keep-going -b json doc/best-practice/source doc/build/json/best-practice + # 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" + +# PDF version +[testenv:best-practice-pdf-docs] +deps = -r{toxinidir}/doc/requirements.txt +allowlist_externals = + rm + mkdir + make + bash + cp +commands = + rm -rf doc/best-practice/build/pdf + sphinx-build -W --keep-going -b latex doc/best-practice/source doc/best-practice/build/pdf/ + bash -c "for f in doc/best-practice/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true" + bash -c "for f in doc/best-practice/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" + make -C doc/best-practice/build/pdf + mkdir -p doc/build/pdf + cp doc/best-practice/build/pdf/wafd-best-practice.pdf doc/build/pdf/ + + # HTML version [testenv:umn] deps = -r{toxinidir}/doc/requirements.txt diff --git a/umn/source/conf.py b/umn/source/conf.py index d82315d..8211332 100644 --- a/umn/source/conf.py +++ b/umn/source/conf.py @@ -30,6 +30,17 @@ otcdocs_repo_name = 'docs/web-application-firewall-dedicated' 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 = '/web-application-firewall-dedicated/umn/' +otcdocs_doc_title = 'User Guide' +otcdocs_doc_type = 'umn' +otcdocs_service_category = 'security-services' +otcdocs_service_title = 'Dedicated Web Application Firewall' +otcdocs_service_type = 'wafd' +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.