help-beta: Add MDX files to git.

We have not yet removed the help files. We can use this commit as a
conversion commit since a lot more help changes will be merged before
this PR gets merged. We will need to rebase on top of main, run
conversion step in this commit, push those changes and then merge the
PR.

NOTE: This commit temporarily breaks the astro build since we have
renamed the path in the MDX files from starlight_help/ to help/ early.
That should be fine since astro build will not break any tests right
now.
We should squash this commit with the next commit removing help center
files when merging into main and remove this NOTE.
This commit is contained in:
Shubham Padia
2025-08-06 10:28:15 +00:00
committed by Tim Abbott
parent 8f16f1139e
commit 40f723c75a
418 changed files with 21904 additions and 14 deletions

View File

@@ -98,8 +98,8 @@ def replace_image_path(markdown_string: str, replacement_path: str) -> str:
# We do not replace /static/images directly since there are a few
# instances in the documentation where zulip.com links are
# referenced with that blurb as a part of the url.
result = markdown_string.replace("(/static/images/starlight_help", f"({replacement_path}")
return result.replace('="/static/images/starlight_help', f'="{replacement_path}')
result = markdown_string.replace("(/static/images/help", f"({replacement_path}")
return result.replace('="/static/images/help', f'="{replacement_path}')
def fix_file_imports(
@@ -136,15 +136,6 @@ def escape_curly_braces(markdown_string: str) -> str:
return result.replace("}", r"\}")
def fix_relative_path(markdown_string: str) -> str:
"""
Since the docs will live at the `starlight_help/` url
until we migrate the project completely, we will
replace `help/` with `starlight_help/`
"""
return markdown_string.replace("help/", "starlight_help/")
def insert_string_at_line(text: str, destination_str: str, n: int) -> str:
lines = destination_str.splitlines()
if 1 <= n <= len(lines):
@@ -587,7 +578,6 @@ def convert_help_center_file_to_mdx(
# All imports inserted during conversion should be tracked here.
import_statement_set: set[str] = set()
result = fix_relative_path(result)
# All unordered lists at the time of writing this comment are
# standalone components and we do not need to do any transformation
# for them.
@@ -633,7 +623,6 @@ def convert_include_file_to_mdx(
# All imports inserted during conversion should be tracked here.
import_statement_set: set[str] = set()
result = fix_relative_path(result)
# All unordered lists at the time of writing this comment are
# standalone components and we do not need to do any transformation
# for them.