diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index 17aeba0..e8a3f8f 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -78,7 +78,7 @@ html_theme = 'otcdocs' # further. For a list of options available for each theme, see the # documentation. html_theme_options = { - "disable_search": "True", + "disable_search": True, "site_name": "Internal Documentation Portal", "logo_url": "https://docs-int.otc-service.com", } diff --git a/doc/component-operation-guide/conf.py b/doc/component-operation-guide/conf.py new file mode 100644 index 0000000..76bb3b0 --- /dev/null +++ b/doc/component-operation-guide/conf.py @@ -0,0 +1,103 @@ +# 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 = 'Map Reduce Service' +otcdocs_repo_name = 'docs/mapreduce-service' +# Those variables are required for edit/bug links +otcdocs_git_fqdn = 'gitea.eco.tsi-dev.otc-service.com' +otcdocs_git_type = 'gitea' + +# 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 = "Map Reduce Service - Component Operation Guide" + + +# 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'] + +# -- Options for PDF output -------------------------------------------------- +latex_documents = [ + ('index', + 'mrs-component-operation-guide.tex', + u'Map Reduce Service - Component Operation Guide', + u'OpenTelekomCloud', 'manual'), +] diff --git a/tox.ini b/tox.ini index 7c03544..f07a467 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.1 -envlist = py36,py37,pep8 +envlist = py39,pep8 skipsdist = True ignore_basepython_conflict = True @@ -8,70 +8,107 @@ ignore_basepython_conflict = True usedevelop = True install_command = pip install {opts} {packages} deps = - -r{toxinidir}/requirements.txt + -r{toxinidir}/requirements.txt commands = stestr run {posargs} - stestr slowest + stestr slowest [testenv:pep8] commands = - doc8 doc/source README.rst + doc8 doc/source README.rst [testenv:venv] deps = - -r{toxinidir}/requirements.txt + -r{toxinidir}/requirements.txt commands = {posargs} [testenv:docs] -deps = - -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} - -r{toxinidir}/doc/requirements.txt commands = - sphinx-build -W --keep-going -b html doc/source/ doc/build/html + {[testenv:api-ref]commands} + {[testenv:operation-guide]commands} + {[testenv:umn]commands} + +[testenv:docs-pdf] +whitelist_externals = + mkdir +commands = + mkdir -p doc/build/pdf + {[testenv:api-ref-pdf-docs]commands} + {[testenv:operation-guide-pdf-docs]commands} + {[testenv:umn-pdf-docs]commands} + [testenv:api-ref] -# This environment is called from CI scripts to test and publish -# the API Ref to docs.otc-service.com -deps = - -r{toxinidir}/requirements.txt -whitelist_externals = rm +whitelist_externals = + cp + mkdir commands = - rm -rf api-ref/build - sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html + 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 [testenv:api-ref-pdf-docs] -deps = {[testenv:api-ref]deps} -envdir = {toxworkdir}/api-ref whitelist_externals = rm + mkdir make - sh + bash + cp commands = rm -rf api-ref/build/pdf - sphinx-build -a -E -W -b latex api-ref/source api-ref/build/pdf - sh -c "for f in api-ref/build/pdf/*.gif; do gif2png -dprsO $f; done || true" - sh -c "for f in api-ref/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" + 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/mrs-api-ref.pdf doc/build/pdf/ -[testenv:umn] -# This environment is called from CI scripts to test and publish -# the UMN to docs.otc-service.com -deps = - -r{toxinidir}/requirements.txt -whitelist_externals = rm + +[testenv:operation-guide] +whitelist_externals = + cp + mkdir commands = - rm -rf umn/build - sphinx-build -W -b html -d umn/build/doctrees umn/source umn/build/html + sphinx-build -W --keep-going -b html doc/component-operation-guide/source doc/build/html/operation-guide -[testenv:umn-pdf-docs] -deps = {[testenv:umn]deps} -envdir = {toxworkdir}/umn +[testenv:operation-guide-pdf-docs] whitelist_externals = rm + mkdir make - sh + bash + cp +commands = + rm -rf doc/component-operation-guide/build/pdf + sphinx-build -W --keep-going -b latex doc/component-operation-guide/source doc/component-operation-guide/build/pdf/ + bash -c "for f in doc/component-operation-guide/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true" + bash -c "for f in doc/component-operation-guide/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" + make -C doc/component-operation-guide/build/pdf + mkdir -p doc/build/pdf + cp doc/component-operation-guide/build/pdf/mrs-component-operation-guide.pdf doc/build/pdf/ + + +[testenv:umn] +whitelist_externals = + cp + mkdir +commands = + sphinx-build -W --keep-going -b html umn/source doc/build/html/umn + mkdir -p umn/build/html + cp -av doc/build/html/umn umn/build/html + +[testenv:umn-pdf-docs] +whitelist_externals = + rm + mkdir + make + bash + cp commands = rm -rf umn/build/pdf - sphinx-build -a -E -W -b latex umn/source umn/build/pdf - sh -c "for f in umn/build/pdf/*.gif; do gif2png -dprsO $f; done || true" - sh -c "for f in umn/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" + sphinx-build -W --keep-going -b latex umn/source umn/build/pdf/ + bash -c "for f in umn/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true" + bash -c "for f in umn/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" make -C umn/build/pdf + mkdir -p doc/build/pdf + cp umn/build/pdf/mrs-umn.pdf doc/build/pdf/ + diff --git a/umn/source/conf.py b/umn/source/conf.py index da88c76..ff31ca7 100644 --- a/umn/source/conf.py +++ b/umn/source/conf.py @@ -78,7 +78,7 @@ html_theme = 'otcdocs' # further. For a list of options available for each theme, see the # documentation. html_theme_options = { - "disable_search": "True", + "disable_search": True, "site_name": "Internal Documentation Portal", "logo_url": "https://docs-int.otc-service.com", }