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


##########
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:
   Applied — the flatten now emits a `code` part wrapping the identifier in 
backticks instead of a bare `text` part. The referenced name renders as an 
inline literal, sphinxcontrib-spelling skips it, and there's no wordlist churn 
(the `TypeDoc`/`TypeScript` entries are genuine prose words in the docs, not 
flattened identifiers). Updated the explanatory comment to match.
   
   ---
   Drafted-by: Claude Code (Opus 4.8) (no human review before posting)



-- 
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