Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

help-beta: Run format step in the conversion tool.

Shubham Padiabaa87f3f0c1c
diff --git a/help-beta/package.json b/help-beta/package.json
index cf4ddb5807b..562a602ae75 100644
--- a/help-beta/package.json
+++ b/help-beta/package.json
@@ -8,7 +8,8 @@
"build": "astro check && astro build",
"preview": "astro preview",
"astro": "astro",
- "format": "remark --ext mdx --frail --output --quiet --use remark-mdx -- ."
+ "format": "remark --ext mdx --frail --output --quiet --use remark-mdx -- .",
+ "format-silent": "remark --ext mdx --output --silent --use remark-mdx -- ."
},
"dependencies": {
"@astrojs/check": "^0.9.3",
diff --git a/tools/convert-help-center-docs-to-mdx b/tools/convert-help-center-docs-to-mdx
index 8bda7df0538..0cafe2dadb4 100755
--- a/tools/convert-help-center-docs-to-mdx
+++ b/tools/convert-help-center-docs-to-mdx
@@ -3,6 +3,7 @@
import os
import re
import shutil
+import subprocess
import sys
from textwrap import indent
from typing import TypedDict
@@ -660,5 +661,14 @@ def run() -> None:
mdx_file.write(mdx)
print(f"Converted {converted_count} main help files. Conversion completed.")
+ # We use format-silent here, since running format on the converted
+ # files gives us tons of warnings while fixing those warnings. We
+ # also remove the frail flag when compared to the standard format
+ # since the first run will always give us warnings.
+ subprocess.check_call(
+ ["/usr/local/bin/corepack", "pnpm", "run", "format-silent"],
+ cwd="help-beta",
+ )
+
run()