Skip to content

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

Merged
merged 4 commits into from
Mar 17, 2023

Conversation

theMomax
Copy link
Contributor

(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 the swift 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
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@theMomax theMomax requested a review from ethan-kusters March 14, 2023 03:36
@theMomax
Copy link
Contributor Author

@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.
Copy link
Contributor

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.

Copy link
Contributor Author

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() { }
Copy link
Contributor

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?

Copy link
Contributor Author

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!

@@ -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
Copy link
Contributor

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

Copy link
Contributor

@ethan-kusters ethan-kusters left a 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!

@theMomax
Copy link
Contributor Author

@swift-ci please test

@theMomax theMomax merged commit 106fd09 into swiftlang:main Mar 17, 2023
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