Skip to content
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

Add markup delimiters supported by Xcode #654

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

eneko
Copy link
Collaborator

@eneko eneko commented May 30, 2020

Summary

This PR adds support for documentation markup delimiters supported by Xcode (see full list of markup delimiters).

Code changes

  • Update parseFullXMLDocs method in File.swift to extract Abstract, ThrowsDiscussion and other supported delimiters from XML document
  • Update parseFullXMLDocs to support emphasis by replacing <emphasis> with _
  • Add new keys to SwiftDocKey enum
  • Add SwiftDocMarkupDelimiterTests to test each supported delimiter
  • Update test fixtures as needed

Note: Some fixtures are pending to be updated, will fix soon. Any help by maintainers would be appreciated.

@jpsim
Copy link
Owner

jpsim commented May 30, 2020

Thanks for the PR!

To update fixtures, you can set the OVERWRITE_FIXTURES or APPEND_FIXTURES environment variables while running the tests.

Comment on lines +464 to +465
// .replacingOccurrences(of: "<strong>", with: "**")
// .replacingOccurrences(of: "</strong>", with: "**")
Copy link
Owner

Choose a reason for hiding this comment

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

Commented out by mistake?

Copy link
Collaborator Author

@eneko eneko May 30, 2020

Choose a reason for hiding this comment

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

Don't have tests, will probably remove from this PR, or add tests.

import SourceKittenFramework
import XCTest

let markupDelmitersXML = """
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe this could be a file in the Fixtures/ directory instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I wasn't sure how fixtures are set up, but sounds like a good idea.

@eneko
Copy link
Collaborator Author

eneko commented Jun 1, 2020

@jpsim @norio-nomura I'm going to need some help getting these fixtures fixed for all Swift versions supported. Any suggestions?

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.

2 participants