From 2251c28a6966891d7c31bc58cce02fb4a6a1755a Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Mon, 6 Jan 2025 15:49:57 -0600 Subject: [PATCH 1/2] docs: add mkdocs-macros-plugin Added necessary {% raw %} to avoid processing {{ in the file. Added it to the workflow generator as well. --- docs/deploy-guide/add-remove-app.md | 4 ++++ docs/user-guide/postgres-operator-cheat-sheet.md | 8 ++++++++ mkdocs.yml | 1 + requirements-docs.txt | 1 + scripts/argo-workflows-to-mkdocs.py | 2 ++ 5 files changed, 16 insertions(+) diff --git a/docs/deploy-guide/add-remove-app.md b/docs/deploy-guide/add-remove-app.md index bfb9a4ee1..abef8c367 100644 --- a/docs/deploy-guide/add-remove-app.md +++ b/docs/deploy-guide/add-remove-app.md @@ -40,6 +40,8 @@ Adding an application to be part of UnderStack involves modifying the The general form should be: +{% raw %} + ```yaml # list item per ArgoCD Application # the component value will appear as the ArgoCD Application name @@ -78,6 +80,8 @@ The general form should be: path: '{{.name}}/manifests/dex' ``` +{% endraw %} + ## Removing an application from UnderStack [argocd]: diff --git a/docs/user-guide/postgres-operator-cheat-sheet.md b/docs/user-guide/postgres-operator-cheat-sheet.md index 63c8f9655..1354f7117 100644 --- a/docs/user-guide/postgres-operator-cheat-sheet.md +++ b/docs/user-guide/postgres-operator-cheat-sheet.md @@ -30,6 +30,8 @@ kubectl -n nautobot describe cluster nautobot-cluster ## Connect to the Nautobot database with psql command line +{% raw %} + ```bash # This is the name of the secret with the nautobot postgres credentials PG_CLUSTER_SECRET=nautobot-cluster-app @@ -38,6 +40,8 @@ PG_CLUSTER_SECRET=nautobot-cluster-app PGPASSWORD=$(kubectl get secret -n nautobot "${PG_CLUSTER_SECRET}" -o go-template='{{.data.password | base64decode}}') PGUSER=$(kubectl get secret -n nautobot "${PG_CLUSTER_SECRET}" -o go-template='{{.data.user | base64decode}}') PGDATABASE=$(kubectl get secret -n nautobot "${PG_CLUSTER_SECRET}" -o go-template='{{.data.dbname | base64decode}}') psql -h localhost ``` +{% endraw %} + ## Create a local pg_dump backup of the Nautobot database First we need to create a kubernetes port forward for our local machine @@ -53,7 +57,11 @@ kubectl -n nautobot port-forward "${PG_CLUSTER_PRIMARY_POD}" 5432:5432 Once the port forward has been created, we can perform a `pg_dump` of the postgres database: +{% raw %} + ```bash PG_CLUSTER_SECRET=nautobot-cluster-app PGPASSWORD=$(kubectl get secret -n nautobot "${PG_CLUSTER_SECRET}" -o go-template='{{.data.password | base64decode}}') PGUSER=$(kubectl get secret -n nautobot "${PG_CLUSTER_SECRET}" -o go-template='{{.data.user | base64decode}}') PGDATABASE=$(kubectl get secret -n nautobot "${PG_CLUSTER_SECRET}" -o go-template='{{.data.dbname | base64decode}}') pg_dump -h localhost -f nautobot.postgres.sql ``` + +{% endraw %} diff --git a/mkdocs.yml b/mkdocs.yml index 713c754dc..1caa60dd4 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -89,6 +89,7 @@ plugins: - include_dir_to_nav: sort_file: true sort_directory: true + - macros validation: omitted_files: warn diff --git a/requirements-docs.txt b/requirements-docs.txt index 3a78d0664..999dc1b96 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,5 +3,6 @@ mkdocs-material mkdocs-swagger-ui-tag mkdocs-glightbox markdown-exec +mkdocs-macros-plugin mkdocs-multirepo-plugin>=0.8.3 mkdocs-include-dir-to-nav diff --git a/scripts/argo-workflows-to-mkdocs.py b/scripts/argo-workflows-to-mkdocs.py index 22d6eca2d..311883f3c 100644 --- a/scripts/argo-workflows-to-mkdocs.py +++ b/scripts/argo-workflows-to-mkdocs.py @@ -645,10 +645,12 @@ def generate_mermaid(workflows, nodes, output_name, output_file, workflow_readme f.write("\n") f.write("## Workflow Diagram\n") f.write("\n") + f.write("{% raw %}\n\n") f.write("```mermaid\n") f.write(mermaid_output) f.write("\n") f.write("```\n") + f.write("\n{% endraw %}\n") f.write("\n") From 7caae4c0f9aead16994eeabafea724083400c179 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Mon, 6 Jan 2025 15:55:39 -0600 Subject: [PATCH 2/2] docs: variabilize the auth_url for keystone Make it possible for different build of the docs to use different URLs. --- docs/user-guide/openstack-cli.md | 2 +- mkdocs.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/user-guide/openstack-cli.md b/docs/user-guide/openstack-cli.md index cc32a80e9..b0257a0a9 100644 --- a/docs/user-guide/openstack-cli.md +++ b/docs/user-guide/openstack-cli.md @@ -59,7 +59,7 @@ clouds: identity_provider: sso protocol: openid auth: - auth_url: https://your.endpoint.url/v3 + auth_url: {{ config.extra.auth_url }} project_domain_name: Default project_name: myproject ``` diff --git a/mkdocs.yml b/mkdocs.yml index 1caa60dd4..c9ebb7cd8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -97,6 +97,9 @@ validation: unrecognized_links: warn anchors: warn +extra: + auth_url: !ENV [OS_AUTH_URL, "https://your.endpoint.url/v3"] + nav: - Home: index.md - Overview: