-
Notifications
You must be signed in to change notification settings - Fork 55
Add documentation for --include-extended-types
and --help
flags.
#53
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
@swift-ci please test |
@@ -0,0 +1,35 @@ | |||
# Generating Documentation for Extended Types | |||
|
|||
Generate documentation for the extensions you make to types from other modules. |
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.
Up to you; including a screenshot of an extended type or module could be nice so that you see how these extended types will show up in your docs.
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.
Done 👍
public extension ExternalType { | ||
/// This function is not included in | ||
/// the documentation by default. | ||
func foo() { } |
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.
Is there a more real-world/relatable code example we could use here instead of foo? Maybe extending the standard library?
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.
Well...I'm not sure if it is relatable, but it features Sloths!
…d Types documentation
@@ -33,6 +33,10 @@ following from the command-line: | |||
|
|||
$ swift package generate-documentation | |||
|
|||
Use the `--help` flag to get a list of all supported arguments: | |||
|
|||
$ swift package plugin generate-documentation --help |
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 think this is worth leaving for legacy reasons but just FYI – this was fixed in a recent version of ArgumentParser that SwiftPM adopted and should be resolved in nightly toolchains. So soon just this will work:
swift package generate-documentation --help
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.
Looks great! Just a couple of nit-picks but I'm happy for it to land now. Thank you!
Sources/SwiftDocCPluginDocumentation/SwiftDocCPlugin.docc/Resources/extended-type-example.png
Outdated
Show resolved
Hide resolved
...tDocCPluginDocumentation/SwiftDocCPlugin.docc/Generating Documentation for Extended Types.md
Show resolved
Hide resolved
...tDocCPluginDocumentation/SwiftDocCPlugin.docc/Generating Documentation for Extended Types.md
Outdated
Show resolved
Hide resolved
...tDocCPluginDocumentation/SwiftDocCPlugin.docc/Generating Documentation for Extended Types.md
Show resolved
Hide resolved
@swift-ci please test |
(Bug/issue #, if applicable: swiftlang/swift-docc#210)
Summary
Adds a new doc page for the
--include-extended-types
flag.This PR also adds a hint on how to access the
--help
flag to the landing page. I think that many people don't know you have to add theswift package plugin
subcommand to get access to the plugin's help text.Dependencies
None.
Testing
N/A
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
Added testsN/A./bin/test
script and it succeeded