phanikumv commented on code in PR #70812:
URL: https://github.com/apache/airflow/pull/70812#discussion_r3690432048


##########
ts-sdk/docs/sphinxJsConfig.mjs:
##########
@@ -0,0 +1,68 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// sphinx-js extension config (loaded via the ``ts_sphinx_js_config`` Sphinx 
setting).
+//
+// The ts-sdk sources use TSDoc inline tags such as ``{@link 
TaskClient.getVariable}``.
+// TypeDoc represents these as ``inline-tag`` comment parts, but sphinx-js's 
comment
+// renderer only understands ``text`` and ``code`` parts and throws "Not 
implemented"
+// on anything else. We register a TypeDoc resolve-end listener that flattens 
every
+// unsupported comment part (``inline-tag``, ``relative-link``) into plain 
``text`` using
+// the tag's own display text, so the reference reads naturally without 
crashing the build.
+
+import { Converter } from "typedoc";
+
+/** Rewrite a single list of CommentDisplayParts in place. */
+function flattenParts(parts) {
+  if (!parts) {
+    return;
+  }
+  for (let i = 0; i < parts.length; i++) {
+    const part = parts[i];
+    if (part.kind !== "text" && part.kind !== "code") {
+      parts[i] = { kind: "text", text: part.text ?? "" };

Review Comment:
   Lets emit a markdown-style code part instead, so identifiers render as 
literals, skip the spellchecker, and cover it  without wordlist churn
   
   The spellcheck failure on `getVariableOrThrow` comes from this flatten 
turning `{@link getVariableOrThrow}` tags into plain text that 
`sphinxcontrib-spelling reads as prose...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to