-
Notifications
You must be signed in to change notification settings - Fork 86
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
Public Functions
header shouldn't be output if there are only private functions
#267
Labels
Comments
This is also true for private resource types, and possibly other things as well. |
danielparks
added a commit
to danielparks/puppet-strings
that referenced
this issue
Sep 26, 2022
Previously, the “Public X” header would be displayed if there were any private X regardless of whether there were and public X. For example, having a private function would make both the “Public Functions” and “Private Functions” headers appear, even if there weren’t any public functions. This changes it so that there are three conditions: * **Only public X:** no “Public” or “Private“ headers are displayed; the X are listed with links to their documentation. (Public is implied.) * **Only private X:** a “Private X” header is is displayed with a list of X. There are no links to documentation for private APIs. * **Both public and private X:** both “Public X” and “Private X” headers are displayed. The public Xs are listed with links to their documentation; the private Xs are just listed with no links. In other words, if there are no private Xs, then it just lists the public once. Otherwise, it splits them up under public/private headers but avoids showing a header if it’s contents will be empty. This also radically simplifies and removes a bunch of boilerplate code around rendering these sections.
danielparks
added a commit
to danielparks/puppet-strings
that referenced
this issue
Sep 26, 2022
Previously, the “Public X” header would be displayed if there were any private X regardless of whether there were any public X. For example, having a private function would make both the “Public Functions” and “Private Functions” headers appear, even if there weren’t any public functions. This changes it so that there are three conditions: * **Only public X:** no “Public” or “Private“ headers are displayed; the X are listed with links to their documentation. (Public is implied.) * **Only private X:** a “Private X” header is is displayed with a list of X. There are no links to documentation for private APIs. * **Both public and private X:** both “Public X” and “Private X” headers are displayed. The public Xs are listed with links to their documentation; the private Xs are just listed with no links. In other words, if there are no private Xs, then it just lists the public once. Otherwise, it splits them up under public/private headers but avoids showing a header if it’s contents will be empty. This also radically simplifies and removes a bunch of boilerplate code around rendering these sections.
PR #314 submitted. |
danielparks
added a commit
to danielparks/puppet-strings
that referenced
this issue
Sep 26, 2022
Previously, the “Public X” header would be displayed if there were any private X regardless of whether there were any public X. For example, having a private function would make both the “Public Functions” and “Private Functions” headers appear, even if there weren’t any public functions. This changes it so that there are three conditions: * **Only public X:** no “Public” or “Private“ headers are displayed; the X are listed with links to their documentation. (Public is implied.) * **Only private X:** a “Private X” header is is displayed with a list of X. There are no links to documentation for private APIs. * **Both public and private X:** both “Public X” and “Private X” headers are displayed. The public Xs are listed with links to their documentation; the private Xs are just listed with no links. In other words, if there are no private Xs, then it just lists the public once. Otherwise, it splits them up under public/private headers but avoids showing a header if it’s contents will be empty. This also radically simplifies and removes a bunch of boilerplate code around rendering these sections.
danielparks
added a commit
to danielparks/puppet-strings
that referenced
this issue
Sep 26, 2022
Previously, the “Public X” header would be displayed if there were any private X regardless of whether there were any public X. For example, having a private function would make both the “Public Functions” and “Private Functions” headers appear, even if there weren’t any public functions. This changes it so that there are three conditions: * **Only public X:** no “Public” or “Private“ headers are displayed; the X are listed with links to their documentation. (Public is implied.) * **Only private X:** a “Private X” header is is displayed with a list of X. There are no links to documentation for private APIs. * **Both public and private X:** both “Public X” and “Private X” headers are displayed. The public Xs are listed with links to their documentation; the private Xs are just listed with no links. In other words, if there are no private Xs, then it just lists the public once. Otherwise, it splits them up under public/private headers but avoids showing a header if it’s contents will be empty. This also radically simplifies and removes a bunch of boilerplate code around rendering these sections.
danielparks
added a commit
to danielparks/puppet-strings
that referenced
this issue
Sep 28, 2022
Previously, the “Public X” header would be displayed if there were any private X regardless of whether there were any public X. For example, having a private function would make both the “Public Functions” and “Private Functions” headers appear, even if there weren’t any public functions. This changes it so that there are three conditions: * **Only public X:** no “Public” or “Private“ headers are displayed; the X are listed with links to their documentation. (Public is implied.) * **Only private X:** a “Private X” header is is displayed with a list of X. There are no links to documentation for private APIs. * **Both public and private X:** both “Public X” and “Private X” headers are displayed. The public Xs are listed with links to their documentation; the private Xs are just listed with no links. In other words, if there are no private Xs, then it just lists the public once. Otherwise, it splits them up under public/private headers but avoids showing a header if it’s contents will be empty. This also radically simplifies and removes a bunch of boilerplate code around rendering these sections.
danielparks
added a commit
to danielparks/puppet-strings
that referenced
this issue
Sep 29, 2022
Previously, the “Public X” header would be displayed if there were any private X regardless of whether there were any public X. For example, having a private function would make both the “Public Functions” and “Private Functions” headers appear, even if there weren’t any public functions. This changes it so that there are three conditions: * **Only public X:** no “Public” or “Private“ headers are displayed; the X are listed with links to their documentation. (Public is implied.) * **Only private X:** a “Private X” header is is displayed with a list of X. There are no links to documentation for private APIs. * **Both public and private X:** both “Public X” and “Private X” headers are displayed. The public Xs are listed with links to their documentation; the private Xs are just listed with no links. In other words, if there are no private Xs, then it just lists the public once. Otherwise, it splits them up under public/private headers but avoids showing a header if it’s contents will be empty. This also radically simplifies and removes a bunch of boilerplate code around rendering these sections.
danielparks
added a commit
to danielparks/puppet-strings
that referenced
this issue
Sep 29, 2022
Previously, the “Public X” header would be displayed if there were any private X regardless of whether there were any public X. For example, having a private function would make both the “Public Functions” and “Private Functions” headers appear, even if there weren’t any public functions. This changes it so that there are three conditions: * **Only public X:** no “Public” or “Private“ headers are displayed; the X are listed with links to their documentation. (Public is implied.) * **Only private X:** a “Private X” header is is displayed with a list of X. There are no links to documentation for private APIs. * **Both public and private X:** both “Public X” and “Private X” headers are displayed. The public Xs are listed with links to their documentation; the private Xs are just listed with no links. In other words, if there are no private Xs, then it just lists the public once. Otherwise, it splits them up under public/private headers but avoids showing a header if it’s contents will be empty. This also radically simplifies and removes a bunch of boilerplate code around rendering these sections.
danielparks
added a commit
to danielparks/puppet-strings
that referenced
this issue
Sep 29, 2022
Previously, the “Public X” header would be displayed if there were any private X regardless of whether there were any public X. For example, having a private function would make both the “Public Functions” and “Private Functions” headers appear, even if there weren’t any public functions. This changes it so that there are three conditions: * **Only public X:** no “Public” or “Private“ headers are displayed; the X are listed with links to their documentation. (Public is implied.) * **Only private X:** a “Private X” header is is displayed with a list of X. There are no links to documentation for private APIs. * **Both public and private X:** both “Public X” and “Private X” headers are displayed. The public Xs are listed with links to their documentation; the private Xs are just listed with no links. In other words, if there are no private Xs, then it just lists the public once. Otherwise, it splits them up under public/private headers but avoids showing a header if it’s contents will be empty. This also radically simplifies and removes a bunch of boilerplate code around rendering these sections.
chelnak
added a commit
that referenced
this issue
Sep 29, 2022
(#267) Don’t show “Public X” header without contents
Should be fixed now in main! |
Closing as per above comment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
Public Functions
header shouldn't be output if there are only private functionsExpected Behavior
When a function is marked as
@api private
it appears under aPrivate Functions
header instead of the genericFunctions
header. If there are no public functions, thePublic Functions
header should be omitted.See example and conversation here.
The text was updated successfully, but these errors were encountered: