Skip to content

Conversation

@d-ronnqvist
Copy link
Contributor

Bug/issue #, if applicable: rdar://163326857

Summary

This is another slice of #1366

It adds a helper function to the DocCHTML/MarkdownRenderer to render a symbol's declaration as HTML.

Dependencies

None.

Testing

Nothing in particular for this PR. It only adds an internal helper function. See #1366 for how it eventually does get used.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@patshaughnessy patshaughnessy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👍 Thanks for breaking these up into separate PRs...

let fragmentsByLanguage = RenderHelpers.sortedLanguageSpecificValues(fragmentsByLanguage)

guard goal == .richness else {
// If the goal is conciseness, display only the primary language's plain text declaration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment in #1382 - can you explain why the concise version only displays info about the primary language? Maybe paste 2 examples for richness and conciseness above in the doc comments and then a quick sentence about why the concise version is sooo concise :)

return .element(named: "pre", children: plainTextDeclaration)
}

let declarations: [XMLElement] = if fragmentsByLanguage.count == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this pattern in three or four functions now makes me wonder if you could extract the general behavior into a single place, and use a protocol, closure or some other means of calling the individual functions like _declarationTokens or _singleTaskGroupElements but maybe that would be difficult and not worth the effort?

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