-
Notifications
You must be signed in to change notification settings - Fork 59
Symbol links with custom authored titles are rendered in code voice #632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
CC: @Kyle-Ye maybe you're interested in taking a look at this? It looks related to the work for swiftlang/swift-docc#271. |
rdar://108515663 |
Sorry @ethan-kusters, I'm not sure what the specific question you raised is. Does it mean that we need to respect the format in the original title, but it is not? Could you give me an expected behavior and actual behavior (Adding some code snippet or screenshot would be appreciated.) |
Looking at the screenshot of swiftlang/swift-docc#376, I can't see what the problem is for
|
That screenshot demonstrates the issue I believe: The "Hi" link text in "Check out Hi" is rendered with the default font while the "this great function" link text is rendered in monospace. Monospace should only be used if the user actually specifies it, for example: Check out [`this great function`](doc:Sloth/eat(_:quantity:)). So expected behavior for: Check out [this great function](doc:Sloth/eat(_:quantity:)). would be seeing that "this great function" rendered with the default styling. Instead, I'm seeing it rendered in monospace code font. |
Got it. I'll check and try to fix it this weekend. |
The generated But the corresponding reference So currently swift-docc-render will add "CodeVoice" style to it. "CodeVoice" will use "code" tag defined in "src/styles/base/_typography.scss" which set font-family to mono family. The same is true before swiftlang/swift-docc#376.
So what would be your expected behaviour? Should 4 and 5 both show non-code style text? 4 [doc:Sloth/eat(_:quantity:)](doc:Sloth/eat(_:quantity:))
5 [this great function](doc:Sloth/eat(_:quantity:)) |
TL,DR: But if it was internal symbol, swif-docc-render will add custom css effect to it. Maybe this should fall into a swift-docc-render issue. 🤔️ |
I think you're right – DocC-Render should be respecting the formatting provided in the |
Sounds reasonable, although I worry a bit about there being an expectation that a link to a symbol would be in code voice by default. I think this is probably the right way to go though since it allows for that flexibility. I didn't even realize you could provide a custom title for a DocC symbol link now 😮 |
This feature is tracked as a bug via swiftlang/swift-docc#271 and implemented by swiftlang/swift-docc#376 @mportiz08 |
Hey @ethan-kusters @Kyle-Ye @mportiz08 I opened a PR for this issue: #645 Is this how it should be? |
**Example:** ```markdown /// Default, should use code voice: ``StringBuilder`` /// /// Custom title, should use code voice: [`custom text`](doc:StringBuilder) /// /// Custom title, should not use code voice: [custom text](doc:StringBuilder) /// /// Custom title, should use italics and bold: [_**custom text**_](doc:StringBuilder) ``` Resolves: #632 Resolves: rdar://108515663
…#647) **Example:** ```markdown /// Default, should use code voice: ``StringBuilder`` /// /// Custom title, should use code voice: [`custom text`](doc:StringBuilder) /// /// Custom title, should not use code voice: [custom text](doc:StringBuilder) /// /// Custom title, should use italics and bold: [_**custom text**_](doc:StringBuilder) ``` Resolves: swiftlang#632 Resolves: rdar://108515663
**Example:** ```markdown /// Default, should use code voice: ``StringBuilder`` /// /// Custom title, should use code voice: [`custom text`](doc:StringBuilder) /// /// Custom title, should not use code voice: [custom text](doc:StringBuilder) /// /// Custom title, should use italics and bold: [_**custom text**_](doc:StringBuilder) ``` Resolves: #632 Resolves: rdar://108515663
Uh oh!
There was an error while loading. Please reload this page.
Description
Symbol links with custom authored titles are rendered in code voice
If I write a doc link with a title like
the rendered output is
With
this great function
in code voice. The custom title should respect the formatting that was provided in the link title.Checklist
main
branch of this package.Swift-DocC Version Information
88d0fd6676f2a2ee2d169d813420645cf6bfd52d
The text was updated successfully, but these errors were encountered: