diff --git a/.gitignore b/.gitignore index 76141c2..c19e2b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,26 @@ -doc/build/** +_build/ +/AUTHORS +/ChangeLog +/dist/ +/otcdocstheme.egg-info/ +.DS_Store +*.pyc +doc/build +doc/source/BBresult +api-ref/build +.tox +/.venv +*.swp +*.log +*.egg* + +# Editors +*~ + +# Files created by releasenotes build +releasenotes/build + +# Files created by the LaTeX/PDF build +/.aux +/.fdb_latexmk +/texput.fls diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..1a96af9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,32 @@ +default_language_version: + python: python3 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: 9136088a246768144165fcc3ecc3d31bb686920a # v3.3.0 + hooks: + - id: trailing-whitespace + # Replaces or checks mixed line ending + - id: mixed-line-ending + args: ['--fix', 'lf'] + exclude: '.*\.(svg)$' + # Forbid files which have a UTF-8 byte-order marker + - id: check-byte-order-marker + # Checks that non-binary executables have a proper shebang + - id: check-executables-have-shebangs + # Check for files that contain merge conflict strings. + - id: check-merge-conflict + # Check for debugger imports and py37+ breakpoint() + # calls in python source + - id: debug-statements + - id: check-yaml + files: .*\.(yaml|yml)$ + - repo: local + hooks: + - id: flake8 + name: flake8 + additional_dependencies: + - hacking>=3.0.1,<3.1.0 + language: python + entry: flake8 + files: '^.*\.py$' + exclude: '^(doc|releasenotes|tools)/.*$' diff --git a/doc/requirements.txt b/doc/requirements.txt index 0528130..5eaa903 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -7,6 +7,6 @@ # Put them in here will make it clear that those are only needed for # docs. -sphinx==4.0.0 +sphinx>=4.0.0 otcdocstheme reno>=3.1.0 # Apache-2.0 diff --git a/doc/source/_ext/__pycache__/cont.cpython-38.pyc b/doc/source/_ext/__pycache__/cont.cpython-38.pyc index 5d5934f..61fba86 100644 Binary files a/doc/source/_ext/__pycache__/cont.cpython-38.pyc and b/doc/source/_ext/__pycache__/cont.cpython-38.pyc differ diff --git a/doc/source/_ext/cont.py b/doc/source/_ext/cont.py index 215bb45..f503780 100644 --- a/doc/source/_ext/cont.py +++ b/doc/source/_ext/cont.py @@ -124,7 +124,8 @@ class Navigator(Directive): class ContainerItem(Directive): node_class = container_item option_spec = { - 'title': directives.unchanged + 'title': directives.unchanged, + 'image': directives.unchanged, } has_content = True @@ -132,18 +133,16 @@ class ContainerItem(Directive): def run(self): doctree_node = container_item() doctree_node['title'] = self.options['title'] + if 'image' in self.options: + doctree_node['image'] = self.options['image'] services = [] for ent in self.content: _srv = ent.strip('- ') - # Split on first ":" - srv_parts = _srv.split(':', 1) - key = srv_parts[0] - data_parts = srv_parts[1].split("|") + data_parts = _srv.split("|") title = data_parts[0] - href = data_parts[1] if len(data_parts) > 1 else key + href = data_parts[1] if len(data_parts) > 1 else '#' services.append( dict( - key=key, title=title, href=href ) @@ -153,50 +152,64 @@ class ContainerItem(Directive): def container_item_html(self, node): - tmpl = """ -
' + self.body.append(data) raise nodes.SkipNode diff --git a/doc/source/_static/css/default.css b/doc/source/_static/css/default.css index 996f766..9bdd539 100644 --- a/doc/source/_static/css/default.css +++ b/doc/source/_static/css/default.css @@ -1,107 +1,49 @@ -.docs-book-wrapper { - margin-top: 0 !important; +/* Limit image in the card title*/ +.card-img-top { + max-width: 4rem; + height: 4rem; + padding-top: 5px; } -scale-app-shell div.container { - margin-left: unset; - margin-right: unset; +/* decorate links in card */ +.card a { + text-decoration: none; +} +.card li:hover { + background: lightgray; +} +.card-title { + font-weight: unset; } -@media (min-width: 1600px) { - .container { - width: 100% !important; - padding-left: 0 !important; +/* Special boxes for cards */ +.card { + box-shadow: 0px 2px 10px 1px rgba(0,0,0,0.2); + transition: transform .2s; +} + +.card:hover { + box-shadow: 0px 2px 15px 1px rgba(0,0,0,0.3); +} + +/* on large screen we want card to be approx of the same size */ +@media (min-width:768px) { + .navigator-container .card { + min-height: 300px; } + /* disable push to bottom on the card */ + .navigator-container .card .card-body { + flex: unset; + } + } -.service-box { - border: 1px solid #E8E8E8; - padding: 30px 20px; - border-radius: 4px; - min-height: 200px; - max-width: 300px; - margin-right: 20px !important; - margin-bottom: 20px; - display: flex; - justify-content: center; -} - -.service-box:hover { - box-shadow: 0 0 6px rgba(35, 173, 278, 1); -} - -.service-box ul { - list-style-type: none; -} - -.navigator-container { - display: flex; - flex-wrap: wrap; - flex-direction: row; - justify-content: flex-start; - padding: 0; - margin: 0; - list-style: none; - } - -.navigator-item { - padding: 10px; - margin: 10px; - background: white; - width: 300px; - min-height: 200px; - color: #191919; - text-align: left; - box-shadow: 0px 2px 10px 1px rgba(0,0,0,0.2); - transition: transform .2s; -} - -.navigator-item > p { - text-align: justify; -} - -.navigator-item > h3 { - margin-top: 10px; - text-align: right; -} - -.navigator-item > img { - height: 4em; -} - -.navigator-item > ul { - list-style-type: none; - padding-left: 10px; -} - -//.navigator-item > ul > li { -// margin-bottom: 10px; -// padding: 5px; -//} -.navigator-item > ul > li:hover { - background: lightgray; -} - -.navigator-item:hover { - // transform: scale(1.05); - box-shadow: 0px 2px 15px 1px rgba(0,0,0,0.3); -} - -.navigator-item > ul > li > a > div > div > img { +/* limit icon size in the card li */ +.navigator-container .card > ul > li > a > div > div > img { max-height: 20px; max-width: 20px; } -.navigator-container a { - color: #191919 !important; -} - -.navigator-container a:hover { - text-decoration: none; - background: gray; -} - -.service-group img { - max-width: 48px; - max-height: 48px; +.navigator-container .card li { + padding: 0.2rem 1rem; } diff --git a/doc/source/_static/images/dt-magenta.svg b/doc/source/_static/images/dt-magenta.svg new file mode 100755 index 0000000..7fb183d --- /dev/null +++ b/doc/source/_static/images/dt-magenta.svg @@ -0,0 +1,10 @@ + diff --git a/doc/source/_static/images/services/sfs.svn b/doc/source/_static/images/services/sfs.svg similarity index 100% rename from doc/source/_static/images/services/sfs.svn rename to doc/source/_static/images/services/sfs.svg diff --git a/doc/source/api.rst b/doc/source/api.rst index 3997632..8aa42d7 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -1,5 +1,5 @@ -API -=== +REST API +======== .. navigator:: :class: navigator-container diff --git a/doc/source/app.rst b/doc/source/app.rst new file mode 100644 index 0000000..7b72436 --- /dev/null +++ b/doc/source/app.rst @@ -0,0 +1,7 @@ +Application +=========== + +.. service_group:: + :class: service-group + :data: services.yaml + :category: application_services diff --git a/doc/source/compute.rst b/doc/source/compute.rst index 0957a34..10751d5 100644 --- a/doc/source/compute.rst +++ b/doc/source/compute.rst @@ -1,5 +1,5 @@ -Compute Services -================ +Compute +======= .. service_group:: :class: service-group diff --git a/doc/source/conf.py b/doc/source/conf.py index fbdb637..2fb3c0c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -20,6 +20,7 @@ extensions = [ # openstackdocstheme options otcdocs_repo_name = 'docs/docsportal' +site_name = "Internal HelpCenter" # The suffix of source filenames. source_suffix = '.rst' @@ -58,6 +59,7 @@ html_favicon = '_static/favicon.ico' html_theme_options = { 'show_other_versions': False, 'sidebar_mode': 'toctree', + 'site_name': 'Internal HelpCenter', } # Add any paths that contain custom static files (such as style sheets) here, @@ -86,5 +88,5 @@ latex_documents = [ # -- Intersphinx intersphinx_mapping = { -# 'otce': ('https://docs.otc-service.com/python-otcextensions', None) + 'security': ('https://docs-beta.otc.t-systems.com/security', None) } diff --git a/doc/source/data_analysis.rst b/doc/source/data_analysis.rst new file mode 100644 index 0000000..9b3ca5d --- /dev/null +++ b/doc/source/data_analysis.rst @@ -0,0 +1,7 @@ +Data Analysis +============= + +.. service_group:: + :class: service-group + :data: services.yaml + :category: data_analysis diff --git a/doc/source/database.rst b/doc/source/database.rst new file mode 100644 index 0000000..3cc96d9 --- /dev/null +++ b/doc/source/database.rst @@ -0,0 +1,7 @@ +Database +======== + +.. service_group:: + :class: service-group + :data: services.yaml + :category: database diff --git a/doc/source/developer.rst b/doc/source/developer.rst index fc51f4f..491f25b 100644 --- a/doc/source/developer.rst +++ b/doc/source/developer.rst @@ -9,3 +9,4 @@ Developer sdk iac drivers + Blueprints