Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
help-beta: Add support for converting `{{ support_email }}` variable.
Shubham Padia8d0f67c3d530
diff --git a/tools/convert-help-center-docs-to-mdx b/tools/convert-help-center-docs-to-mdxindex 2c41cf12ae0..84411a18d7b 100755--- a/tools/convert-help-center-docs-to-mdx+++ b/tools/convert-help-center-docs-to-mdx@@ -472,6 +472,18 @@ def convert_admonitions_to_asides(return replace_with_mdx_syntax(markdown_string)+def convert_env_variables(markdown_string: str, import_statement_set: set[str]) -> str:+ # We run this step after we've escaped braces.+ if r"\{\{ support_email \}\}" in markdown_string:+ # This variable has already been declared in astro.config.mjs.+ import_statement_set.add('import {SUPPORT_EMAIL} from "astro:env/client";')+ markdown_string = markdown_string.replace(+ r"\{\{ support_email \}\}", "<>{SUPPORT_EMAIL}</>"+ )++ return markdown_string++def insert_imports(markdown_string: str, import_statement_set: set[str], line_number: int) -> str:if len(import_statement_set) == 0:return markdown_string@@ -548,6 +560,7 @@ def convert_help_center_file_to_mdx(result = replace_image_path(result, "../../../../static/images/help")result = replace_icons(result, import_statement_set)result = convert_comments(result)+ result = convert_env_variables(result, import_statement_set)result = insert_imports(result, import_statement_set, 2)result = insert_frontmatter(result)return result@@ -594,6 +607,7 @@ def convert_include_file_to_mdx(result = replace_image_path(result, "../../../../../static/images/help")result = replace_icons(result, import_statement_set)result = convert_comments(result)+ result = convert_env_variables(result, import_statement_set)result = insert_imports(result, import_statement_set, 1)return result