Skip to content

[PrintAsObjC] Inline code segments in documentation should remain inline. #6625

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

Conversation

ChristopherRogers
Copy link
Contributor

@ChristopherRogers ChristopherRogers commented Jan 6, 2017

TL;DR: This just fixes the issue with backticks abruptly breaking sentences midway in generated Objective-C documentation; Xcode does not render the text as monospace.

I chose to use <code> instead of <tt> as suggested in the JIRA issue/Doxygen documentation as it's also supported by Doxygen and is the HTML5 replacement for <tt> and a handful of other tags.

While <code> is supported by Doxygen, Xcode does not render text enclosed in <code> tags in a monospace font. (The tags are recognized (and subsequently ignored) by Xcode, however.) In fact, I couldn't find a way to get Xcode to render a span of text in monospace without resorting to inserting the \c command before each word. I considered using backticks instead, as I think backticks are more readable as-is than <code> tags (and the backticks are rendered as-in in Xcode). However, with bold being translated using <em> tags and with that not being correctly rendered in Xcode either, I opted to keep everything uniform and chose the <code> tag.

(I also noticed there should probably be some sort of character escaping for Doxygen. For example, "This method parses <code> tags." would be translated as "This method parses <code><code></code> tags." in Doxygen.)

Resolves SR-3163.

(This is my first PR so let me know if I'm forgetting something. I believe CI has to be triggered by someone with commit access.)

@ChristopherRogers ChristopherRogers force-pushed the SR-3163-PrintAsObjC-comments-with-inline-code branch from d2e080d to d261bd2 Compare January 6, 2017 23:59
@ChristopherRogers ChristopherRogers force-pushed the SR-3163-PrintAsObjC-comments-with-inline-code branch from d261bd2 to 85e9075 Compare January 7, 2017 00:40
@jrose-apple
Copy link
Contributor

Seems reasonable to me, even with the Xcode limitations. @bitjammer, what do you think?

@swift-ci Please smoke test

@bitjammer
Copy link
Contributor

LGTM. We can update Xcode's QuickHelp if need be. If you have the time, let me know if you file a radar re: dropping the <code> tags.

@jrose-apple
Copy link
Contributor

Tests pass, let's take it. Thanks, Christopher!

@jrose-apple jrose-apple merged commit a33aed0 into swiftlang:master Jan 7, 2017
@ChristopherRogers
Copy link
Contributor Author

@bitjammer I wasn't sure if you were talking to me but I filed a radar. rdar://29912323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants