starlight_help: Move help-beta over to starlight_help.

We are starting the cutover process and starlight_help is the directory
we have agreed on to place our new help center project. We do not want
to use `starlight_help` as the URL for the project, but this commit
changes the url from `help-beta` to `starlight_help` temporarily since
we can only change URL once we get rid of the current help center
project. That will be done in a future commit.
This commit is contained in:
Shubham Padia
2025-08-06 11:05:27 +00:00
committed by Tim Abbott
parent fb49e5e420
commit 3e60b16ac1
33 changed files with 39 additions and 51 deletions

View File

@@ -276,7 +276,7 @@ export default tseslint.config(
},
},
{
files: ["help-beta/src/scripts/client/**"],
files: ["starlight_help/src/scripts/client/**"],
rules: {
"unicorn/prefer-module": "off",
},
@@ -311,9 +311,9 @@ export default tseslint.config(
...astroConfigs.recommended,
{
files: [
"help-beta/src/components/ZulipNote.astro",
"help-beta/src/components/ZulipTip.astro",
"help-beta/src/components/KeyboardTip.astro",
"starlight_help/src/components/ZulipNote.astro",
"starlight_help/src/components/ZulipTip.astro",
"starlight_help/src/components/KeyboardTip.astro",
],
rules: {
"import/unambiguous": "off",

View File

@@ -1,12 +0,0 @@
# Help center (beta) documentation
This directory is part of an ongoing migration project to convert our
help center documentation to use starlight and add search to the docs
at the same time.
The status of the project can be tracked at this umbrella issue:
https://github.com/zulip/zulip/issues/30450
If you are a developer, you can refer to `/devtools` page on your zulip
installation to know what commands to use to run the project for
development.

View File

@@ -1,4 +1,4 @@
<!-- Changes to this file should be propagated to help-beta/astro.config.mjs. -->
<!-- Changes to this file should be propagated to starlight_help/astro.config.mjs. -->
## Guides
* [Getting started with Zulip](/help/getting-started-with-zulip)

2
pnpm-lock.yaml generated
View File

@@ -519,7 +519,7 @@ importers:
specifier: ^2.0.8
version: 2.1.0(encoding@0.1.13)
help-beta:
starlight_help:
dependencies:
'@astrojs/check':
specifier: ^0.9.3

View File

@@ -1,2 +1,2 @@
packages:
- help-beta
- starlight_help

View File

@@ -18,12 +18,12 @@ def setup_node_modules(production: bool = DEFAULT_PRODUCTION) -> None:
except FileNotFoundError:
pass
# We need this check when switching between branches without `help-beta`
# package. `node_modules` will be removed when working on a non `help-beta`
# We need this check when switching between branches without `starlight_help`
# package. `node_modules` will be removed when working on a non `starlight_help`
# branch, but if `node_modules/.pnpm/lock.yaml` has not been updated by that
# branch, we will end up in a situation where we might not have `node_modules`
# even when we run the provision command.
if not os.path.exists("help-beta/node_modules"):
if not os.path.exists("starlight_help/node_modules"):
skip = False
if not skip:

View File

@@ -6,7 +6,7 @@ import Icons from "unplugin-icons/vite";
// https://astro.build/config
export default defineConfig({
base: "help-beta",
base: "starlight_help",
vite: {
plugins: [
// eslint-disable-next-line new-cap

View File

@@ -1,5 +1,5 @@
{
"name": "help-beta",
"name": "starlight_help",
"type": "module",
"version": "0.0.1",
"scripts": {

View File

@@ -3,7 +3,7 @@ import {CORPORATE_ENABLED, SUPPORT_EMAIL} from "astro:env/client";
let footer_html = `<p>Don't see an answer to your question? <a href="mailto:{{ ${SUPPORT_EMAIL} }}">Contact this Zulip server's administrators</a> for support.</p>`;
if (CORPORATE_ENABLED) {
footer_html = `<p>Your feedback helps us make Zulip better for everyone! Please <a href="/help-beta/contact-support">contact us</a> with questions, suggestions, and feature requests.</p>`;
footer_html = `<p>Your feedback helps us make Zulip better for everyone! Please <a href="/starlight_help/contact-support">contact us</a> with questions, suggestions, and feature requests.</p>`;
}
---

View File

@@ -155,20 +155,20 @@
reload below.
</li>
<li>
You can run <code>pnpm build</code> within the <code>help-beta</code> directory to run
You can run <code>pnpm build</code> within the <code>starlight_help</code> directory to run
the build step separately.
</li>
</ul>
</li>
<li>
<code>./tools/run-dev --help-center</code> will host the generated build on
<code>/help-beta</code>. Note that search will work in the beta help center docs with
<code>/starlight_help</code>. Note that search will work in the beta help center docs with
this flag. For testing changes related to the migration of the help center docs, using the tool
to build the beta help center docs and running the dev server with this flag should be fine.
</li>
<li>
<code>./tools/run-dev --help-center-dev-server</code> will run a dev server at
<code>/help-beta</code> that supports hot reload. Note that, with this flag, search will not work
<code>/starlight_help</code> that supports hot reload. Note that, with this flag, search will not work
in the beta help center docs. This mode is useful when you are editing a help center file, and
want to visualize the changes quickly in the beta help center documentation. You will need the
converted MDX files to be already generated through

View File

@@ -37,7 +37,7 @@ def run() -> None:
env["SHOW_RELATIVE_LINKS"] = str(args.show_relative_links).lower()
subprocess.check_call(
["/usr/local/bin/corepack", "pnpm", "build"],
cwd="help-beta",
cwd="starlight_help",
env=env,
)

View File

@@ -91,15 +91,15 @@ def replace_image_path(markdown_string: str, replacement_path: str) -> str:
"""
We will point to the existing image folder till
the cutover. After that, we will copy the images
to src folder for help-beta in order to take
to src folder for starlight_help in order to take
advantage of Astro's image optimization.
See https://chat.zulip.org/#narrow/stream/6-frontend/topic/Handling.20images.20in.20help.20center.20starlight.20migration.2E/near/1915130
"""
# 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/help-beta", f"({replacement_path}")
return result.replace('="/static/images/help-beta', f'="{replacement_path}')
result = markdown_string.replace("(/static/images/starlight_help", f"({replacement_path}")
return result.replace('="/static/images/starlight_help', f'="{replacement_path}')
def fix_file_imports(
@@ -138,11 +138,11 @@ def escape_curly_braces(markdown_string: str) -> str:
def fix_relative_path(markdown_string: str) -> str:
"""
Since the docs will live at the `help-beta/` url
Since the docs will live at the `starlight_help/` url
until we migrate the project completely, we will
replace `help/` with `help-beta/`
replace `help/` with `starlight_help/`
"""
return markdown_string.replace("help/", "help-beta/")
return markdown_string.replace("help/", "starlight_help/")
def insert_string_at_line(text: str, destination_str: str, n: int) -> str:
@@ -692,7 +692,7 @@ def get_include_files_info(include_input_dir: str) -> dict[str, IncludeFileInfo]
def run() -> None:
input_dir = os.path.join(BASE_DIR, "help")
output_dir = os.path.join(BASE_DIR, "help-beta/src/content/docs")
output_dir = os.path.join(BASE_DIR, "starlight_help/src/content/docs")
include_input_dir = os.path.join(input_dir, "include")
include_output_dir = os.path.join(output_dir, "include")
print("Starting the conversion from MD to MDX...")
@@ -748,7 +748,7 @@ def run() -> None:
# since the first run will always give us warnings.
subprocess.check_call(
["/usr/local/bin/corepack", "pnpm", "run", "format-silent"],
cwd="help-beta",
cwd="starlight_help",
)

View File

@@ -303,7 +303,7 @@ def run_help_center_dev_server(external_host: str) -> "subprocess.Popen[bytes]":
"--host",
f"--allowed-hosts={urlsplit(external_host).hostname}",
],
cwd="help-beta",
cwd="starlight_help",
)
@@ -311,7 +311,7 @@ def run_help_center_dev_server(external_host: str) -> "subprocess.Popen[bytes]":
async def help_center_middleware(
request: web.Request, handler: Callable[[web.Request], Awaitable[web.StreamResponse]]
) -> web.StreamResponse:
if request.path.startswith("/help-beta"):
if request.path.startswith("/starlight_help"):
try:
filename = request.match_info["filename"]
name, ext = os.path.splitext(filename)
@@ -336,19 +336,19 @@ def setup_routes(
) -> None:
if enable_help_center:
# Order of adding the rules matters. aiohttp will stop at the first
# match, and we want `/help-beta` to be matched before Django URIs.
# match, and we want `/starlight_help` to be matched before Django URIs.
try:
app.router.add_static("/help-beta", "help-beta/dist")
app.router.add_static("/starlight_help", "starlight_help/dist")
except ValueError:
print("""Please run the build step for the help center before enabling it.
The instructions for the build step can be found in the `./devtools`
page. `/help-beta` urls will give you an error until you complete the
page. `/starlight_help` urls will give you an error until you complete the
build step and rerun `run-dev`.""")
elif enable_help_center_dev_server:
app.add_routes(
[
web.route(
hdrs.METH_ANY, r"/{path:(help-beta).*}", partial(forward, help_center_port)
hdrs.METH_ANY, r"/{path:(starlight_help).*}", partial(forward, help_center_port)
),
]
)

View File

@@ -37,7 +37,7 @@
},
"exclude": [
// This is a separate package with its own TypeScript configuration.
"help-beta",
"starlight_help",
// Skip walking large generated directories.
".venv",

View File

@@ -49,4 +49,4 @@ API_FEATURE_LEVEL = 415
# historical commits sharing the same major version, in which case a
# minor version bump suffices.
PROVISION_VERSION = (339, 1) # bumped 2025-08-04 to upgrade ShellCheck
PROVISION_VERSION = (340, 1) # bumped 2025-08-04 to move help-beta to starlight_help

View File

@@ -12,7 +12,7 @@ export function phrase_match(query: string, phrase: string): boolean {
}
// Any changes to this function should be followed by a check for changes needed
// to adjust_mac_kbd_tags of help-beta/src/scripts/adjust_mac_kbd_tags.ts.
// to adjust_mac_kbd_tags of starlight_help/src/scripts/adjust_mac_kbd_tags.ts.
const keys_map = new Map([
["Backspace", "Delete"],
["Enter", "Return"],
@@ -21,7 +21,7 @@ const keys_map = new Map([
]);
// Any changes to this function should be followed by a check for changes needed
// to adjust_mac_kbd_tags of help-beta/src/scripts/adjust_mac_kbd_tags.ts.
// to adjust_mac_kbd_tags of starlight_help/src/scripts/adjust_mac_kbd_tags.ts.
export function has_mac_keyboard(): boolean {
// eslint-disable-next-line @typescript-eslint/no-deprecated
return /mac/i.test(navigator.platform);
@@ -30,7 +30,7 @@ export function has_mac_keyboard(): boolean {
// We convert the <kbd> tags used for keyboard shortcuts to mac equivalent
// key combinations, when we detect that the user is using a mac-style keyboard.
// Any changes to this function should be followed by a check for changes needed
// to adjust_mac_kbd_tags of help-beta/src/scripts/adjust_mac_kbd_tags.ts.
// to adjust_mac_kbd_tags of starlight_help/src/scripts/adjust_mac_kbd_tags.ts.
export function adjust_mac_kbd_tags(kbd_elem_class: string): void {
if (!has_mac_keyboard()) {
return;

View File

@@ -17,9 +17,9 @@ REGEXP = re.compile(r"\{settings_tab\|(?P<setting_identifier>.*?)\}")
# If any changes to this link mapping are made,
# `help-beta/src/components/NavigationSteps.astro` should be updated accordingly.
# `starlight_help/src/components/NavigationSteps.astro` should be updated accordingly.
# This manual update mechanism will cease to exist once we have switched to the
# help-beta system.
# starlight_help system.
link_mapping = {
# a mapping from the setting identifier that is the same as the final URL
# breadcrumb to that setting to the name of its setting type, the setting

View File

@@ -180,7 +180,7 @@ def generate_content_blocks(
data_tab_key=tab["tab_key"],
# This attribute is not used directly in this file here,
# we need this for the current conversion script in for
# help-beta where this function is being imported.
# starlight_help where this function is being imported.
tab_label=TAB_SECTION_LABELS[tab["tab_key"]],
# Wrapping the content in two newlines is necessary here.
# If we don't do this, the inner Markdown does not get