Repository navigation
Render cross-references as DocC symbol links - #4025
Conversation
Reported against setRemoteVideoStream(_:type:): the streamType parameter
names AgoraVideoStreamType but does not link to it, where the Android page
links the equivalent type.
It is not one page. The iOS template contains zero DocC symbol links -- no
API in the Apple references links to any other. xml2json resolves an <xref>
to its display text and discards the link:
xref.text = href_text
Nothing downstream can recover it: iris_doc's fmt_oc.yaml declares
link1/link2 as "``", but those fields are never read in its production code.
The Oxygen-built platforms are unaffected because they render <xref> as an
<a href> directly from the DITA.
Wrap resolved targets in DocC symbol-link syntax on the Markdown platforms.
Because the substitution happens on the element tree before extraction, this
reaches parameters, discussions and return values alike without changing any
of those code paths.
A target containing a space is not a symbol name ("technical support"), so it
stays plain rather than becoming a meaningless code span.
Scope, measured against the 3,860 Swift and Objective-C names in the shipped
iOS archive:
cross-references reaching the iOS docs 3,511
target exists in the iOS SDK 3,009 (86%)
not a symbol, left plain 230
keyref has no keydef (pre-existing) 272
Regenerating produces 2,009 symbol links where there were none, and unity,
flutter, rn and electron come out byte-identical to master.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Foesa-yyx
left a comment
There was a problem hiding this comment.
Thanks for addressing the missing DocC link. One gap remains: the new symbol_link helper is only used in the keyref and href-with-fragment branches (xml2json/xml2json.py:751 and :783). The no-fragment branch still assigns xref.text = title_text.strip() at line 810, so a reference such as <xref href="class_livetranscoding.dita" /> continues to generate plain See AgoraLiveTranscoding. on iOS/macOS. Please pass this value through symbol_link(title_text.strip(), platform_tag) and add a regression case for file-level hrefs. The reported AgoraVideoStreamType keyref case is fixed.
Review of #4025 found a third place an <xref> is resolved that the first commit missed. An <xref> becomes display text in three branches -- by keyref, by href with a fragment, and by href naming a file -- and only the first two went through symbol_link. So a reference such as <xref href="class_livetranscoding.dita"/> still produced plain "See AgoraLiveTranscoding." on iOS and macOS. Route that branch through symbol_link too. Three file-level references reach the iOS docs; one more link is emitted (2,009 -> 2,010), including the reported AgoraLiveTranscoding case on updateRtmpTranscodingEx. Add xml2json/test_xml2json.py, the first tests in this directory: SymbolLinkTest symbol_link behaviour -- Markdown platforms, the other platforms, the space guard for prose targets such as "technical support", empty targets, and Objective-C selectors. XrefResolutionTest asserts every branch assigning xref.text routes through symbol_link, and that the file-level branch specifically does. This is what was missed, so it is what the test watches; a fourth branch added without the helper now fails. The http branch is exempt -- it appends a URL rather than naming a symbol. Confirmed the regression test fails (2 failures) with the fix reverted and passes with it in place. unity and flutter remain byte-identical to master. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Good catch — confirmed and fixed in You're right that there are three branches resolving an xref.text = symbol_link(title_text.strip(), platform_tag)Impact: three file-level references reach the iOS docs; one more link is emitted (2,009 → 2,010), including your Regression caseAdded
I pointed the structural test at the failure mode you found rather than just the one line, so a fourth branch added without the helper fails too. The Verified the test actually catches it: 2 failures with the fix reverted, clean with it in place. One thing worth flagging separately, found while scoping this: 272 keyrefs in the iOS maps have no keydef, so they resolve to empty string today. That's why 🤖 Generated with Claude Code |
|
@saudsami I’ve merged the PR. Thanks for the fix and for addressing the review feedback! |
Reported against
setRemoteVideoStream(_:type:): thestreamTypeparameter namesAgoraVideoStreamTypebut doesn't link to it, where the Android page links the equivalent type.It isn't one page
The iOS template contains zero DocC symbol links. No API in the Apple references links to any other.
xml2json.pyresolves an<xref>to its display text and discards the link:Nothing downstream recovers it:
iris_doc'sfmt_oc.yamldeclareslink1: ""/link2: "", but those fields are never read in its production code — they appear only in test fixtures. The Oxygen-built platforms are unaffected because they render<xref>as an<a href>straight from the DITA, which is why Android looks right.The change
Wrap resolved targets in DocC symbol-link syntax on the Markdown platforms. Because the substitution happens on the element tree before extraction, this reaches parameters, discussions and return values without touching any of those code paths.
A target containing a space isn't a symbol name (
technical support), so it stays plain rather than rendering as a meaningless code span.Scope
Measured against the 3,860 Swift and Objective-C names in the shipped iOS archive:
keyrefhas no keydef (pre-existing source gap)Verification
The reported case:
Known limitation
A
`` wrapper around a symbol DocC can't resolve renders as a code span, not a link. With 86% resolvable, expect a few hundred of those — an improvement on plain prose, but not a link. The 272 keyrefs with no keydef remain broken at source and produce empty text today; worth a separate look.Worth confirming with a real build before this ships, as the template alone can't show whether DocC resolves each target.
🤖 Generated with Claude Code