From 4e7c453b9af61f2241c794330cd57c1a63c4992f Mon Sep 17 00:00:00 2001 From: Shaiyan Azad <57786827+RSAK56@users.noreply.github.com> Date: Mon, 27 May 2024 07:56:28 -0700 Subject: [PATCH] [Task] Update support docs with submodule mkdocs SA 5307 (#19) * Updated support docs with git submodule mkdocs * Updated vocabulary to vale instead of submodule * Removed vocabulary * Updated content path * Updated git ignore file to remove the root mkdocs yml file * Removed tracking for root mkdocs yml file as originated at run time * Fixed the indentation for pull request * Removed footer logo from override * Modified support docs override --- .github/workflows/pull_request.yaml | 8 +-- .github/workflows/push.yaml | 6 +-- .github/workflows/release.yaml | 2 +- .gitignore | 3 ++ .gitmodules | 6 +-- .vale.ini | 5 +- Dockerfile | 3 +- custom_theme/404.html | 6 --- custom_theme/main.html | 5 -- mkdocs.yml | 54 ------------------- prepare_theme.sh | 3 ++ theme_common | 1 + theme_override/mkdocs.yml | 11 ++++ .../resources}/assets/images/favicon.svg | 0 vocabulary | 1 - 15 files changed, 34 insertions(+), 80 deletions(-) delete mode 100644 custom_theme/404.html delete mode 100644 custom_theme/main.html delete mode 100644 mkdocs.yml create mode 100755 prepare_theme.sh create mode 160000 theme_common create mode 100644 theme_override/mkdocs.yml rename {custom_theme => theme_override/resources}/assets/images/favicon.svg (100%) delete mode 160000 vocabulary diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index ad92842..70b6882 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -3,21 +3,21 @@ name: Pull Request on: pull_request: branches: - - 'main' + - "main" jobs: qa: - uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.62 + uses: stakater/.github/.github/workflows/pull_request_doc_qa.yaml@v0.0.75 with: MD_CONFIG: .github/md_config.json DOC_SRC: content MD_LINT_CONFIG: .markdownlint.yaml build: - uses: stakater/.github/.github/workflows/pull_request_container_build.yaml@v0.0.62 + uses: stakater/.github/.github/workflows/pull_request_container_build.yaml@v0.0.75 with: DOCKER_FILE_PATH: Dockerfile secrets: CONTAINER_REGISTRY_URL: ghcr.io/stakater CONTAINER_REGISTRY_USERNAME: stakater-user CONTAINER_REGISTRY_PASSWORD: ${{ secrets.STAKATER_GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} + SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index 44d4680..f77b412 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -3,11 +3,11 @@ name: Push on: push: branches: - - 'main' + - "main" jobs: push: - uses: stakater/.github/.github/workflows/push_container.yaml@v0.0.62 + uses: stakater/.github/.github/workflows/push_container.yaml@v0.0.75 with: DOCKER_FILE_PATH: Dockerfile RELEASE_BRANCH: main @@ -15,5 +15,5 @@ jobs: CONTAINER_REGISTRY_URL: ghcr.io/stakater CONTAINER_REGISTRY_USERNAME: stakater-user CONTAINER_REGISTRY_PASSWORD: ${{ secrets.STAKATER_GITHUB_TOKEN }} - SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} + SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} GH_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 60fca5a..d4b798e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,6 +7,6 @@ on: jobs: release: - uses: stakater/.github/.github/workflows/release_template.yaml@v0.0.62 + uses: stakater/.github/.github/workflows/release_template.yaml@v0.0.75 secrets: SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }} diff --git a/.gitignore b/.gitignore index 8f8636f..251ce2e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,6 @@ node_modules # Build files site/ + +# yml files +mkdocs.yml \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index a47a9fc..93d493f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "vocabulary"] - path = vocabulary - url = git@github.com:stakater/vocabulary.git +[submodule "theme_common"] + path = theme_common + url = git@github.com:stakater/stakater-docs-mkdocs-theme.git diff --git a/.vale.ini b/.vale.ini index 56d1b75..d4e990d 100644 --- a/.vale.ini +++ b/.vale.ini @@ -1,7 +1,8 @@ -StylesPath = "vocabulary/styles" +StylesPath = styles MinAlertLevel = warning -Vocab = "Stakater" +Packages = https://github.com/stakater/vale-package/releases/download/v0.0.17/Stakater.zip +Vocab = Stakater # Only check MarkDown files [*.md] diff --git a/Dockerfile b/Dockerfile index 79432f2..ae4ebf7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM python:3.12 as builder -RUN pip3 install mkdocs-material mkdocs-mermaid2-plugin +RUN pip3 install mkdocs-mermaid2-plugin mkdocs-table-reader-plugin mkdocs-include-markdown-plugin # set workdir RUN mkdir -p $HOME/application @@ -10,6 +10,7 @@ WORKDIR $HOME/application COPY --chown=1001:root . . # build the docs +RUN chmod +x prepare_theme.sh && ./prepare_theme.sh RUN mkdocs build FROM nginxinc/nginx-unprivileged:1.26-alpine as deploy diff --git a/custom_theme/404.html b/custom_theme/404.html deleted file mode 100644 index bf6b1a3..0000000 --- a/custom_theme/404.html +++ /dev/null @@ -1,6 +0,0 @@ -{% extends "main.html" %} - -{% block content %} -
This page does not exist or may have been deprecated or moved. Please use the search to find anything in the documentation.
-{% endblock %} diff --git a/custom_theme/main.html b/custom_theme/main.html deleted file mode 100644 index 56b5372..0000000 --- a/custom_theme/main.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends "base.html" %} - -{% block footer %} -Copyright © 2023 Stakater AB – Change cookie settings
-{% endblock %} diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 6f4a2d1..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,54 +0,0 @@ -site_name: Stakater Support -docs_dir: content -site_url: https://support.stakater.com/ -repo_url: https://github.com/stakater/support-docs -edit_uri: blob/main/content/ -use_directory_urls: false -theme: - name: material - logo: assets/images/favicon.svg - favicon: assets/images/favicon.svg - custom_dir: custom_theme/ - palette: - primary: white - features: - - navigation.tabs - -markdown_extensions: - - admonition - - pymdownx.details - - pymdownx.superfences - - attr_list - - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg - -extra: - analytics: - provider: google - property: G-TTH1YYW5TX - consent: - title: Cookie consent - actions: - - accept - - reject - - manage - description: >- - We use cookies to recognize your repeated visits and preferences, as well - as to measure the effectiveness of our documentation and whether users - find what they're searching for. With your consent, you're helping us to - make our documentation better. - -nav: - - index.md - - Documentation: https://docs.stakater.com/ - - Stakater Home: https://www.stakater.com/ - - SAAP: https://www.stakater.com/saap-kubernetes-openshift - - Consultancy: https://www.stakater.com/kubernetes-consultancy - - Events: https://www.stakater.com/events - - Platform Assessment: https://www.stakater.com/kubernetes-platform-assessment - - Careers: https://www.stakater.com/careers - -plugins: - - search - - mermaid2 diff --git a/prepare_theme.sh b/prepare_theme.sh new file mode 100755 index 0000000..67cf92e --- /dev/null +++ b/prepare_theme.sh @@ -0,0 +1,3 @@ +pip install -r theme_common/requirements.txt +python theme_common/scripts/combine_theme_resources.py theme_common/resources theme_override/resources dist/_theme +python theme_common/scripts/combine_mkdocs_config_yaml.py theme_common/mkdocs.yml theme_override/mkdocs.yml mkdocs.yml diff --git a/theme_common b/theme_common new file mode 160000 index 0000000..e12f4cc --- /dev/null +++ b/theme_common @@ -0,0 +1 @@ +Subproject commit e12f4cc5cfe942706d92e8774ee150f54bb59a65 diff --git a/theme_override/mkdocs.yml b/theme_override/mkdocs.yml new file mode 100644 index 0000000..e24cc8f --- /dev/null +++ b/theme_override/mkdocs.yml @@ -0,0 +1,11 @@ +site_name: Stakater Support +docs_dir: content +site_url: https://support.stakater.com/ +repo_url: https://github.com/stakater/support-docs +edit_uri: blob/main/content/ +use_directory_urls: false +theme: + logo: assets/images/favicon.svg + favicon: assets/images/favicon.svg +nav: + - index.md diff --git a/custom_theme/assets/images/favicon.svg b/theme_override/resources/assets/images/favicon.svg similarity index 100% rename from custom_theme/assets/images/favicon.svg rename to theme_override/resources/assets/images/favicon.svg diff --git a/vocabulary b/vocabulary deleted file mode 160000 index c6a7b4b..0000000 --- a/vocabulary +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c6a7b4b2f49fe58e339dd7113f81d61a69d3aae8