-
Notifications
You must be signed in to change notification settings - Fork 146
add experimental Doxygen support #497
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
rdar://105848459
@swift-ci Please test |
@@ -35,6 +35,7 @@ public struct ConvertAction: Action, RecreatingContext { | |||
let inheritDocs: Bool | |||
let treatWarningsAsErrors: Bool | |||
let experimentalEnableCustomTemplates: Bool | |||
let experimentalParseDoxygenCommands: Bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the changes in this file are needed since we're using the global Features.current
for all the checks. experimentalEnableCustomTemplates
was added prior to the Features
struct so it follows a different model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The primary reason i added it here was for the ConvertSubcommandTests test, since i was basically copying the other test that set up the device-frame support and wanted to make sure that the actions could be used in the test without generating the "unused variable" warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm not totally following. The DeviceFrame support example doesn't add a property here, does it? I don't think it's worth adding here if it's just for a test. We can just assert on the command and the feature flags:
XCTAssertTrue(commandWithFlag.experimentalParseDoxygenCommands)
XCTAssertTrue(FeatureFlags.current.isExperimentalDoxygenSupportEnabled)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like in the time between when i started working on this and when i posted it, the test warning in question has been fixed! 😅 I can take this out.
/// A user-provided value that is true if experimental Doxygen support should be enabled. | ||
/// | ||
/// Defaults to false. | ||
@Flag(help: "Parse a limited set of Doxygen commands as equivalent DocC markup") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Flag(help: "Parse a limited set of Doxygen commands as equivalent DocC markup") | |
@Flag(help: "Parse a limited set of Doxygen commands as equivalent Swift-DocC documentation markup") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the past we've marked these as hidden but I don't have a very strong opinion here either way.
@Flag(help: "Parse a limited set of Doxygen commands as equivalent DocC markup") | |
@Flag(help: .hidden) |
"line" : 49 | ||
} | ||
}, | ||
"text" : "\\param suit The suit of the card." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe one of these should use @
just to cover all of our bases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea, i'll switch one over.
@swift-ci Please test |
@swift-ci Please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Bug/issue #, if applicable: rdar://105848459
Summary
This PR takes the Doxygen support added to Swift-Markdown in swiftlang/swift-markdown#107 and adds it to Swift-DocC behind an experimental flag. By passing
--experimental-parse-doxygen-commands
todocc convert
ordocc preview
,\param
and\returns
commands will be handled as if they were- Parameter
and- Returns
list items. This allows users transitioning from a different documentation system that handles Doxygen or HeaderDoc commands to transition to Swift-DocC without needing to change these commands immediately.Dependencies
None (the Swift-Markdown PR is already merged and is being used in this PR)
Testing
Steps:
Tests/SwiftDocCTests/Test Resources/DeckKit-Objective-C.symbols.json
to a documentation catalog.swift run docc preview MyDocs.docc --experimental-parse-doxygen-commands
[PlayingCard newWithRank:ofSuit:]
correctly displays "Parameters" and "Return Value" sections instead of the raw\param
and\returns
command lines.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded