File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
Sources/SwiftDocC/Model/Rendering/HTML
Tests/SwiftDocCUtilitiesTests Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,21 @@ struct HTMLRenderer {
445445 articleElement. addChild ( . element( named: " hr " ) ) // Separate the sections with a thematic break
446446 }
447447
448+ if FeatureFlags . current. isMentionedInEnabled {
449+ separateCurationIfNeeded ( )
450+
451+ let mentions = context. articleSymbolMentions. articlesMentioning ( reference)
452+ if !mentions. isEmpty {
453+ articleElement. addChild (
454+ renderer. selfReferencingSection ( named: " Mentioned In " , content: [
455+ . element( named: " ul " , children: mentions. compactMap { reference in
456+ context. documentationCache [ reference] . map { . element( named: " li " , children: [ . text( $0. name. description) ] ) }
457+ } )
458+ ] )
459+ )
460+ }
461+ }
462+
448463 // Discussion
449464 if let discussion = symbol. discussion {
450465 separateCurationIfNeeded ( )
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ final class FileWritingHTMLContentConsumerTests: XCTestCase {
2727
2828 ## Custom discussion
2929
30- It explains how a developer can perform some task using this module.
30+ It explains how a developer can perform some task using ``SomeClass`` in this module.
3131
3232 ### Details
3333
@@ -254,6 +254,12 @@ final class FileWritingHTMLContentConsumerTests: XCTestCase {
254254 <code>class SomeClass</code>
255255 </pre>
256256 </section>
257+ <section>
258+ <h2>Mentioned In</h2>
259+ <ul>
260+ <li>Some article</li>
261+ </ul>
262+ </section>
257263 <section>
258264 <h2>Topics</h2>
259265 <h3>Instance Methods</h3>
@@ -369,7 +375,10 @@ final class FileWritingHTMLContentConsumerTests: XCTestCase {
369375 </section>
370376 <section>
371377 <h2>Custom discussion</h2>
372- <p>It explains how a developer can perform some task using this module.</p>
378+ <p>It explains how a developer can perform some task using <a href= " ../SomeClass/index.html " >
379+ <code>SomeClass</code>
380+ </a>
381+ in this module.</p>
373382 <h3>Details</h3>
374383 <p>This subsection describes something more detailed.</p>
375384 </section>
You can’t perform that action at this time.
0 commit comments