diff --git a/.env b/.env index 5d946ab46..e2f0428fd 100644 --- a/.env +++ b/.env @@ -1,2 +1,5 @@ - MERMAID_DOMAIN="mermaid.live" - MERMAID_ANALYTICS_URL="https://p.mermaid.live" + MERMAID_DOMAIN='' + MERMAID_ANALYTICS_URL='' + MERMAID_RENDERER_URL='https://mermaid.ink' + MERMAID_KROKI_RENDERER='https://kroki.io' + MERMAID_IS_ENABLED_MERMAID_CHART_LINKS='' diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 87b64abc6..45847c445 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -23,6 +23,9 @@ jobs: env: MERMAID_DOMAIN: 'mermaid.live' MERMAID_ANALYTICS_URL: 'https://p.mermaid.live' + MERMAID_RENDERER_URL: 'https://mermaid.ink' + MERMAID_KROKI_RENDERER_URL: 'https://kroki.io' + MERMAID_IS_ENABLED_MERMAID_CHART_LINKS: 'true' run: | export DEPLOY=true [ "$GITHUB_EVENT_NAME" != "pull_request" ] && rm -rf docs/_app/ diff --git a/.gitignore b/.gitignore index 381928d77..28575d857 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ yarn-error.log /snapshots.js /cypress/downloads /cypress/videos -/cypress/screenshots +/cypress/screenshots \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b400b6a70..8335f14e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,7 @@ ARG MERMAID_RENDERER_URL ARG MERMAID_KROKI_RENDERER_URL ARG MERMAID_ANALYTICS_URL ARG MERMAID_DOMAIN +ARG MERMAID_IS_ENABLED_MERMAID_CHART_LINKS COPY . ./ diff --git a/README.md b/README.md index 746855583..02a0c7b59 100644 --- a/README.md +++ b/README.md @@ -29,13 +29,18 @@ docker run --platform linux/amd64 --publish 8000:8080 ghcr.io/mermaid-js/mermaid ### To configure renderer URL -When building set the MERMAID_RENDERER_URL build argument to the rendering service. -Default is `https://mermaid.ink` +When building set the MERMAID_RENDERER_URL build argument to the rendering +service. +Example: +Default is`https://mermaid.ink`. +Set to empty string to disable PNG and SVG links under Actions ### To configure Kroki Instance URL -When building set the MERMAID_KROKI_RENDERER_URL build argument to your Kroki instance. +When building set the MERMAID_KROKI_RENDERER_URL build argument to your Kroki +instance. Default is `https://kroki.io` +Set to empty string to disable Kroki link under Actions ### To configure Analytics @@ -43,6 +48,18 @@ When building set the MERMAID_ANALYTICS_URL build argument to your plausible ins Default is empty, disabling analytics. +### To enable Mermaid Chart links and promotion + +When building set the MERMAID_IS_ENABLED_MERMAID_CHART_LINKS build argument to `true` + +Default is empty, disabling button to save to Mermaid Chart and promotional banner. + +### To update the Security modal + +The modal shown on clicking the security link assumes analytics, renderer, Kroki +and Mermaid chart are enabled. You can update it by modifying `Privacy.svelte` +if you wish. + ### Development ```bash diff --git a/netlify.toml b/netlify.toml index 4b646fa7f..de5a33967 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,6 @@ [build.environment] MERMAID_ANALYTICS_URL = 'https://p.mermaid.live' MERMAID_DOMAIN = 'mermaid.live' + MERMAID_RENDERER_URL = 'https://mermaid.ink' + MERMAID_KROKI_RENDERER_URL = 'https://kroki.io' + MERMAID_IS_ENABLED_MERMAID_CHART_LINKS ='true' \ No newline at end of file diff --git a/src/env.d.ts b/src/env.d.ts index ec4a2ff4b..d02631111 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -5,6 +5,7 @@ interface ImportMetaEnv { readonly MERMAID_KROKI_RENDERER_URL?: string; readonly MERMAID_ANALYTICS_URL?: string; readonly MERMAID_DOMAIN?: string; + readonly MERMAID_IS_ENABLED_MERMAID_CHART_LINKS?: string; // more env variables... } diff --git a/src/lib/components/Actions.svelte b/src/lib/components/Actions.svelte index 9c0bd1c4c..a222e57af 100644 --- a/src/lib/components/Actions.svelte +++ b/src/lib/components/Actions.svelte @@ -197,21 +197,25 @@ ${svgString}`); - - - - - - - - - + {#if rendererUrl} + + + + + + + {/if} + {#if krokiRendererUrl} + + + + {/if}