mirror of
https://github.com/zulip/zulip.git
synced 2025-10-22 20:42:14 +00:00
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:
committed by
Tim Abbott
parent
8f16f1139e
commit
40f723c75a
@@ -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.
|
||||
|
Reference in New Issue
Block a user